Overview of Qwen-VL series

Overview of Qwen-VL series

Author

Published

2025-03-09 15:11:29+0800

Introduction

2025年2月20号Qwen团队发布了Qwen2.5 VL技术报告,Qwen2.5 VL包括3B,7B, 72B三个size。Qwen2.5-VL主要在架构,数据上进行了改进。通过评测,Qwen2.5-VL在多个benchmark上取得了SOTA。

Qwen2.5 VL认为已有模型的缺点为:

Qwen2.5 VL的贡献为:

  1. 使用了一个从零开始训练的ViT作为vision encoder,并且在ViT中使用了window attention,来提高计算效率
  2. 使用了dynamic FPS sampling,用于处理不同采样率的视频输入
  3. 将MRoPE扩展到了temporal domain上,进一步提高了模型在与时间相关任务上的表现
  4. 使用了更高质量的数据集,其中预训练阶段使用了4.1T的token

Qwen2.5 VL的主要亮点为:

模型架构

总览

Qwen2.5 VL和Qwen2 VL的架构基本一致,包括Vision Encoder,Language Encoder,以及projector layer三个部分,其架构图如下:

Qwen2.5 VL架构图

模型的参数配置如下图

Qwen2.5 VL模型参数配置

Vision Encoder

Vision encoder的主要改进点为:

  1. 使用了window attention来提升计算效率,window attention的size为 112×112112\times 112, 对应为 8×88\times 8 个patch. 这样做的好处是可以不用对图片做scaling
  2. 使用了2D RoPE来捕捉空间信息,使用3D RoPE来捕捉视频输入的时间信息
  3. 与LLM的结构进行对齐,包括使用RMSNorm替换LayerNorm,使用SwiGLU替换ReLU

输入处理

对于图片输入,Qwen2.5 VL使用原始图片的空间信息来构建坐标,而不是将坐标normalize到[0, 1000]之间,这样让模型可以处理不同精度的图片输入。

对于视频输入,因为使用了3D RoPE,因此Qwen2.5 VL可以处理不同帧率的视频输入,这样就避免了不同帧率视频对模型视频理解带来的影响。这一点和Apollo里的想法是一样的。具体来说,Qwen2.5 VL首先将连续的两帧group到了一起,然后使用了temporal ID来将position和视频所对应的时间进行对齐。这里可以看Qwen2.5 VL的代码:

Temporal (Time): 3 patches, representing different segments of the video in time.
Height: 2 patches, dividing each frame vertically.
Width: 2 patches, dividing each frame horizontally.
We also have some important parameters:
fps (Frames Per Second): The video's frame rate, set to 1. This means one frame is processed each second.
tokens_per_second: This is a crucial parameter. It dictates how many "time-steps" or "temporal tokens" are conceptually packed into a one-second interval of the video. In this case, we have 25 tokens per second. So each second of the video will be represented with 25 separate time points. It essentially defines the temporal granularity.
temporal_patch_size: The number of frames that compose one temporal patch. Here, it's 2 frames.
interval: The step size for the temporal position IDs, calculated as tokens_per_second * temporal_patch_size / fps. In this case, 25 * 2 / 1 = 50. This means that each temporal patch will be have a difference of 50 in the temporal position IDs.
input_ids: [V V V V V V V V V V V V T T T T T], here V is for vision.
vision temporal position_ids: [0, 0, 0, 0, 50, 50, 50, 50, 100, 100, 100, 100]
vision height position_ids: [0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1]
vision width position_ids: [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]
text temporal position_ids: [101, 102, 103, 104, 105]
text height position_ids: [101, 102, 103, 104, 105]
text width position_ids: [101, 102, 103, 104, 105]
Here we calculate the text start position_ids as the max vision position_ids plus 1.

这里fps为1,表示每一帧对应一秒,tokens_per_second为25,表示每秒包含25个token,temporal_patch_size为2,表示每个temporal patch包含2个frame。因此一个patch里面,就包含了2frame, 对应50tokens. 然后前面提到连续两帧会被group到一起,因此每个temporal patch对应4个spatial patches. 其position_ids为:

[(t, 0, 0), (t, 0, 1), (t, 1, 0), (t, 1, 1)]

训练

预训练

数据

预训练阶段使用了4.1T的token,包括image captions, interleaved image-text data, optical character recognition (OCR) data, visual knowledge (e.g., celebrity, landmark, flora, and fauna identification), multi-modal academic questions, localization data, document parsing data, video descriptions, video localization, and agent-based interaction data. 作者详细介绍了以下几种数据:

训练

Qwen2.5 VL预训练阶段

