LLaMA-Adapter V2: Parameter-Efficient Visual Instruction Model

Peng Gao,Jiaming Han,Renrui Zhang,Ziyi Lin,Shijie Geng,Aojun Zhou,Wei Zhang,Pan Lu,Conghui He,Xiangyu Yue,Hongsheng Li,Yu Qiao
2023-04-29
Abstract: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 <a class="link-external link-https" href="https://github.com/ZrrSkywalker/LLaMA-Adapter" rel="external noopener nofollow">this https URL</a>.
Computer Vision and Pattern Recognition,Artificial Intelligence,Computation and Language,Machine Learning,Multimedia
What problem does this paper attempt to address?
The paper aims to address the issue of efficiently transforming large language models (LLMs) into instruction-following models, with a particular focus on enhancing capabilities in multimodal reasoning. Although the existing LLaMA-Adapter demonstrates some ability to handle visual inputs, it still struggles to generalize well to open-ended visual instruction tasks and has a certain gap compared to GPT-4. Therefore, the authors propose LLaMA-Adapter V2, a parameter-efficient visual instruction model. Specifically, the authors first enhance the capabilities of the LLaMA-Adapter by unlocking more learnable parameters (such as normalization, bias, and scaling), making it not limited to the adapter part but distributing the instruction-following capability throughout the entire LLaMA model. Secondly, they propose an early fusion strategy, inputting visual tokens only into the first few layers of the LLM, which helps better integrate visual knowledge. Additionally, a joint training paradigm is introduced to optimize unrelated parameter groups, effectively mitigating the interference between image-text alignment and instruction following. Finally, during the inference stage, additional expert models (such as image captioning systems) are integrated to enhance image understanding without increasing training costs. With these improvements, LLaMA-Adapter V2 can perform open-ended multimodal instructions with the introduction of a small number of parameters and demonstrates stronger language instruction-following capabilities and chat interaction performance.