arXiv論文メモ
新着一覧
cs.CL · 査読状況未確認

必要なときだけ履歴全体を読む言語モデルの注意機構

On-Demand Attention: Language Models Know When to Recall

Haibo Feng, Ruiqi Liang, Hanyang Peng, Shiqi Yu

この論文をやさしく読む

ひとことで言うと

言語モデルが過去の全履歴を毎回読む代わりに、必要と予測したときだけ読み返す方法です。

何に役立つ?

考えられる用途は、長い会話や推論を扱う際のデコード計算の削減です。

この研究の面白いところ

元モデルを変えずに小さな呼び戻し判定部だけ学習し、全履歴のKVキャッシュは後で使えるよう残します。

どこまで分かった?

複数のQwen・Gemmaで性能と速度を評価していますが、具体的な速度倍率は要旨にありません。全履歴を削除してメモリを減らす手法とは区別が必要です。

v1のアブストラクトに基づくAI解説。日本語訳とは別に、用途の解釈を含みます。

アブストラクトの日本語訳

推論やエージェント処理では、長い文脈を効率よく扱う推論の必要性が高まっている。しかし、全体注意を用いるデコードは、次の予測への有用性にかかわらず、各ステップで増え続ける履歴を読み出す。本研究では、事前学習済みモデルのデコード状態には、履歴全体を読む前の時点で、その有用性を予測する情報が既に含まれていることを示す。 この知見に基づき、On-Demand Attention(ODA)を導入する。これは局所的な注意を優先するデコード手法であり、軽量な想起ヘッドを用い、生成中に変化する予測上の有用性に応じて、全体注意を選択的に呼び出す。ODAでは想起ヘッドだけを学習し、事前学習済みの重みは変更せず、履歴全体のKVキャッシュを将来の想起に利用できる状態で保持する。 さらに、vLLMにGPU側の条件付き実行を実装し、履歴全体の読み出し回数の削減を、長い文脈における全体注意に対する実際のデコード高速化につなげる。ハイブリッド注意構造を含むQwenおよびGemmaモデルでの実験から、選択的な想起により、局所注意で失われる性能の大部分を回復しつつ、全体読み出しを大幅に減らせることが分かった。これらの知見は、事前学習済みモデルが、保持している情報へのアクセスを自ら制御する長文脈推論を支持する。

v1の要旨から自動生成。本文の精読・人による確認は未実施。

初稿
2026-09-17(UTC)
最新改訂
2026-09-17 · v1
査読・掲載
査読状況未確認
arXivで読むPDF

更新履歴

取得できた版を表示。版の更新は査読済みを意味しません。過去版の本文差分は未解析です。

原文の要旨

Reasoning and agentic workloads increasingly demand efficient long-context inference. Yet full-attention decoding reads the growing history at every step, regardless of its benefit to the next prediction. We show that a pretrained model's decoding states already contain information predictive of this benefit, before the global read. Building on this finding, we introduce On-Demand Attention (ODA), a local-first decoding method that uses a lightweight recall head to selectively invoke global attention as its predicted benefit changes during generation. ODA trains only the recall head, leaving pretrained weights unchanged and the complete historical KV cache available for future recall. We further implement GPU-side conditional execution in vLLM, translating reduced global reads into practical decoding speedups over full attention at long context lengths. Experiments across Qwen and Gemma models, including hybrid-attention backbones, show that selective recall recovers most of the performance lost under local attention while substantially reducing global reads. These findings support long-context inference in which pretrained models guide their own access to the information they retain.

著者のコメント

28 pages, 5 figures

arXiv ID: 2609.20734 / 要約の誤りについて