如上图所示,Qwen2.5 VL的预训练阶段包括了三个阶段:

  1. Visual Pretraining:这一阶段使用了image-caption, knowledge, OCR数据集,旨在提升ViT提取视觉特征的能力
  2. multimodal pretraining:这一阶段在第一阶段的基础上增加了pure-text, interleaved data, VQA, Video grounding, agent data, 旨在提升模型处理复杂视觉信息的能力
  3. long-context pretraining: 这一阶段,在第二阶段的基础上,增加了long video, long agent, long document data,旨在提升模型处理长上下文的能力

后训练

数据

SFT阶段使用大概2M的样本进行训练,其中纯文本和多模态数据占比为1:1,语言主要是中文和英文。

为了保证数据质量,作者提供了一个数据清洗的pipeline,包括:

  1. domain-specific categorization: 作者基于Qwen2-VL-72B构建了Qwen2-VL-Instag,用于将QA pair分为8个大类别,30个小类别
  2. Domain-tailed filtering:作者使用了rule-based和model-based方法来提升数据的质量
    • rule-based filtering: 重复性检测,格式检测等
    • model-based filtering: 使用基于Qwen2.5-VL训练的reward model来从多个维度评估QA pair的质量

为了进一步提升模型的推理能力,作者还是用了rejection sampling来refine 数据集。

训练

post-training阶段分为SFT和DPO两个小阶段,这个阶段都会冻结VIT. SFT阶段使用大多数的训练数据,而DPO阶段专注于image-text data和pure text data,以更好地进行对齐。具体做法就是基于Grounding truth,使用checkpoint来评估数据的质量,然后只保留答案正确的数据来训练。

评测

  1. 通用VQA
通用VQA
  1. 文档理解和OCR
文档理解和OCR
  1. 空间理解
空间理解
  1. 视频理解和Grounding
视频理解和Grounding
  1. Agent
Agent

Reference

Introduction

作者在本文中提出了 Qwen3-VL 系列多模态大模型,包括 4 个 dense 模型和两个 MoE 模型,模型的上下文长度为 256K, 通过数据和训练上的优化,作者保持了模型的纯文本能力。最终 Qwen3-VL 包括 non-thinking 和 thinking variants.

在架构上,Qwen3-VL 进行了三点改进:

  1. Interleaved MRoPE: 作者解决了 Qwen2.5-VL 提出的 MRoPE 在长视频理解场景下的频谱不平衡问题
  2. DeepStack: 作者使用了 DeepStack 来提取 ViT 不同 layer 的视觉特征
  3. Explicit Video timestamps: 作者使用了绝对时间来标记 frame 来提供更直接的时间信息

在数据上,作者使用了 image caption, OCR, grounding, spatial reasoning, code, long documents 以及 temporally grounded video 等数据,作者 还是用了 GUI-agent interaction 数据来提高模型的 action 能力

在训练上,Qwen3-VL 包含两个大的阶段:pre-training 和 post-traing, pre-training 包含 4 个小阶段,post-training 包含 3 个阶段。

Architecture

Qwen3-VL 的架构如下所示

Architecture of Qwen3-VL

其中,

Interleaved MRoPE

这部分介绍见 [[MRoPE-Interleave]]

DeepStack

受 Deepstack 启发,作者从 vision encoder 的中间层(具体来说是第 8, 16, 24 层)提取对应的视觉特征,然后经过 MLP 与 LLM 对应 layer 的视觉 token 直接进行相加。

Architecture of DeepStack

Video Timestamp

作者发现,Qwen2.5-VL 中使用的 MRoPE 存在如下问题:

  1. 将 temporal position 与绝对时间绑定之后,对于长视频会产生非常大且稀疏的 temporal position ids
  2. 需要使用不同的 FPS 进行采样来提高模型的泛化性

为了解决这个问题,作者使用了一个 textual token-based time encoding strategy, 其中每个 video temporal patch 对应的 timestamp 表示为 <3.0 seconds>, 这样视频会被处理为以下格式

<0.0 seconds> <video token> <video token> ... <4.0 seconds> <video token> <video token>

在训练时,作者还使用了 seconds 以及 HMS 两种格式来提高模型对于不同格式的泛化能力。作者认为,虽然这种表示会提高上下文长度,但是也能够提高模型 video grounding 或者 dense captioning 等时序信息敏感任务的表现

Pre-training

Training Recipe

预训练阶段包含 4 个阶段,如下图所示

Qwen3-VL pretraining recipe

Data

Post-training

