モデルに注意を向ける場所を指示する:LLMの事後的な注意誘導
Tell Your Model Where to Attend: Post-hoc Attention Steering for LLMs
November 3, 2023
著者: Qingru Zhang, Chandan Singh, Liyuan Liu, Xiaodong Liu, Bin Yu, Jianfeng Gao, Tuo Zhao
cs.AI
要旨
人間が書いた記事では、テキストスタイルの微妙なニュアンス、例えば太字や斜体などを活用して、読者の注意を誘導することがよくあります。これらのテキスト強調は、読者が伝えられた情報を理解する上で極めて重要です。大規模言語モデル(LLM)と対話する際にも、同様の必要性が生じます。つまり、ユーザーが指定した情報(例えば指示)にモデルがより注意を払うように導く必要があるのです。しかし、既存の手法はプレーンテキストを処理することに制限されており、そのようなメカニズムをサポートしていません。この課題を解決するため、我々はPASTA(Post-hoc Attention STeering Approach)を提案します。PASTAは、ユーザーが指定した強調マーク付きのテキストをLLMが読むことを可能にする手法です。具体的には、PASTAは少数のアテンションヘッドを特定し、それらに精密なアテンションの再重み付けを適用することで、モデルの注意をユーザー指定の部分に向けます。プロンプティングと同様に、PASTAは推論時に適用され、モデルのパラメータを変更する必要はありません。実験結果は、PASTAがLLMのユーザー指示に従う能力や、ユーザー入力から新しい知識を統合する能力を大幅に向上させ、様々なタスクで性能が大幅に改善されることを示しています。例えば、LLAMA-7Bでは平均精度が22%向上しました。我々のコードはhttps://github.com/QingruZhang/PASTAで公開されています。
English
In human-written articles, we often leverage the subtleties of text style,
such as bold and italics, to guide the attention of readers. These textual
emphases are vital for the readers to grasp the conveyed information. When
interacting with large language models (LLMs), we have a similar need -
steering the model to pay closer attention to user-specified information, e.g.,
an instruction. Existing methods, however, are constrained to process plain
text and do not support such a mechanism. This motivates us to introduce PASTA
- Post-hoc Attention STeering Approach, a method that allows LLMs to read text
with user-specified emphasis marks. To this end, PASTA identifies a small
subset of attention heads and applies precise attention reweighting on them,
directing the model attention to user-specified parts. Like prompting, PASTA is
applied at inference time and does not require changing any model parameters.
Experiments demonstrate that PASTA can substantially enhance an LLM's ability
to follow user instructions or integrate new knowledge from user inputs,
leading to a significant performance improvement on a variety of tasks, e.g.,
an average accuracy improvement of 22% for LLAMA-7B. Our code is publicly
available at https://github.com/QingruZhang/PASTA .