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

要約

LLaMA-Adapter は、LLaMA を命令に従うモデルに効率的に微調整するための軽量な適応方法です。
LLaMA-Adapter は、52K の自己指示デモを使用して、凍結された LLaMA 7B モデルに 120 万の学習可能なパラメーターのみを導入し、8 つの A100 GPU での微調整に 1 時間もかかりません。
具体的には、一連の学習可能な適応プロンプトを採用し、上位のトランスフォーマー レイヤーで入力テキスト トークンに追加します。
次に、ゲーティングがゼロのゼロ初期化アテンション メカニズムが提案されます。これは、事前に訓練された知識を効果的に保持しながら、新しい教育的手がかりを LLaMA に適応的に注入します。
効率的なトレーニングにより、LLaMA-Adapter は、完全に微調整された 7B パラメーターを備えた Alpaca に匹敵する高品質の応答を生成します。
さらに、私たちのアプローチは、ScienceQAで優れた推論能力を達成する画像調整LLaMAの画像などのマルチモーダル入力に簡単に拡張できます。
https://github.com/ZrrSkywalker/LLaMA-Adapter でコードをリリースしています。

要約(オリジナル)

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 input text tokens at higher transformer layers. Then, a zero-init attention mechanism with zero gating is proposed, which adaptively injects the new instructional cues into LLaMA, while effectively preserves its pre-trained knowledge. With efficient training, LLaMA-Adapter generates high-quality responses, comparable to Alpaca with fully fine-tuned 7B parameters. Furthermore, our approach can be simply extended to multi-modal input, e.g., images, for image-conditioned LLaMA, which achieves superior reasoning capacity on ScienceQA. We release our code at https://github.com/ZrrSkywalker/LLaMA-Adapter.

arxiv情報

著者 Renrui Zhang,Jiaming Han,Aojun Zhou,Xiangfei Hu,Shilin Yan,Pan Lu,Hongsheng Li,Peng Gao,Yu Qiao
発行日 2023-03-28 17:59:12+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.CL, cs.CV, cs.LG, cs.MM パーマリンク