Post-training 包含三个阶段:

  1. SFT: 提高模型的指令跟随能力,SFT 又分为了两个小阶段,上下文长度分别为 32K 和 256K, 对于 instruct 和 reasoning 版本,作者设计了不同的数据格式,后者包含 CoT reasoning trace
  2. Strong-to-Weak Distillation: 提高小模型的能力,这里应该是和 Qwen3 一样,将大模型的能力蒸馏到小模型里
  3. RL: 提高模型的 reasoning 能力以及人类偏好对齐。这里包含了 Reasoning RL 以及 General RL 两个阶段,覆盖了 math, OCR, grounding, instruction following 等 domain

整体的训练 pipeline 我猜测应该是这样:

Post-training pipeline of Qwen3-VL (guessed)

Code-start Data

Code-start Data 分为 SFT 数据和 Long CoT SFT 数据,前者用于训练 instruct 版模型,后者用于训练 reasoning 版模型

Datataskssamplestrainingfiltering
SFTspatial reasoning
image-grounded reasoning
spatio-temporal grounding
long document understanding
1.2M (1/3 are text-only)- stage 1: 32K
- stage 2: 256K
- query
- rule-based
- model-based
Long CoT SFTVQA, OCR, 2D/3D grounding,
video analysis, STEM, agent
text
= 1:1
- difficulty
- multi-modal
- response quality

Strong-to-Weak Distillation

蒸馏过程包括两个阶段:

RL

Reasoning RL

作者收集了 30K 的 RL 数据,然后对通过率超过 90% 的数据进行过滤 (16 responses per query), 对于 reward, 作者构建了一个 unified reward framework 来提供奖励

训练时,作者使用了 SAPO 算法进行训练

General RL

作者采用了一个 multi-task RL 的范式来提高模型在不同任务上的表现,reward 主要包含两个方面:

  1. instruction following: 评估模型遵循用户指令的能力,包括内容,格式,长度等
  2. preference alignment: 对于开放式问题,评估模型帮助性,事实准确性等方面的表现

基于这两个方面 reward 有两个部分组成:

  1. rule-based reward: 基于规则的 reward, 比如格式要求等
  2. model-based reward: 使用 Qwen2.5-VL 72B 和 Qwen3 作为 judge model 来提供奖励

为了解决模型的重复性实处,中英文混杂等问题,作者构造了一个数据集来故意触发模型这些问题然后加以改正。

Thinking with Images

作者还够在了数据提高模型的 “thinking with images” 的能力,训练包含两个阶段:

  1. Stage 1: 作者构造了 10K Grounding 数据,然后对 Qwen2.5-VL 32B 进行 SFT 来模仿 agent 的行为: think -> act -> analyze feedback -> answer, 然后作者使用 multi-turn, tool-integrated RL 来进一步提高模型的 reasoning 能力
  2. Stage 2: 作者从 Qwen2.5-VL 32B 蒸馏得到 120K multi-turn agentic interactions 数据集, 然后作者使用了相似的 cold-start SFT 以及 tool-integrated RL pipeline 来训练 Qwen3-VL

这里 RL 训练的 reward 包含以下几部分:

  1. answer accuracy reward
  2. multi-turn reasoning reward
  3. tool-calling reward

Experiments

Performance

Qwen3-VL 235B-A22B 的表现如下图所示

Performance of Qwen3-VL 235B-A22B

Ablation Study

作者对比了以下 Qwen3-ViT 和 SigLIP-2 的表现,结果如下图所示

Ablation on Qwen3-ViT

实验结果显示,使用 1.7B 的 Qwen3 和 1.5T tokens 进行训练之后,Qwen3-ViT 的表现超过了 SigLIP2 的表现,验证了 Qwen3-ViT 的有效性

作者对比了 Deepseek 和 baseline 的表现,结果如下图所示

Ablation on DeepStack

可以看到,相比于 baseline, DeepStack 的表现更好,说明了 DeepStack 可以提供更丰富的视觉信息。

作者还评估了以下 Qwen3-VL 在视频版大海捞针任务上的表现,实验结果发现,对于 30 分钟的视频,Qwen3-VL 的准确率为 100%100\%, 通过 YARN 上下文扩展策略,模型在 2 个小时视频上的准确率为 99.5%99.5\%.

Conclusion

作者在本文中提出了 Qwen3-VL 系列多模态大模型,在架构上,作者使用了 interleaved-MRoPE, DeepStack 等改进策略,在数据上,作者扩展了训练数据的多样性,在训练上,作者分别训练了 instruct 版本和 reasoning 版本。最终评估发现,Qwen3-VL 达到了 SOTA 表现。

作者认为,未来的工作在于

  1. 基于 Qwen3-VL 构建具身智能 agent
  2. 提高模型的可交互感知,tool-augmented reasoning 以及 real-time multimodal control 能力
  3. 提高模型与人类学习,合作的能力
  4. 统一理解与生成多模态大模型