Skip to main content
QUICK REVIEW

[論文レビュー] Attention Sorting Combats Recency Bias In Long Context Language Models

Alexander Peysakhovich, Adam Lerer|arXiv (Cornell University)|Sep 28, 2023
Topic Modeling被引用数 4
ひとこと要約

本稿では、注意重みに基づいて文書を再配置することで、最近性バイアスを軽減し、長文脈言語モデルの性能を向上させる、軽量な推論時技術「アテンションソーティング」を提案する。繰り返し文書を、関連性の高いものが文脈の末端に近づくようにソートすることで、抽出的QAの性能が向上する。特にオープンソースモデルにおいて顕著で、30k文脈長での精度を2倍にし、Claude-2などのプロプライエタリモデルに並ぶ性能を達成する。

ABSTRACT

Current language models often fail to incorporate long contexts efficiently during generation. We show that a major contributor to this issue are attention priors that are likely learned during pre-training: relevant information located earlier in context is attended to less on average. Yet even when models fail to use the information from a relevant document in their response, they still pay preferential attention to that document compared to an irrelevant document at the same position. We leverage this fact to introduce ``attention sorting'': perform one step of decoding, sort documents by the attention they receive (highest attention going last), repeat the process, generate the answer with the newly sorted context. We find that attention sorting improves performance of long context models. Our findings highlight some challenges in using off-the-shelf language models for retrieval augmented generation.

研究の動機と目的

  • 長文脈言語モデルが、関連性の高い情報を文脈の初期に配置しても、それを活用しない理由を解明すること。
  • 関連ドキュメントが応答から離れている場合に、リtrieval-Augmented Generation (RAG) の性能が低下する理由を解消すること。
  • 再トレーニングやアーキテクチャ変更なしに、実用的で推論時のみで性能を向上させる手法を開発すること。
  • 注意重みが、長文脈タスクにおける文書再配置の信頼できるシグナルとして機能するかどうかを評価すること。

提案手法

  • 手法は1ステップのデコードを実行し、全層・全ヘッドにおける各文書の平均注意重みを計算する。
  • 文書は注意スコアの降順にソートされ、最も注意が集まった文書が文脈の末端に移動する。
  • 繰り返し処理を実施(通常2回)し、最終的な生成前に再ソートされた文脈を用いる。
  • 本手法は、1つの関連ドキュメントと複数の干渉ドキュメントを含む、制御された合成QAベンチマーク(SynthWiki)に適用される。
  • モデルが初期情報を利用できなくても、関連ドキュメントは同位置の干渉ドキュメントよりも注意を多く受けるという事実を活用する。
  • オープンソースおよびプロプライエタリな長文脈モデルを対象に評価し、パス数とモデルバリアントのアブレーションを実施。
Figure 1: Performance of all long-context models that we study on question answering degrades when the relevant information is embedded in a long context of irrelevant distractor text.
Figure 1: Performance of all long-context models that we study on question answering degrades when the relevant information is embedded in a long context of irrelevant distractor text.

実験結果

リサーチクエスチョン

  • RQ1モデルが初期情報を生成に活用できなくても、注意重みの分布がドキュメントの関連性を反映しているか?
  • RQ2注意スコアに基づく文脈の反復的再配置が、長文脈QA性能を向上させるか?
  • RQ3RAGタスクにおいて、干渉ドキュメント数が増えると、なぜオープンソースモデルの性能劣化がプロプライエタリモデルよりも顕著になるのか?
  • RQ4事前学習時に最近性インダクティブバイアスを持つモデルにおいて、アテンションソーティングが最近性バイアスをどれほど軽減できるか?
  • RQ5ファインチューニングやアーキテクチャ変更なしに、注意に基づく再配置がベースラインモデルを上回る性能を発揮できるか?

主な発見

  • アテンションソーティングは長文脈モデルにおけるQA精度を顕著に向上させ、特にオープンソースモデルでは30k文脈長で100%以上の性能向上を達成する。
  • 2回のパスを経て、アテンションソーティングは関連ドキュメントを、注意重みが最も効果的な「利用可能領域」に移動させる。
  • TogetherLlama-7B-32k(長文脈QAでファインチューニング済み)は最高の性能を示し、Claude-2 や GPT-3.5 などのプロプライエタリモデルと同等またはそれを上回る。
  • 本手法は、WizardCoder や YaRN といった全オープンソースモデルで性能向上を示し、特に繰り返しパスを複数回行うことで顕著になる。
  • 最近性バイアスが強いモデル(例:Llama-2 base)は干渉ドキュメントの増加により著しく性能が低下するが、アテンションソーティングはこれを効果的に是正する。
  • モデルのインダクティブバイアスと本手法が相乗効果を発揮するため、長文脈QAでファインチューニングされたモデルで最も効果的である。
Figure 2: QA accuracy on SynthWiki as a function of the position of the relevant document in the context. We see a replication of the ‘lost in the middle’ [ 15 ] effect on this dataset in which accuracy is lower when the relevant information is in the middle of a long context. The recency (informati
Figure 2: QA accuracy on SynthWiki as a function of the position of the relevant document in the context. We see a replication of the ‘lost in the middle’ [ 15 ] effect on this dataset in which accuracy is lower when the relevant information is in the middle of a long context. The recency (informati

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

論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。

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

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