HighLights
The Diver Retriever 0.6B model is a reasoning-intensive model designed to tackle the challenge of reasonIR and rader.
We combined data from the fields of mathematics, coding, and healthcare. At the same time, we made precise matching in terms of the difficulty level of the samples, and uniquely
constructed negative samples corresponding to each field. Therefore, this model performs very well on the Bright LeaderBoard
as well as the Mteb-Medical Benchmark.
Its quantize model has been downloaded 1.4k+ at https://huggingface.co/mradermacher/Diver-Retriever-0.6B-GGUF.
Model Description
- Model type: Text Embedding
- Language(s) (NLP): Bilingual (Chinese & English)
- Context Length: 32k
- Number of Paramaters: 0.6B
For more details, including benchmark evaluation, hardware requirements, and inference performance, please refer to our GitHub (https://github.com/AQ-MedAI/Diver).
Evaluation
Evaluation of Bright Benchmark
Usage
Inference
# Requires transformers>=4.51.0# Requires sentence-transformers>=2.7.0 from sentence_transformers import SentenceTransformer # Load the modelmodel = SentenceTransformer("AQ-MedAI/Diver-Retriever-0.6B") # The queries and documents to embedqueries = [ "What is the capital of China?", "Explain gravity",]documents = [ "The capital of China is Beijing.", "Gravity is a force that attracts two bodies towards each other. It gives weight to physical objects and is responsible for the movement of planets around the sun.",] # Encode the queries and documents. Note that queries benefit from using a prompt# Here we use the prompt called "query" stored under `model.prompts`, but you can# also pass your own prompt via the `prompt` argumentquery_embeddings = model.encode(queries, prompt_name="query")document_embeddings = model.encode(documents) # Compute the (cosine) similarity between the query and document embeddingssimilarity = model.similarity(query_embeddings, document_embeddings)print(similarity)
# Requires transformers>=4.51.0import torchimport torch.nn.functional as F from torch import Tensorfrom transformers import AutoTokenizer, AutoModel def last_token_pool(last_hidden_states: Tensor, attention_mask: Tensor) -> Tensor: left_padding = (attention_mask[:, -1].sum() == attention_mask.shape[0]) if left_padding: return last_hidden_states[:, -1] else: sequence_lengths = attention_mask.sum(dim=1) - 1 batch_size = last_hidden_states.shape[0] return last_hidden_states[torch.arange(batch_size, device=last_hidden_states.device), sequence_lengths] def get_detailed_instruct(task_description: str, query: str) -> str: return f'Instruct: {task_description}\nQuery:{query}' # Each query must come with a one-sentence instruction that describes the tasktask = 'Given a web search query, retrieve relevant passages that answer the query' queries = [ get_detailed_instruct(task, 'What is the capital of China?'), get_detailed_instruct(task, 'Explain gravity')]# No need to add instruction for retrieval documentsdocuments = [ "The capital of China is Beijing.", "Gravity is a force that attracts two bodies towards each other. It gives weight to physical objects and is responsible for the movement of planets around the sun."]input_texts = queries + documents tokenizer = AutoTokenizer.from_pretrained('AQ-MedAI/Diver-Retriever-0.6B', padding_side='left')model = AutoModel.from_pretrained('AQ-MedAI/Diver-Retriever-0.6B') max_length = 8192 # Tokenize the input textsbatch_dict = tokenizer( input_texts, padding=True, truncation=True, max_length=max_length, return_tensors="pt",)batch_dict.to(model.device)outputs = model(**batch_dict)embeddings = last_token_pool(outputs.last_hidden_state, batch_dict['attention_mask']) # normalize embeddingsembeddings = F.normalize(embeddings, p=2, dim=1)scores = (embeddings[:2] @ embeddings[2:].T)print(scores.tolist())# [[0.7534257769584656, 0.1146894246339798], [0.03198453038930893, 0.6258305311203003]]
Finetuning
We recommend you to use swift to finetune our DIVER-Retriever-0.6B with infonce.
Before starting training, please ensure your environment is properly configured.
pip install ms-swift -U# Install from sourcepip install git+https://github.com/modelscope/ms-swift.git pip install transformers -U # Optional packagespip install deepspeed # multi-GPU trainingpip install liger-kernel # save GPU memory resourcespip install flash-attn --no-build-isolation
Training Command
Using infonce loss as an example, the complete training command is as follows:
nproc_per_node=8NPROC_PER_NODE=$nproc_per_node \swift sft \ --model AQ-MedAI/Diver-Retriever-0.6B \ --task_type embedding \ --model_type qwen3_emb \ --train_type full \ --dataset your_dataset \ --split_dataset_ratio 0.05 \ --eval_strategy steps \ --output_dir output \ --eval_steps 20 \ --num_train_epochs 5 \ --save_steps 20 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --gradient_accumulation_steps 4 \ --learning_rate 6e-6 \ --loss_type infonce \ --label_names labels \ --dataloader_drop_last true \ --deepspeed zero3
Citation
If you find our work helpful, feel free to cite it.
@misc{long2025divermultistageapproachreasoningintensive, title={DIVER: A Multi-Stage Approach for Reasoning-intensive Information Retrieval}, author={Meixiu Long and Duolin Sun and Dan Yang and Junjie Wang and Yue Shen and Jian Wang and Peng Wei and Jinjie Gu and Jiahai Wang}, year={2025}, eprint={2508.07995}, archivePrefix={arXiv}, primaryClass={cs.IR}, url={https://arxiv.org/abs/2508.07995}, }