Introduction
Background
Model architecture
多模态大模型可以粗略的分为两类: cross-attention-based 和 auto-regressive-based
cross-attention-based MLLM
举例, Flamingo 和 Blip-2
auto-regressive-based
举例, Fuyu-8B, Palm-e, Llava, Openflamingo. 将 textual tokens 和 visual tokens concat在一起. 这也是本文主要关注的部分
通常由 visiual encoder, LLM, projector 组成. projector 可以是 linear, mlp 或 TransformerBlocks
Training stages
Projector initialization
随机初始化 projector, 冻结 LLM 和 visual encoder, 使用 image-caption 对训练
visual language pre-training
pre-training, 使用 visual language corpus (视觉语言语言库) 训练 LLM 和 projector. 主要使用交错图像文本语料库 (interleaved image-text corpus) 和图像文本对 (image-text pairs). 这一步参考了 Instructblip, Blip-2 和 Llava
交错图像文本语料库 (interleaved image-text corpus)
举例 MMC4 (“An open, billion-scale corpus of images interleaved with text”)
image-text pairs
举例 COYO (“Coyo-700m: Image-text pair dataset”), LAION (“Laion-5b: An open large-scale dataset for training next generation image-text models”)
Visual instruction-tuning
在预训练好的模型上使用 visual language instruction datasets 进行指令微调, 作者按照 Instructblip 论文的方法将现有的数据集转化为 FLAN 格式, 在补充材料里有说视觉指令数据的数据混合方式
Evaluations
论文使用了四种评估方法: OKVQA, TextVQA 任务的 accuracy, COCO 和 Flickr 数据集的 CIDEr 分数. 在 zero-shot 和 4-short 任务上验证了模型的 ICL 能力
On Pre-training for Visual Language Models
Updating LLM is Essential
Fine-tuning vs. prompt tuning
两种使用 visual tokens 增强 LLM的方法:
- 在 visual input tokens 上微调 LLMs. eg. Palm-e, Llava
- 冻结 LLM, 使用 prompt tuning 微调 projector. eg. Instructblip, Blip-2
作者在 Table 1 中改变了训练部位, pojector 类型, 0/4-shot. 得到以下结论:
- SFT 时仅训练 projector 效果不好
- 预训练时冻结LLM 不会影响 zero-shot 能力, 但 ICL 能力下降, 表现为 4-shot 能力下降
- projector 使用 linear时, 效果会好一些. 这里作者推测是简单的projector 会使 LLM 更关注视觉信息, 但是没有给出更细节的验证
The deep embedding alignment hypothesis
针对上面 “微调 LLM 有益” 的结论, 作者假设对齐视觉和文本的 Embedding 分布很重要.
验证: 计算 the Chamfer distance of visual and textual embedidings in different layers, 计算了倒角距离 (Chamfer distance / pairwise cosine similarity) 和成对余弦相似度 (pairwise cosine similarity), 证明了 ICL 能力与对齐的相关性.
通过以上分析, 作者设置在 pre-training 和 instruction-tuning 两个阶段都微调 LLM
Interleaved Visual Language Corpus Helps Pre-Training
多模态大模型不是只关注视觉输入, 也要保存关注文本输入的能力. 所以数据混合是很有意义的
Pre-training dataset options
没看懂. 不混合是指只用文本去初始化projector?
大多数 VLM pre-training 都使用 image-text 对 (reason: wide availability and large diversity), 如 LAION (Laion-5b: An open large-scale dataset for training next generation image-text models), COYO (Coyo-700m: Image-text pair dataset)
Interleaved data is essential
没看懂
Interleave data structure matters, but not the text distribution
Data blending improves pre-training
Recover LLM Degradation with Joint SFT
在图像-文本数据集中混入纯文本数据能维持纯文本处理能力, 但依然会有准确度的下降. 既有的数据集存在不开源等等的问题, 所以作者提出了 “Joint SFT” 数据集. 作者认为, text-only 能力在混合的数据集训练后只是被隐藏了, 不是被遗忘或破坏了
Joint supervised fine-tuning
Table 4 表明, 混入纯文本数据可以同时恢复模型在 text-only 条件下的准确率, 提高visual language accuracy. 作者从 FLAN 采样了 1M text-only 指令微调数据, 称为 “joint SFT”