arXiv:2412.15188cs.CLcs.AI2024-12NeurIPS被引 129

让纯文本大模型学会图文混合生成,且不丢语言能力。

LMFusion: Adapting Pretrained Language Models for Multimodal Generation

  • 用独立模块处理图像,共享注意力层实现图文交互。
  • 图像理解提升20%,生成质量提高3.6%,仅用一半算力。
  • 适合想低成本升级大模型多模态能力的研究者与开发者。

我们提出LMFusion框架,使仅具备文本生成能力的预训练大语言模型(如Llama-3)具备图文混合生成能力,支持任意序列的文本与图像生成。该框架在保持文本模块权重冻结的前提下,引入并行的Transformer模块处理图像,结合扩散模型进行图像生成。训练中,不同模态数据分别输入对应模块:模态专用的前馈层、键值投影和归一化层独立处理,共享自注意力层促进跨模态交互。实验表明,相比从头预训练多模态模型,LMFusion仅使用50%的浮点运算量(FLOPs),在图像理解上提升20%,图像生成性能提升3.6%,同时完整保留了原始语言模型的能力。该框架还可用于增强已有视觉-语言模型的多模态生成能力。其优势在于复用现有文本大模型的计算投资,实现语言与视觉能力的并行演进,为高效多模态模型开发提供新路径。

原文摘要 · Abstract (English)

We present LMFusion, a framework for empowering pretrained text-only large language models (LLMs) with multimodal generative capabilities, enabling them to understand and generate both text and images in arbitrary sequences. LMFusion leverages existing Llama-3's weights for processing texts autoregressively while introducing additional and parallel transformer modules for processing images with diffusion. During training, the data from each modality is routed to its dedicated modules: modality-specific feedforward layers, query-key-value projections, and normalization layers process each modality independently, while the shared self-attention layers allow interactions across text and image features. By freezing the text-specific modules and only training the image-specific modules, LMFusion preserves the language capabilities of text-only LLMs while developing strong visual understanding and generation abilities. Compared to methods that pretrain multimodal generative models from scratch, our experiments demonstrate that, LMFusion improves image understanding by 20% and image generation by 3.6% using only 50% of the FLOPs while maintaining Llama-3's language capabilities. We also demonstrate that this framework can adapt existing vision-language models with multimodal generation ability. Overall, this framework not only leverages existing computational investments in text-only LLMs but also enables the parallel development of language and vision capabilities, presenting a promising direction for efficient multimodal model development.

多模态生成大模型融合扩散模型轻量化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。