How to efficiently transform large language models (LLMs) into instruction followers is recently a popular research direction, while training LLM for multi-modal reasoning remains less explored. Although the recent LLaMA-Adapter demonstrates the potential to handle visual inputs with LLMs, it still cannot generalize well to open-ended visual instructions and lags behind GPT-4. In this paper, we present LLaMA-Adapter V2, a parameter-efficient visual instruction model. Specifically, we first augment LLaMA-Adapter by unlocking more learnable parameters (e.g., norm, bias and scale), which distribute the instruction-following ability across the entire LLaMA model besides adapters. Secondly, we propose an early fusion strategy to feed visual tokens only into the early LLM layers, contributing to better visual knowledge incorporation. Thirdly, a joint training paradigm of image-text pairs and instruction-following data is introduced by optimizing disjoint groups of learnable parameters. This strategy effectively alleviates the interference between the two tasks of image-text alignment and instruction following and achieves strong multi-modal reasoning with only a small-scale image-text and instruction dataset. During inference, we incorporate additional expert models (e.g. captioning/OCR systems) into LLaMA-Adapter to further enhance its image understanding capability without incurring training costs. Compared to the original LLaMA-Adapter, our LLaMA-Adapter V2 can perform open-ended multi-modal instructions by merely introducing 14M parameters over LLaMA. The newly designed framework also exhibits stronger language-only instruction-following capabilities and even excels in chat interactions. Our code and models are available at https://github.com/ZrrSkywalker/LLaMA-Adapter.
翻译:如何高效地将大型语言模型(LLMs)转化为指令遵循模型是近期热门研究方向,但针对多模态推理的LLM训练仍鲜有探索。尽管近期LLaMA-Adapter展示了LLM处理视觉输入的潜力,但它仍难以泛化到开放式视觉指令,且落后于GPT-4。本文提出LLaMA-Adapter V2,一种参数高效的视觉指令模型。具体而言,我们首先通过解锁更多可学习参数(如归一化层、偏置和缩放因子)增强LLaMA-Adapter,使指令遵循能力分布在除适配器外的整个LLaMA模型中。其次,我们提出早期融合策略,仅将视觉标记输入LLM的早期层,以促进视觉知识的更好融入。第三,引入图像-文本对与指令遵循数据的联合训练范式,通过优化不相交的可学习参数组实现。该策略有效缓解了图像-文本对齐与指令遵循两项任务间的干扰,并仅利用小规模图像-文本和指令数据集实现强大多模态推理。推理阶段,我们将额外专家模型(如字幕生成/OCR系统)集成至LLaMA-Adapter,在不增加训练成本的情况下进一步提升图像理解能力。相比原始LLaMA-Adapter,我们的LLaMA-Adapter V2仅需在LLaMA基础上引入1400万参数即可执行开放式多模态指令。新设计的框架还展现出更强的纯语言指令遵循能力,甚至在聊天交互中表现优异。我们的代码与模型已开源至https://github.com/ZrrSkywalker/LLaMA-Adapter。