Skip to main content
QUICK REVIEW

[論文レビュー] LLaMA-Adapter: Efficient Fine-tuning of Language Models with Zero-init Attention

Renrui Zhang, Jiaming Han|arXiv (Cornell University)|Mar 28, 2023
Multimodal Machine Learning Applications被引用数 167
ひとこと要約

LLaMA-AdapterはLLaMAを凍結し、Attentionをゼロ初期化して1.2Mのアダプターを学習し、 Alpacaに匹敵する指示に従う性能を達成、8 A100 GPUで約1時間のファインチューニング、マルチモーダルタスクをサポート。

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.

研究の動機と目的

  • パラメータの全更新を行わずに、LLaMAを効率的に指示に従うモデルへファインチューニングすることを目指す。
  • 高位のトランスフォーマ層に挿入された小さな学習可能なアダプテーションプロンプトを活用する。
  • 事前学習済みの知識を保存するため、学習可能なゲーティングを伴うゼロ初期化のアテンションを使用して安定した訓練を保証する。
  • マルチモーダル指示や他のモデルファミリへの拡張性を示す。

提案手法

  • LLaMAの最上位のLトランスフォーマ層に学習可能なアダプテーションプロンプトを挿入する。
  • 各対象層の入力トークンの先頭にプロンプト [P_l] を [P_l; T_l] の形で付加する。
  • 標準のアテンションをゼロ初期化のアテンションと、適応の影響を制御するヘッドごとのゲーティング因子 g_l に置換する。
  • 適応プロンプトと語彙トークンのために別々のsoftmax経路を使用して学習を安定させる。
  • 視覚 conditioning のためにプロンプトに image token I_p を組み込み、マルチモーダル入力へアプローチを拡張する。
  • ViT (VTAB-1k) および RoBERTa (SQuAD) タスクへゼロ初期化の注意を適用して一般化を示す。

実験結果

リサーチクエスチョン

  • RQ1ゼロ初期化のアテンションを持つ軽量アダプターは、指示に従うタスクでフルモデルのファインチューニング性能に匹敵できるか?
  • RQ2小さなアダプターでベースモデルを凍結することは、訓練効率とリソース使用量にどのように影響するか?
  • RQ3この手法はテキストを超えたマルチモーダルおよび他のモダリティへ一般化するか?
  • RQ4ファインチューニング中の安定性と最終性能にとって、ゼロ初期化のアテンションは重要か?

主な発見

  • 1.2M の学習可能パラメータで、完全にファインチューニングされた7B Alpaca に近い指示遵守性能を達成できる。
  • 8 A100 GPU でのトレーニングコストは1時間未満である。
  • LLaMA-Adapter はマルチモーダル指示に対応し、ScienceQA および COCO Caption で競争力のある結果を達成する。
  • ゼロ初期化のアテンションは、ゲーティングを伴い、安定性と最終性能を大幅に向上させる(rand-init vs 大きな利得)。
  • このアプローチは ViT (VTAB-1k) および RoBERTa (SQuAD) タスクへ適用した場合にも強い一般化を示す。

より良い研究を、今すぐ始めましょう

論文設計から論文執筆まで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。