阿里Qwen开源Qwen3-VL-Embedding 和 Qwen3-VL-Reranker

概述

Qwen3-VL-Embedding 和 Qwen3-VL-Reranker 模型系列是 Qwen 家族的最新成员,基于近期开源且强大的 Qwen3-VL 基础模型构建。这一系列专为多模态信息检索和跨模态理解设计,可接受多样化的输入,包括文本、图像、截图、视频,以及包含这些模态混合的内容。

在面向文本的 Qwen3-EmbeddingQwen3-Reranker 系列的成功基础上,这些多模态模型将一流的性能扩展至视觉和视频理解任务。这些模型协同工作:Embedding 模型通过生成语义丰富的向量处理初始召回阶段,而 Reranking 模型则通过精确的相关性评分管理重排序阶段,显著提升最终检索准确率。


特点

  • 🎨 多模态通用性:在统一框架内无缝处理包含文本、图像、截图和视频的输入。在图像-文本检索、视频-文本匹配、视觉问答(VQA)和多模态内容聚类等多样化任务中实现业界领先的性能。

  • 🔄 统一表征空间:利用 Qwen3-VL 架构生成语义丰富的向量,在共享空间中捕捉视觉和文本信息,便于跨不同模态的高效相似性估计和检索。

  • 🎯 高精度重排序:重排序模型接受输入对(Query, Document)------两者均可由任意单一或混合模态组成------并输出精确的相关性评分,以提升检索准确率。

  • 🌍 卓越实用性

    • 支持 30 多种语言,适合全球应用
    • 可自定义指令以优化特定任务
    • 通过 Matryoshka 表征学习(MRL)实现灵活的向量维度
    • 量化嵌入支持高效部署,同时保持强劲性能
    • 轻松集成至现有检索流程

模型架构

模型规格

模型 大小 层数 序列长度 嵌入维度 量化支持 MRL 支持 指令感知
Qwen3-VL-Embedding-2B 2B 28 32K 2048
Qwen3-VL-Embedding-8B 8B 36 32K 4096
Qwen3-VL-Reranker-2B 2B 28 32K - - -
Qwen3-VL-Reranker-8B 8B 36 32K - - -

架构设计

Qwen3-VL-Embedding:双塔架构

  • 接收单模态或混合模态输入,将其映射为高维语义向量
  • 从基础模型最后一层提取对应[EOS]标记的隐藏状态向量作为最终语义表示
  • 支持大规模检索所需的高效独立编码

Qwen3-VL-Reranker:单塔架构

  • 接收输入对(Query, Document)进行逐点重排序
  • 采用交叉注意力机制实现更深层次、细粒度的跨模态交互与信息融合
  • 通过预测特殊标记(yesno)的生成概率来表达相关度评分

功能对比

Qwen3-VL-Embedding Qwen3-VL-Reranker
核心功能 语义表示、嵌入生成 相关性评分、逐点重排序
输入 单模态或混合模态 (查询, 文档) 对,支持单模态或混合模态输入
架构 双塔式 单塔式
机制 高效检索 深度跨模态交互、精准对齐
输出 语义向量 相关性分数

这两个模型均通过多阶段训练范式构建,充分利用Qwen3-VL强大的通用多模态语义理解能力,为复杂的大规模多模态检索任务提供高质量的语义表征和精准的重排序机制。


安装

环境配置

bash 复制代码
# Clone the repository
git clone https://github.com/QwenLM/Qwen3-VL-Embedding.git
cd Qwen3-VL-Embedding

# Run the script to setup the environment
bash scripts/setup_environment.sh

安装脚本将自动执行以下操作:

  • 如果尚未安装则自动安装 uv
  • 安装所有项目依赖项

安装完成后,请激活虚拟环境:

bash 复制代码
source .venv/bin/activate

下载模型

我们的模型已在Hugging Face和ModelScope平台上提供。

Model Hugging Face ModelScope
Qwen3-VL-Embedding-2B Link Link
Qwen3-VL-Embedding-8B Link Link
Qwen3-VL-Reranker-2B Link Link
Qwen3-VL-Reranker-8B Link Link

安装下载依赖项:

从Hugging Face下载:

bash 复制代码
uv pip install huggingface-hub

huggingface-cli download Qwen/Qwen3-VL-Embedding-2B --local-dir ./models/Qwen3-VL-Embedding-2B

从ModelScope下载:

bash 复制代码
uv pip install modelscope

