LLaMA-Adapter: Efficient Fine-tuning of Language Models with Zero-init Attention
Authors: Renrui Zhang, Jiaming Han, Chris Liu, Peng Gao, Aojun Zhou, Xiangfei Hu, Shilin Yan, Pan Lu, Hongsheng Li, Yu Qiao
AI-generated Key Points
⚠The license of the paper does not allow us to build upon its content and the key points are generated using the paper metadata rather than the full article.
- LLaMA-Adapter is a lightweight adaptation method for fine-tuning the LLaMA language model into an instruction-following model.
- It leverages 52K self-instruct demonstrations and introduces only 1.2M learnable parameters on top of the frozen LLaMA 7B model.
- The fine-tuning process can be completed in less than an hour using 8 A100 GPUs.
- Learnable adaption prompts are incorporated at higher transformer layers to provide instructional cues.
- A zero-initialized attention mechanism with zero gating is used to inject new instructional cues while preserving pre-trained knowledge.
- LLaMA-Adapter generates high-quality responses comparable to Alpaca with fully fine-tuned 7B parameters.
- It can be extended to multi-modal instructions for learning image-conditioned LLaMA models, improving reasoning performance on benchmarks like ScienceQA and COCO Caption.
- The zero-initialized attention mechanism used in LLaMA Adapter is evaluated for fine-tuning other pre-trained models like ViT and RoBERTa on traditional vision and language tasks.
- The code for LLaMA Adapter is publicly available at https://github.com/OpenGVLab/LLaMA-Adapter.
Abstract: We present LLaMA-Adapter, a lightweight adaption method to efficiently fine-tune LLaMA into an instruction-following model. 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 on 8 A100 GPUs. Specifically, we adopt a set of learnable adaption prompts, and prepend them to the word tokens at higher transformer layers. Then, a zero-initialized attention mechanism with zero gating is proposed, which adaptively injects the new instructional cues into LLaMA, while effectively preserves its pre-trained knowledge. With our efficient training, LLaMA-Adapter can generate high-quality responses, comparable to Alpaca with fully fine-tuned 7B parameters. Besides language commands, our approach can be simply extended to multi-modal instructions for learning image-conditioned LLaMA model, which achieves superior reasoning performance on ScienceQA and COCO Caption benchmarks. Furthermore, we also evaluate the zero-initialized attention mechanism for fine-tuning other pre-trained models (ViT, RoBERTa) on traditional vision and language tasks, demonstrating the superior generalization capacity of our approach. Code is released at https://github.com/OpenGVLab/LLaMA-Adapter.
Ask questions about this paper to our AI assistant
You can also chat with multiple papers at once here.
⚠The license of the paper does not allow us to build upon its content and the AI assistant only knows about the paper metadata rather than the full article.
The previous summary was created more than a year ago and can be re-run (if necessary) by clicking on the Run button below.
⚠The license of this specific paper does not allow us to build upon its content and the summarizing tools will be run using the paper metadata rather than the full article. However, it still does a good job, and you can also try our tools on papers with more open licenses.
Similar papers summarized with our AI tools
Navigate through even more similar papers through a
tree representationLook for similar papers (in beta version)
By clicking on the button above, our algorithm compares the title and abstract of this paper with all the papers of the same arXiv category that we have summarized, and finds the closest ones. You can rerun it from time to time: the results improve as our database grows.
Disclaimer: The AI-based summarization tool and virtual assistant provided on this website may not always provide accurate and complete summaries or responses. We encourage you to carefully review and evaluate the generated content to ensure its quality and relevance to your needs.