00前言
凌晨,Qwen3-VL系列再添新成员——Dense架构的Qwen3-VL-8B、Qwen3-VL-4B 模型,本地部署友好,并完整保留了Qwen3-VL的全部表现,评测指标表现优秀。
至此,Qwen3-VL 家族已经覆盖了从轻量级到超大规模的多种需求:除了最新开源发布的小尺寸Dense模型外,还有旗舰版模型混合专家(MoE)架构的Qwen3-VL-235B-A22B,以及小的MoE模型Qwen3-VL-30B-A3B,每个size同时包含 Instruct 与 Thinking 两个版本。在官方发布的benchmark中,Qwen3-VL-235B-A22B-Instruct 版本在多项主流视觉感知评测性能已达到甚至超过 Gemini 2.5 Pro;而 Qwen3-VL-235B-A22B-Thinking 版本更是在众多多模态推理的评测基准下取得了 SOTA 的表现。
在这一代模型中,Qwen3-VL系列在多个维度实现了全面跃升:无论是纯文本理解与生成,还是视觉内容的感知与推理;无论是上下文长度的支持能力,还是对空间关系、动态视频的理解深度;乃至在与Agent交互中的表现,Qwen3-VL 都展现出显著进步。
模型合集:
https://modelscope.cn/collections/Qwen3-VL-5c7a94c8cb144b
官方CookBook:
https://github.com/QwenLM/Qwen3-VL/blob/main/cookbooks
01核心亮点
Qwen3-VL 的目标,是让模型不仅能“看到”图像或视频,更能真正看懂世界、理解事件、做出行动。为此,Qwen3-VL在多个关键能力维度上做了系统性升级,力求让视觉大模型从“感知”走向“认知”,从“识别”迈向“推理与执行”。
- 视觉智能体(Visual Agent):Qwen3-VL 能操作电脑和手机界面、识别 GUI 元素、理解按钮功能、调用工具、执行任务,在 OS World 等 benchmark 上达到世界顶尖水平,能通过调用工具有效提升在细粒度感知任务的表现。
- 纯文本能力媲美顶级语言模型:Qwen3-VL 在预训练早期即混合文本与视觉模态协同训练,文本能力持续强化,最终在纯文本任务上表现与 Qwen3-235B-A22B-2507 纯文本旗舰模型不相上下 —— 是真正“文本根基扎实、多模态全能”的新一代视觉语言模型。
- 视觉 Coding 能力大幅提升:实现图像生成代码以及视频生成代码,例如看到设计图,代码生成 http://Draw.io/HTML/CSS/JS 代码,真正实现“所见即所得”的视觉编程。
- 空间感知能力大幅提升:2D grounding 从绝对坐标变为相对坐标,支持判断物体方位、视角变化、遮挡关系,能实现 3D grounding,为复杂场景下的空间推理和具身场景打下基础。
- 长上下文支持和长视频理解:全系列模型原生支持 256K token 的上下文长度,并可扩展至 100 万 token。这意味着,无论是几百页的技术文档、整本教材,还是长达两小时的视频,都能完整输入、全程记忆、精准检索,支持视频精确定位到秒级别时刻。
- 多模态思考能力显著增强:Thinking 模型重点优化了 STEM 与数学推理能力。面对专业学科问题,模型能捕捉细节、抽丝剥茧、分析因果、给出有逻辑、有依据的答案,在 MathVision、MMMU、MathVista 等权威评测中达到领先水平。
- 视觉感知与识别能力全面升级:通过优化预训练数据的质量和广度,模型现在能识别更丰富的对象类别——从名人、动漫角色、商品、地标,到动植物等,覆盖日常生活与专业领域的“万物识别”需求。
- OCR 支持更多语言及复杂场景:支持的中英外的语言从 10 种扩展到 32 种,覆盖更多国家和地区;在复杂光线、模糊、倾斜等实拍挑战性场景下表现更稳定;对生僻字、古籍字、专业术语的识别准确率也显著提升;超长文档理解和精细结构还原能力进一步提升。
02模型性能
从十个维度全面评估了模型的视觉能力,涵盖综合大学题目、数学与科学推理、逻辑谜题、通用视觉问答、主观体验与指令遵循、多语言文本识别与图表文档解析、二维与三维目标定位、多图理解、具身与空间感知、视频理解、智能体任务执行以及代码生成等方面。整体来看,Qwen3-VL-235B-A22B-Instruct 在非推理类模型中多数指标表现最优,显著超越了 Gemini 2.5 Pro 和 GPT-5 等闭源模型,同时刷新了开源多模态模型的最佳成绩,展现了其在复杂视觉任务中的强大泛化能力与综合性能。
在推理模型方面, Qwen3-VL-235B-A22B-Thinking 同样在多数指标上创下开源多模态模型的新高,与 Gemini 2.5 Pro 和 GPT-5 等闭源顶尖模型相比各有胜负。尤其在 Mathvision 这类复杂的多模态数学题目上,其表现甚至优于 Gemini 2.5 Pro。虽然在多学科问题、视觉推理和视频理解方面与闭源 SOTA 模型仍存在一定差距,但在 Agent 能力、文档理解、2D/3D Grounding等任务上展现出明显优势。
在纯文本任务上,无论是Qwen3-VL-235B-A22B的Instruct和Thinking都表现出强大的性能,与Qwen3-235B-A22B-2507的纯文本模型不相上下。
最新推出的Dense模型的评测性能也很突出,尤其8B模型可比肩Gemini 2.5 Flash Lite和GPT-5 Nano。
多模态性能
纯文本性能
03模型更新
在架构上,仍旧采用原生动态分辨率设计,但在结构设计上进行了更新:
一是采用 MRoPE-Interleave,原始MRoPE将特征维度按照时间(t)、高度(h)和宽度(w)的顺序分块划分,使得时间信息全部分布在高频维度上。研究团队在 Qwen3-VL 中采取了 t,h,w 交错分布的形式,实现对时间,高度和宽度的全频率覆盖,这样更加鲁棒的位置编码能够保证模型在图片理解能力相当的情况下,提升对长视频的理解能力;
二是引入 DeepStack 技术,融合 ViT 多层次特征,提升视觉细节捕捉能力和图文对齐精度;沿用 DeepStack 的核心思想,将以往多模态大模型(LMM)单层输入视觉tokens的范式,改为在大型语言模型 (LLM) 的多层中进行注入。这种多层注入方式旨在实现更精细化的视觉理解。
在此基础上,官方进一步优化了视觉特征 token 化的策略。具体而言,Qwen团队将来自 ViT 不同层的视觉特征进行 token 化,并以此作为视觉输入。这种设计能够有效保留从底层(low-level)到高层(high-level)的丰富视觉信息。实验结果表明,该方法在多种视觉理解任务上均展现出显著的性能提升。
三是将原有的视频时序建模机制 T-RoPE 升级为 文本时间戳对齐机制。该机采用“时间戳-视频帧”交错的输入形式,实现帧级别的时间信息与视觉内容的细粒度对齐。同时,模型原生支持“秒数”与“时:分:秒”(HMS)两种时间输出格式。这一改进显著提升了模型对视频中动作、事件的语义感知与时间定位精度,使其在复杂时序推理任务——如事件定位、动作边界检测、跨模态时间问答等——中表现更稳健、响应更精准。
04模型推理
MoE模型
from modelscope import Qwen3VLMoeForConditionalGeneration, AutoProcessor # default: Load the model on the available device(s) model = Qwen3VLMoeForConditionalGeneration.from_pretrained( "Qwen/Qwen3-VL-30B-A3B-Instruct", dtype="auto", device_map="auto" ) # We recommend enabling flash_attention_2 for better acceleration and memory saving, especially in multi-image and video scenarios. # model = Qwen3VLMoeForConditionalGeneration.from_pretrained( # "Qwen/Qwen3-VL-30B-A3B-Instruct", # dtype=torch.bfloat16, # attn_implementation="flash_attention_2", # device_map="auto", # ) processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-30B-A3B-Instruct") messages = [ { "role": "user", "content": [ { "type": "image", "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg", }, {"type": "text", "text": "Describe this image."}, ], } ] # Preparation for inference inputs = processor.apply_chat_template( messages, tokenize=True, add_generation_prompt=True, return_dict=True, return_tensors="pt" ) # Inference: Generation of the output generated_ids = model.generate(**inputs, max_new_tokens=128) generated_ids_trimmed = [ out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids) ] output_text = processor.batch_decode( generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False ) print(output_text)
Dense模型
from modelscope import Qwen3VLForConditionalGeneration, AutoProcessor # default: Load the model on the available device(s) model = Qwen3VLForConditionalGeneration.from_pretrained( "Qwen/Qwen3-VL-4B-Instruct", dtype="auto", device_map="auto" ) # We recommend enabling flash_attention_2 for better acceleration and memory saving, especially in multi-image and video scenarios. # model = Qwen3VLForConditionalGeneration.from_pretrained( # "Qwen/Qwen3-VL-4B-Instruct", # dtype=torch.bfloat16, # attn_implementation="flash_attention_2", # device_map="auto", # ) processor = AutoProcessor.from_pretrained("Qwen/Qwen/Qwen3-VL-4B-Instruct") messages = [ { "role": "user", "content": [ { "type": "image", "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg", }, {"type": "text", "text": "Describe this image."}, ], } ] # Preparation for inference inputs = processor.apply_chat_template( messages, tokenize=True, add_generation_prompt=True, return_dict=True, return_tensors="pt" ) # Inference: Generation of the output generated_ids = model.generate(**inputs, max_new_tokens=128) generated_ids_trimmed = [ out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids) ] output_text = processor.batch_decode( generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False ) print(output_text)
05API调用
ModelScope平台也第一时间上线适配了Qwen3-VL模型的API,开发者可以通过ModelScope的免费API-Inference来直观体验模型的效果。相关实例代码在模型页面右侧(例如https://www.modelscope.cn/models/Qwen/Qwen3-VL-8B-Instruct)即可找到:
06模型微调
我们推荐使用ms-swift对Qwen3-VL进行微调。ms-swift是魔搭社区官方提供的大模型与多模态大模型训练部署框架。ms-swift开源地址:https://github.com/modelscope/ms-swift
在开始微调之前,请确保您的环境已准备妥当。
pip install transformers qwen_vl_utils -U # pip install git+https://github.com/modelscope/ms-swift.git git clone https://github.com/modelscope/ms-swift.git cd ms-swift pip install -e .
如果您需要自定义数据集微调模型,你可以将数据准备成以下格式,并在命令行中设置`--dataset xxx.jsonl`。
{"messages": [{"role": "user", "content": "浙江的省会在哪?"}, {"role": "assistant", "content": "浙江的省会在杭州。"}]} {"messages": [{"role": "user", "content": "<image><image>两张图片有什么区别"}, {"role": "assistant", "content": "前一张是小猫,后一张是小狗"}], "images": ["/xxx/x.jpg", "/xxx/x.png"]} {"messages": [{"role": "system", "content": "你是个有用无害的助手"}, {"role": "user", "content": "<image>图片中是什么,<video>视频中是什么"}, {"role": "assistant", "content": "图片中是一个大象,视频中是一只小狗在草地上奔跑"}], "images": ["/xxx/x.jpg"], "videos": ["/xxx/x.mp4"]}
ms-swift支持了使用transformers和megatron后端对Qwen3-VL进行训练,这里我们只对transformers后端进行介绍。若要使用megatron对Qwen3-VL进行训练,请参考对应脚本:https://github.com/modelscope/ms-swift/blob/main/examples/models/qwen3_vl/mcore.sh
Moe
显存占用:2 * 42GiB
# 需额外安装flash_attn, liger_kernel, deepspeed IMAGE_MAX_TOKEN_NUM=1024 \ NPROC_PER_NODE=2 \ CUDA_VISIBLE_DEVICES=0,1 \ swift sft \ --model Qwen/Qwen3-VL-30B-A3B-Instruct \ --dataset 'AI-ModelScope/LaTeX_OCR:human_handwrite#20000' \ --load_from_cache_file true \ --split_dataset_ratio 0.01 \ --train_type lora \ --torch_dtype bfloat16 \ --num_train_epochs 1 \ --per_device_train_batch_size 16 \ --per_device_eval_batch_size 16 \ --attn_impl flash_attn \ --padding_free true \ --learning_rate 1e-4 \ --lora_rank 8 \ --lora_alpha 32 \ --target_modules all-linear \ --router_aux_loss_coef 1e-3 \ --freeze_vit true \ --freeze_aligner true \ --gradient_accumulation_steps 1 \ --gradient_checkpointing true \ --eval_steps 100 \ --save_steps 100 \ --save_total_limit 2 \ --logging_steps 5 \ --max_length 2048 \ --output_dir output \ --warmup_ratio 0.05 \ --deepspeed zero3 \ --use_liger_kernel true \ --dataset_num_proc 4 \ --dataloader_num_workers 4
Dense
显存占用:20GiB
IMAGE_MAX_TOKEN_NUM=1024 \ CUDA_VISIBLE_DEVICES=0 \ swift sft \ --model Qwen/Qwen3-VL-8B-Instruct \ --dataset 'AI-ModelScope/LaTeX_OCR:human_handwrite#20000' \ --load_from_cache_file true \ --split_dataset_ratio 0.01 \ --train_type lora \ --torch_dtype bfloat16 \ --num_train_epochs 1 \ --per_device_train_batch_size 1 \ --per_device_eval_batch_size 1 \ --learning_rate 1e-4 \ --lora_rank 8 \ --lora_alpha 32 \ --target_modules all-linear \ --freeze_vit true \ --freeze_aligner true \ --gradient_accumulation_steps 16 \ --gradient_checkpointing true \ --eval_steps 100 \ --save_steps 100 \ --save_total_limit 2 \ --logging_steps 5 \ --max_length 2048 \ --output_dir output \ --warmup_ratio 0.05 \ --dataset_num_proc 4 \ --dataloader_num_workers 4
训练完成后,使用以下命令对验证集进行推理:
swift infer \ --adapters output/vx-xxx/checkpoint-xxx \ --stream true \ --load_data_args true \ --max_new_tokens 2048
推送模型到ModelScope:
swift export \ --adapters output/vx-xxx/checkpoint-xxx \ --push_to_hub true \ --hub_model_id '<your-model-id>' \ --hub_token '<your-sdk-token>'
点击即可跳转模型合集
Qwen3-VLmodelscope.cn/collections/Qwen3-VL-5c7a94c8cb144b