modelscope download --model qwen/Qwen3-VL-Embedding-2B --local_dir ./models/Qwen3-VL-Embedding-2B

使用方法

快速开始

嵌入模型
Transformers用法
python 复制代码
import torch
from src.models.qwen3_vl_embedding import Qwen3VLEmbedder

model = Qwen3VLEmbedder(
    model_name_or_path="./models/Qwen3-VL-Embedding-2B",
    # flash_attention_2 for better acceleration and memory saving
    # torch_dtype=torch.bfloat16, 
    # attn_implementation="flash_attention_2"
)

inputs = [{
    "text": "A woman playing with her dog on a beach at sunset.",
    "instruction": "Retrieve images or text relevant to the user's query.",
}, {
    "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"
}, {
    "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"
}]

embeddings = model.process(inputs)
print(embeddings @ embeddings.T)
vLLM 使用指南
python 复制代码
# Requires vllm>=0.14.0
from io import BytesIO

import requests
import torch
from PIL import Image

from vllm import LLM


def get_image_from_url(url) -> Image.Image:
    response = requests.get(url)
    img = Image.open(BytesIO(response.content)).convert("RGB")
    return img


model = LLM(model="Qwen/Qwen3-VL-Embedding-2B", runner="pooling")

image = get_image_from_url("https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg")
image_placeholder = "<|vision_start|><|image_pad|><|vision_end|>"
inputs = [
    {
        "prompt": "A woman playing with her dog on a beach at sunset.",
    },
    {
        "prompt": "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."
    },
    {
        "prompt": image_placeholder,
        "multi_modal_data": {"image": image},
    },
    {
        "prompt": f"{image_placeholder}\nA 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.",
        "multi_modal_data": {"image": image},
    },
]

outputs = model.embed(inputs)
embeddings = torch.tensor([o.outputs.embedding for o in outputs])
scores = embeddings[:2] @ embeddings[2:].T
print(scores.tolist())
重排序模型
Transformers 使用方法
python 复制代码
import torch
from src.models.qwen3_vl_reranker import Qwen3VLReranker

model = Qwen3VLReranker(
    model_name_or_path="./models/Qwen3-VL-Reranker-2B",
    # flash_attention_2 for better acceleration and memory saving
    # torch_dtype=torch.bfloat16, 
    # attn_implementation="flash_attention_2"
)

inputs = {
    "instruction": "Retrieve images or text relevant to the user's query.",
    "query": {"text": "A woman playing with her dog on a beach at sunset."},
    "documents": [
        {"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"},
        {"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"}
    ],
    "fps": 1.0, 
    "max_frames": 64
}

scores = model.process(inputs)
print(scores)
vLLM usage
python 复制代码
# Requires vllm>=0.14.0
from vllm import LLM

model = LLM(
    model="Qwen/Qwen3-VL-Reranker-2B",
    runner="pooling",
    hf_overrides={
        "architectures": ["Qwen3VLForSequenceClassification"],
        "classifier_from_token": ["no", "yes"],
        "is_original_qwen3_reranker": True,
    },
)

query = "A woman playing with her dog on a beach at sunset."
# Sample multimodal documents to be scored against the query
# Each document contains an image URL that will be fetched and processed
documents = {
    "content": [
        {
            "type": "text",
            "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."
        },
        {
            "type": "image_url",
            "image_url": {
                "url": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg"
            },
        },
        {
            "type": "video_url",
            "video_url": {
                "url": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen3-Omni/demo/draw.mp4"
            },
        },
    ]
}
outputs = model.score(query, documents)
print("Relevance scores:", [output.outputs.score for output in outputs])

模型输入规范

多模态对象

可包含以下键的字典:

  • text:字符串形式的文本输入
  • image :图像输入,支持:
    • 本地文件路径
    • URL(网络路径)
    • PIL.Image.Image实例
  • video :视频输入,支持:
    • 本地文件路径
    • URL(网络路径)
    • 视频帧序列
指令

用于相关性评估的任务描述(默认:"Represent the user's input")

视频采样设置

仅当视频输入为视频文件时生效:

  • fps:每秒采样帧数(帧率)
  • max_frames:最大采样帧数
输入格式

嵌入模型:字典列表,每个字典包含:

  • 指令(可选)
  • 视频采样设置(可选)
  • 多模态对象键(text、image和/或video)

重排序模型:包含以下内容的字典:

  • query:多模态对象
  • documents:多模态对象列表
  • instruction:任务描述(可选)
  • fps:视频采样帧率(可选)
  • max_frames:最大帧数(可选)

