Qwen-Visual Langugage, 基于 Qwen-7B 的多模态视觉语言大模型. 支持图文理解、文档解析、OCR、视觉问答等任务.
VLLM, Visual-Language Large Model,
2. 模型架构
基于 Qwen-7B, 新增了 a language-aligned visual encoder and a position aware adapter.
Large Language Model
Visual Encoder
Vision Transformer (ViT), weights from Openclip's ViT-bigG .
The visual encoder processes images by splitting them into patches with a stride of 14, generating a set of image features.
Position-aware Vision-Language Adapter:
3. 阶段训练

3.1 ViT 预训练
冻结 LLM,只训视觉编码器,用大规模图文对数据建立视觉-文本关联
3.2 全参数预训练
Multi-Task Pre-training
xml
Image Captioning
<img>cc3m/01581435.jpg</img>Generate the caption in English: the beautiful flowers for
design.<eos>
Vision Question Answering
<img>VG_100K_2/1.jpg</img> Does the bandage have a different color than the wrist band?
Answer: No, both the bandage and the wrist band are white.<eos>
3.3 SFT - Qwen-VL-Chat
这是 Qwen-VL 从预训练模型到对话模型(Qwen-VL-Chat)的有监督微调(SFT)阶段。SFT 本身就能出 Chat 模型, 后续没有 RLHF 和 DPO 等对齐.
冻结 ViT,只调 LLM 和 Adapter,用 ChatML 格式的指令数据微调出 Chat 版本.
核心信息几个点.
数据总量:指令微调数据一共 350k 条,对于当时的多模态模型来说算比较精简的。
训练策略:冻结视觉编码器(Visual Encoder),只优化语言模型和 Adapter 模块。这是一个很常见的做法------视觉编码器在预训练阶段已经学好了特征提取能力,SFT 阶段不需要再动它,既省算力也避免灾难性遗忘。
xml
// The Dataset Format Example of ChatML
<im_start>user
Picture 1: <img>vg/VG_100K_2/649.jpg</img>What is the sign in the picture?<im_end>
<im_start>assistant
The sign is a road closure with an orange rhombus.<im_end>
<im_start>user
How is the weather in the picture?<im_end>
<im_start>assistant
The shape of the road closure sign is an orange rhombus.<im_end>
评测 benchmarks
Image Caption
General VQA
Instruction Following, 指令遵循.
附录
chatML
Chat Markup Language, 类比于 xml, 由 openAI 推出的 将 对话 组织为样本的 结构化表示格式. 把「指令 + 输入 + 期望输出」组织成 role 化的消息序列:
- system:设定角色/规则(可选)
- user:指令 + 输入
- assistant:期望的回答(训练时算 loss 的部分)
一个例子:
xml
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
指令数据是什么?<|im_end|>
<|im_start|>assistant
指令数据是指......<|im_end|>