Views
No views yet

| Model | Size | Model Layers | Sequence Length | Embedding Dimension | Quantization Support | MRL Support | Instruction Aware |
|---|---|---|---|---|---|---|---|
| Qwen3-VL-Embedding-2B | 2B | 28 | 32K | 2048 | Yes | Yes | Yes |
| Qwen3-VL-Embedding-8B | 8B | 36 | 32K | 4096 | Yes | Yes | Yes |
| Qwen3-VL-Reranker-2B | 2B | 28 | 32K | - | - | - | Yes |
| Qwen3-VL-Reranker-8B | 8B | 36 | 32K | - | - | - | Yes |
Note:
Quantization Supportindicates the supported quantization post process for the output embedding.MRL Supportindicates whether the embedding model supports custom dimensions for the final embedding.Instruction Awarenotes whether the embedding or reranking model supports customizing the input instruction according to different tasks. Our evaluation indicates that, for most downstream tasks, using instructions (instruct) typically yields an improvement of 1% to 5% compared to not using them. Therefore, we recommend that developers create tailored instructions specific to their tasks and scenarios. In multilingual contexts, we also advise users to write their instructions in English, as most instructions utilized during the model training process were originally written in English.
| Model | Size | MMEB-v2(Retrieval) - Avg | MMEB-v2(Retrieval) - Image | MMEB-v2(Retrieval) - Video | MMEB-v2(Retrieval) - VisDoc | MMTEB(Retrieval) | JinaVDR | ViDoRe(v3) |
|---|---|---|---|---|---|---|---|---|
| Qwen3-VL-Embedding-2B | 2B | 73.4 | 74.8 | 53.6 | 79.2 | 68.1 | 71.0 | 52.9 |
| jina-reranker-m0 | 2B | - | 68.2 | - | 85.2 | - | 82.2 | 57.8 |
| Qwen3-VL-Reranker-2B | 2B | 75.1 | 73.8 | 52.1 | 83.4 | 70.0 | 80.9 | 60.8 |
| Qwen3-VL-Reranker-8B | 8B | 79.2 | 80.7 | 55.8 | 86.3 | 74.9 | 83.6 | 66.7 |
pip install sentence_transformers1from sentence_transformers import CrossEncoder
2
3model = CrossEncoder("Qwen/Qwen3-VL-Reranker-2B")
4
5query = "A woman playing with her dog on a beach at sunset."
6documents = [
7 "A woman shares a joyful moment with her golden retriever on a sun-drenched beach at sunset, as the dog offers its paw in a heartwarming display of companionship and trust.",
8 "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",
9 {
10 "text": "A woman shares a joyful moment with her golden retriever on a sun-drenched beach at sunset, as the dog offers its paw in a heartwarming display of companionship and trust.",
11 "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",
12 },
13]
14
15prompt = "Retrieve images or text relevant to the user's query."
16pairs = [(query, doc) for doc in documents]
17scores = model.predict(pairs, prompt=prompt)
18print(scores)
19# [1.8125, 0.5625, 1.3125]
20
21rankings = model.rank(query, documents, prompt=prompt)
22print(rankings)
23# [{'corpus_id': 0, 'score': 1.8125}, {'corpus_id': 2, 'score': 1.3125}, {'corpus_id': 1, 'score': 0.5625}]1scores = model.predict(pairs, activation_fn=torch.nn.Sigmoid(), prompt=prompt)
2print(scores)
3# [0.8594, 0.6367, 0.7891]"query" with instruction "Retrieve text relevant to the user's query.". You can customize the instruction for your use case via the prompt parameter as shown above.1transformers>=4.57.0
2qwen-vl-utils>=0.0.14
3torch==2.8.01from scripts.qwen3_vl_reranker import Qwen3VLReranker
2
3# Specify the model path
4model_name_or_path = "Qwen/Qwen3-VL-Reranker-2B"
5
6# Initialize the Qwen3VLEmbedder model
7model = Qwen3VLReranker(model_name_or_path=model_name_or_path)
8# We recommend enabling flash_attention_2 for better acceleration and memory saving,
9# model = Qwen3VLReranker(model_name_or_path=model_name_or_path, torch_dtype=torch.bfloat16, attn_implementation="flash_attention_2")
10
11# Combine queries and documents into a single input list
12
13inputs = {
14 "instruction": "Retrieve images or text relevant to the user's query.",
15 "query": {"text": "A woman playing with her dog on a beach at sunset."},
16 "documents": [
17 {"text": "A woman shares a joyful moment with her golden retriever on a sun-drenched beach at sunset, as the dog offers its paw in a heartwarming display of companionship and trust."},
18 {"image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg"},
19 {"text": "A woman shares a joyful moment with her golden retriever on a sun-drenched beach at sunset, as the dog offers its paw in a heartwarming display of companionship and trust.", "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg"}
20 ],
21 "fps": 1.0
22}
23
24scores = model.process(inputs)
25print(scores)
26# [0.8613124489784241, 0.6757137179374695, 0.8125371336936951]1import argparse
2import os
3from pathlib import Path
4from typing import Dict, Any
5from vllm import LLM, EngineArgs
6from vllm.entrypoints.score_utils import ScoreMultiModalParam
7
8
9queries = [
10 {"text": "A woman playing with her dog on a beach at sunset."}
11]
12
13documents = [
14 {"text": "A woman shares a joyful moment with her golden retriever on a sun-drenched beach at sunset, as the dog offers its paw in a heartwarming display of companionship and trust."},
15 {"image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg"},
16 {"text": "A woman shares a joyful moment with her golden retriever on a sun-drenched beach at sunset, as the dog offers its paw in a heartwarming display of companionship and trust.",
17 "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg"}
18]
19
20
21def format_document_to_score_param(doc_dict: Dict[str, Any]) -> ScoreMultiModalParam:
22 content = []
23
24 text = doc_dict.get('text')
25 image = doc_dict.get('image')
26
27 if text:
28 content.append({
29 "type": "text",
30 "text": text
31 })
32
33 if image:
34 image_url = image
35 if isinstance(image, str) and not image.startswith(('http', 'https', 'oss')):
36 abs_image_path = os.path.abspath(image)
37 image_url = 'file://' + abs_image_path
38
39 content.append({
40 "type": "image_url",
41 "image_url": {
42 "url": image_url
43 }
44 })
45
46 if not content:
47 content.append({
48 "type": "text",
49 "text": ""
50 })
51
52 return {"content": content}
53
54
55def main():
56 parser = argparse.ArgumentParser(description="Offline Reranker with vLLM")
57 parser.add_argument("--model-path", type=str, default="models/Qwen3-VL-Reranker-2B", help="Path to the reranker model")
58 parser.add_argument("--dtype", type=str, default="bfloat16", help="Data type (e.g., bfloat16)")
59 parser.add_argument("--template-path", type=str, default="vllm/examples/pooling/score/template/qwen3_vl_reranker.jinja",
60 help="Path to chat template file")
61 args = parser.parse_args()
62
63 print(f"Loading model from {args.model_path}...")
64
65 engine_args = EngineArgs(
66 model=args.model_path,
67 runner="pooling",
68 dtype=args.dtype,
69 trust_remote_code=True,
70 hf_overrides={
71 "architectures": ["Qwen3VLForSequenceClassification"],
72 "classifier_from_token": ["no", "yes"],
73 "is_original_qwen3_reranker": True,
74 },
75 )
76
77 llm = LLM(**vars(engine_args))
78
79 template_path = Path(args.template_path)
80 chat_template = template_path.read_text() if template_path.exists() else None
81
82 for query_dict in queries:
83 query_text = query_dict.get('text', '')
84 print(f"\nQuery: {query_text}")
85
86 scores = []
87 for doc_dict in documents:
88 doc_param = format_document_to_score_param(doc_dict)
89 outputs = llm.score(query_text, doc_param, chat_template=chat_template)
90 score = outputs[0].outputs.score
91 scores.append(score)
92
93 print(scores)
94
95
96if __name__ == "__main__":
97 main()
98@article{qwen3vlembedding,
title={Qwen3-VL-Embedding and Qwen3-VL-Reranker: A Unified Framework for State-of-the-Art Multimodal Retrieval and Ranking},
author={Li, Mingxin and Zhang, Yanzhao and Long, Dingkun and Chen Keqin and Song, Sibo and Bai, Shuai and Yang, Zhibo and Xie, Pengjun and Yang, An and Liu, Dayiheng and Zhou, Jingren and Lin, Junyang},
journal={arXiv preprint arXiv:2601.04720},
year={2026}
}