嵌入模型

模型初始化参数
python 复制代码
Qwen3VLEmbedder(  
    model_name_or_path="./models/Qwen3-VL-Embedding-2B",  
    max_length=8192,           # 默认上下文长度  
    min_pixels=4096,           # 输入图像的最小像素数  
    max_pixels=1843200,        # 输入图像的最大像素数(相当于1280×1440分辨率)  
    total_pixels=7864320,      # 输入视频的最大总像素数(模型中乘以2)  
                              # 对于16帧视频,每帧最多可有983040像素(1280×768分辨率)  
    fps=1.0,                   # 视频文件的默认采样帧率(每秒帧数)  
    num_frames=64,             # 视频输入为帧序列时的默认帧数  
    max_frames=64,             # 视频输入的最大帧数  
    torch_dtype=torch.bfloat16,  
    attn_implementation="flash_attention_2"  
)  

示例

嵌入模型

我们在examples/embedding.ipynb中提供了全面的示例,展示了不同模态下的各种任务:

文本任务:

  • 文本分类(AG News)
  • 文本问答(SQuAD)
  • 文本检索(MS MARCO)

图像任务:

  • 图像分类(CIFAR-10)
  • 图像问答(VQAv2)
  • 图像检索(MS COCO)

视频和视觉文档任务的示例见技术报告的附录。

我们还提供了一个端到端的多模态RAG示例,使用Qwen3-VL-Embedding、Qwen3-VL-Reranker和Qwen3-VL,详见此处

重排序模型

即将推出。


模型性能

嵌入模型

MMEB-V2上的评估结果

MMEB-V2基准测试结果。除IFM-TTE外,所有模型均在更新的VisDoc OOD分割上重新评估。CLS:分类,QA:问答,RET:检索,GD:定位,MRET:时刻检索,VDR:ViDoRe,VR:VisRAG,OOD:分布外。#

Model Model Size Image CLS Image QA Image RET Image GD Image Overall Video CLS Video QA Video RET Video MRET Video Overall VisDoc VDRv1 VisDoc VDRv2 VisDoc VR VisDoc OOD VisDoc Overall All
# of Datasets → 10 10 12 4 36 5 5 5 3 18 10 4 6 4 24 78
VLM2Vec 2B 58.7 49.3 65.0 72.9 59.7 33.4 30.5 20.6 30.7 28.6 49.8 13.5 51.8 48.2 44.0 47.7
VLM2Vec-V2 2B 62.9 56.3 69.5 77.3 64.9 39.3 34.3 28.8 36.8 34.6 75.5 44.9 79.4 62.2 69.2 59.2
GME-2B 2B 54.4 29.9 66.9 55.5 51.9 34.9 42.0 25.6 31.1 33.6 86.1 54.0 82.5 67.5 76.8 55.3
GME-7B 7B 57.7 34.7 71.2 59.3 56.0 37.4 50.4 28.4 37.0 38.4 89.4 55.6 85.0 68.3 79.3 59.1
Ops-MM-embedding-v1 8B 69.7 69.6 73.1 87.2 72.7 59.7 62.2 45.7 43.2 53.8 80.1 59.6 79.3 67.8 74.4 68.9
IFM-TTE 8B 76.7 78.5 74.6 89.3 77.9 60.5 67.9 51.7 54.9 59.2 85.2 71.5 92.7 53.3 79.5 74.1
RzenEmbed 8B 70.6 71.7 78.5 92.1 75.9 58.8 63.5 51.0 45.5 55.7 89.7 60.7 88.7 69.9 81.3 72.9
Seed-1.6-embedding-1215 unknown 75.0 74.9 79.3 89.0 78.0 85.2 66.7 59.1 54.8 67.7 90.0 60.3 90.0 70.7 82.2 76.9
Qwen3-VL-Embedding-2B 2B 70.3 74.3 74.8 88.5 75.0 71.9 64.9 53.9 53.3 61.9 84.4 65.3 86.4 69.4 79.2 73.2
Qwen3-VL-Embedding-8B 8B 74.2 81.1 80.0 92.2 80.1 78.4 71.0 58.7 56.1 67.1 87.2 69.9 88.7 73.3 82.4 77.8
MMTEB 评估结果

在MMTEB基准测试中的结果。

