We introduce CogVLM, a powerful open-source visual language foundation model. Different from the popular shallow alignment method which maps image features into the input space of language model, CogVLM bridges the gap between the frozen pretrained language model and image encoder by a trainable visual expert module in the attention and FFN layers. As a result, CogVLM enables deep fusion of vision language features without sacrificing any performance on NLP tasks. CogVLM-17B achieves state-of-the-art performance on 10 classic cross-modal benchmarks, including NoCaps, Flicker30k captioning, RefCOCO, RefCOCO+, RefCOCOg, Visual7W, GQA, ScienceQA, VizWiz VQA and TDIUC, and ranks the 2nd on VQAv2, OKVQA, TextVQA, COCO captioning, etc., surpassing or matching PaLI-X 55B. Codes and checkpoints are available at https://github.com/THUDM/CogVLM.
核心贡献 · Key contributions
提出 CogVLM,一种通过可训练视觉专家模块实现视觉与语言特征深度融合的视觉语言模型。 Introduces CogVLM, a visual language model with a trainable visual expert module for deep fusion of vision and language features.
在 17 个跨模态基准上达到最先进水平,涵盖图像描述、视觉问答和视觉定位。 Achieves state-of-the-art on 17 cross-modal benchmarks, including image captioning, VQA, and visual grounding.
通过冻结预训练语言模型参数并添加视觉专家,完整保留其 NLP 能力。 Preserves full NLP capabilities of the pretrained language model by freezing its parameters and adding visual experts.
通过大量消融实验验证了视觉专家模块和深度融合的有效性。 Validates the visual expert module and deep fusion through extensive ablation studies.
公开模型权重和 SFT 数据集,促进研究和工业应用。 Releases model weights and SFT dataset to the public for research and industrial applications.
探索多模态预训练中的关键因素,包括视觉编码器规模、注意力掩码和自监督损失。 Explores critical factors in multimodal pretraining, including visual encoder scale, attention mask, and self-supervised loss.
局限 · Limitations
CogVLM-17B 基于 Vicuna-7B 训练,限制了向更大语言模型的扩展性。 CogVLM-17B is trained from Vicuna-7B, limiting scalability to larger language models.
视觉专家模块使参数量翻倍,增加了内存和存储需求。 The visual expert module doubles parameters, increasing memory and storage requirements.
在 TextVQA 等文本密集型任务上,性能依赖视觉编码器规模,较小编码器会导致下降。 Performance on text-heavy tasks like TextVQA relies on visual encoder scale, with smaller encoders causing degradation.
模型需要大规模预训练数据(15 亿图文对),可能不适用于所有领域。 The model requires large-scale pretraining data (1.5B image-text pairs), which may not be available for all domains.
消融实验仅进行 6000 次迭代,可能无法反映完全收敛的行为。 Ablation studies are limited to 6,000 iterations, which may not reflect full convergence behavior.