HackerPapers

arXiv:2303.16199cs.CV

LLaMA-Adapter: Efficient Fine-tuning of Language Models with Zero-init Attention

Renrui Zhang, Jiaming Han, Chris Liu, Peng Gao, Aojun Zhou, Xiangfei Hu, Shilin Yan, Pan Lu, Hongsheng Li, Yu Qiao

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.

arXiv comments
Accepted by ICLR 2024. Code is available at https://github.com/OpenGVLab/LLaMA-Adapter
Journal reference
DOI
Subjects
cs.CVComputer Vision and Pattern Recognition cs.AIArtificial Intelligence cs.CLComputation and Language cs.LGMachine Learning cs.MMMultimedia

On Hacker News

Linked by 2 identifiable commenters in 2 comments across 2 threads, from Apr 2023 to Jun 2023.

Comments linking this paper, per year.

Discussed in comments2 threads

    • > Running a remote cloud LLM costs about nothing in dollars to the user. The user doesn't care where it runs, because the user interacts with my product, not my backend. He also doesn't pay my cloud provider, he pays me. I think we don't need to argue the fact that an on premise…

      usrbinbashView on HNParent context

    • Yes, those adapters. There are many types now, most recently LLaMA adapter: https://arxiv.org/abs/2303.16199

      bitLView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.