Model Size Mean (Task) Mean (Type) Bitxt Mining Class. Clust. Inst. Retri. Multi. Class. Pair. Class. Rerank Retri. STS
NV-Embed-v2 7B 56.29 49.58 57.84 57.29 40.80 1.04 18.63 78.94 63.82 56.72 71.10
GritLM-7B 7B 60.92 53.74 70.53 61.83 49.75 3.45 22.77 79.94 63.78 58.31 73.33
BGE-M3 0.6B 59.56 52.18 79.11 60.35 40.88 -3.11 20.1 80.76 62.79 54.60 74.12
multilingual-e5-large-instruct 0.6B 63.22 55.08 80.13 64.94 50.75 -0.40 22.91 80.86 62.61 57.12 76.81
gte-Qwen2-1.5B-instruct 1.5B 59.45 52.69 62.51 58.32 52.05 0.74 24.02 81.58 62.58 60.78 71.61
gte-Qwen2-7b-Instruct 7B 62.51 55.93 73.92 61.55 52.77 4.94 25.48 85.13 65.55 60.08 73.98
text-embedding-3-large - 58.93 51.41 62.17 60.27 46.89 -2.68 22.03 79.17 63.89 59.27 71.68
Cohere-embed-multilingual-v3.0 - 61.12 53.23 70.50 62.95 46.89 -1.89 22.74 79.88 64.07 59.16 74.80
Gemini Embedding - 68.37 59.59 79.28 71.82 54.59 5.18 29.16 83.63 65.58 67.71 79.40
Qwen3-Embedding-0.6B 0.6B 64.33 56.00 72.22 66.83 52.33 5.09 24.59 80.83 61.41 64.64 76.17
Qwen3-Embedding-4B 4B 69.45 60.86 79.36 72.33 57.15 11.56 26.77 85.05 65.08 69.60 80.86
Qwen3-Embedding-8B 8B 70.58 61.69 80.89 74.00 57.65 10.06 28.66 86.40 65.63 70.88 81.08
Qwen3-VL-Embedding-2B 2B 63.87 55.84 69.51 65.86 52.50 3.87 26.08 78.50 64.80 67.12 74.29
Qwen3-VL-Embedding-8B 8B 67.88 58.88 77.48 71.95 55.82 4.46 28.59 81.08 65.72 69.41 75.41

重排序模型

我们采用MMEB-v2MMTEB检索基准中多个子任务的检索数据集。针对视觉文档检索任务,我们使用JinaVDRViDoRe v3数据集。实验结果表明,所有Qwen3-VL-Reranker模型均持续超越基础嵌入模型和基线重排序器,其中80亿参数版本在多数任务中表现最优。

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

复现评估流程

嵌入模型

我们基于VLM2Vec提供了MMEB v2基准的可复现评估代码。操作步骤如下:

  1. 下载评估数据

    bash 复制代码
    bash data/evaluation/mmeb_v2/download_data.sh
  2. 执行评估

    bash 复制代码
    bash scripts/evaluation/mmeb_v2/eval_embedding.sh

    不带参数运行脚本可查看必填参数。脚本将自动完成各任务评估与结果汇总。

重排序模型

即将推出。


引用文献

bibtex 复制代码
@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},
  year={2026}
}
相关推荐
人工智能训练4 小时前
【极速部署】Ubuntu24.04+CUDA13.0 玩转 VLLM 0.15.0:预编译 Wheel 包 GPU 版安装全攻略
运维·前端·人工智能·python·ai编程·cuda·vllm
源于花海5 小时前
迁移学习相关的期刊和会议
人工智能·机器学习·迁移学习·期刊会议
DisonTangor6 小时前
DeepSeek-OCR 2: 视觉因果流
人工智能·开源·aigc·ocr·deepseek
薛定谔的猫19826 小时前
二十一、基于 Hugging Face Transformers 实现中文情感分析情感分析
人工智能·自然语言处理·大模型 训练 调优
发哥来了7 小时前
《AI视频生成技术原理剖析及金管道·图生视频的应用实践》
人工智能
数智联AI团队7 小时前
AI搜索引领开源大模型新浪潮,技术创新重塑信息检索未来格局
人工智能·开源
不懒不懒7 小时前
【线性 VS 逻辑回归:一篇讲透两种核心回归模型】
人工智能·机器学习
冰西瓜6007 小时前
从项目入手机器学习——(四)特征工程(简单特征探索)
人工智能·机器学习
Ryan老房7 小时前
未来已来-AI标注工具的下一个10年
人工智能·yolo·目标检测·ai
丝斯20118 小时前
AI学习笔记整理(66)——多模态大模型MOE-LLAVA
人工智能·笔记·学习