Llama-Adapter: Efficient Fine-Tuning of Large Language Models with Zero-Initialized Attention
Abstract
With the rising tide of large language models (LLMs), there has been a growing interest in developing general-purpose instruction-following models, e.g., ChatGPT. To this end, we present LLaMA-Adapter, a lightweight adaption method for efficient instruction tuning of LLaMA. Using 52K self-instruct demonstrations, LLaMA-Adapter only introduces 1.2M learnable parameters upon the frozen LLaMA 7B model, and costs less than one hour for fine-tuning. Specifically, a zero-initialized attention mechanism is proposed. It adopts a learnable zero gating to adaptively inject the instructional cues into LLaMA within self-attention layers, contributing to a stable training process and superior final performance. In this way, LLaMA-Adapter can generate high-quality responses to diverse language instructions, comparable to Alpaca with fully fine-tuned 7B parameters. Besides language commands, by incorporating an image encoder, our approach can be simply extended to a multi-modal LLM for image-conditioned instruction following, which achieves superior multi-modal reasoning capacity on several popular benchmarks (MME, MMBench, LVLM-eHub). Furthermore, we also verify the proposed zero-initialized attention mechanism for fine-tuning other pre-trained models (ViT, RoBERTa, CLIP) on traditional vision and language tasks, demonstrating the effectiveness and generalizability of our approach. Code and models are released at https://github.com/OpenGVLab/LLaMA-Adapter.
Cite
Text
Zhang et al. "Llama-Adapter: Efficient Fine-Tuning of Large Language Models with Zero-Initialized Attention." International Conference on Learning Representations, 2024.Markdown
[Zhang et al. "Llama-Adapter: Efficient Fine-Tuning of Large Language Models with Zero-Initialized Attention." International Conference on Learning Representations, 2024.](https://mlanthology.org/iclr/2024/zhang2024iclr-llamaadapter/)BibTeX
@inproceedings{zhang2024iclr-llamaadapter,
title = {{Llama-Adapter: Efficient Fine-Tuning of Large Language Models with Zero-Initialized Attention}},
author = {Zhang, Renrui and Han, Jiaming and Liu, Chris and Zhou, Aojun and Lu, Pan and Qiao, Yu and Li, Hongsheng and Gao, Peng},
booktitle = {International Conference on Learning Representations},
year = {2024},
url = {https://mlanthology.org/iclr/2024/zhang2024iclr-llamaadapter/}
}