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.
On Zero-Initialized Attention: Optimal Prompt and Gating Factor Estimation
University of Science, VNU-HCM, Ho Chi Minh City, Vietnam(越南胡志明市VNU-HCM大学);Viet Nam National University, Ho Chi Minh City, Vietnam(越南国家大学);German Research Center for Artificial Intelligence (DFKI)(德国人工智能研究中心);Qualcomm AI Research, an initiative of Qualcomm Technologies, Inc.(高通人工智能研究);The University of Texas at Austin(德克萨斯大学奥斯汀分校);University of Stuttgart(斯图加特大学);Max Planck Research School for Intelligent Systems (IMPRS-IS)(马克斯·普朗克智能系统研究学校);Oldenburg University(奥尔登堡大学)
Improving Learning of New Diseases through Knowledge-Enhanced Initialization for Federated Adapter Tuning
Institute of High Performance Computing (IHPC), Agency for Science, Technology and Research (A*STAR)(高性能计算研究所(IHPC),科技研究局(A*STAR));EVYD Technology(EVYD技术)
Dynamical Adapter Fusion: Constructing A Global Adapter for Pre-Trained Model-based Class-Incremental Learning
Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China(中国科学院计算技术研究所);University of Chinese Academy of Sciences, Beijing, China(中国科学院大学)
LLaMA-Reg: Using LLaMA 2 for Unsupervised Medical Image Registration
Faculty of Information Science Engineering and Automation, Kunming University of Science and Technology(昆明理工大学信息科学工程与自动化学院);Taizhou Hospital of Zhejiang Province Affiliated with Wenzhou Medical University(温州医科大学附属浙江省台州医院);Enze Hospital, Taizhou Enze Medical Centre (Group)(台州恩泽医疗中心(集团)恩泽医院);The Second Affiliated Hospital of Dalian Medical University(大连医科大学附属第二医院)
Sparsity Hurts: Simple Linear Adapter Can Boost Generalized Category Discovery
School of Computer Science and Engineering, Southeast University(东南大学计算机科学与工程学院);Key Laboratory of Computer Network and Information Integration (Southeast University), Ministry of Education, China(计算机网络与信息集成重点实验室(东南大学),教育部,中国)
LangBridge: Interpreting Image as a Combination of Language Embeddings
Shanghai AI Laboratory(上海人工智能实验室);The Chinese University of Hong Kong(香港中文大学);Tsinghua University(清华大学);SenseTime Research(商汤科技研究院);Shanghai Jiao Tong University(上海交通大学);Peking University(北京大学);PengCheng Laboratory(鹏城实验室);Chongqing University(重庆大学)