arXiv News

すべての人に一次情報を

サイト

Aboutプライバシーポリシー利用規約

© 2026 arXiv News

少数ショットの文章分類で見つかった「ゲート付き連想検索回路」 | arXiv News

arXiv News

英語日本語

言語を切り替え

英語日本語
アカウントを読み込み中…

すべての人に一次情報を

トップページに戻る
自然言語処理日本語公開済み

少数ショットの文章分類で見つかった「ゲート付き連想検索回路」

2026年11月5日arXiv: 2611.05344v1

少数ショットで任意ラベルを使う文章分類タスクを、プロンプト内にメモリを構築するゲート付き連想検索回路が解決します。回路は4つの要素から成り、書き手が説明文のクラスをラベルトークンに残し、読者がクエリのクラスに一致するラベルを探してラベルをコピーします。閉じた状態の「ゲート」は、ラベルが重複している場合にのみ読者を起動し、最後に現れたラベルを抑制する「ブレーキ」によって余剰な最新事例へのバイアスを防ぎます。

写実的表形式で、4つの機能ブロックとそれぞれの役割、数値を示したテーブル
TermMeaning
slotthe residual stream at a label token, which holds a key and a value
keythe class of the sentence the label followed; written into the slot by writer heads, read through the readers’ WK
valuethe identity of the label; read through the readers’ WV
writer headsabout twenty middle-layer heads that copy a sentence’s class into its label token
reader headsabout ninety upper-layer heads that attend from the query arrow to slots whose key matches the query’s class, and copy their values
query codethe representation of the query’s class that the readers match against the keys
gate ga direction at the query arrow that signals that some label has repeated, and opens the read
null actionthe readers putting their attention on the sink at position zero and copying nothing
brake headsabout two dozen heads that write against the most recently seen label
copier headsheads in the last six layers that turn what the readers collect into logits
marginlog-probability of the correct label minus that of the other label, in nats
twina prompt identical to another except inside one span
knockoutmean-ablation of a head’s output
handoffpatching an activation from a twin into the intact run
steeringadding a direction to the residual stream at the dose the model itself uses
holdfixing a downstream component at its intact value while a handoff runs
Table 1. 4つの機能ブロック(Writer、Reader、Gate、Brake)の構成を示す表。Gao, Andrew, Gao, William · arXiv:2611.05344v1 · Table 1: · CC BY 4.0

実験は、Qwen3‑4B‑Base(36層, 32ヘッド)、SmolLM3‑3B(36層, 16ヘッド)、Llama‑3.2‑3B(28層, 24ヘッド)の3種の3–4Bパラメータトランスフォーマーで行われました。4つの機能ブロックは共通で、書き手は約20個の中間層ヘッド、読者は約90個の上層ヘッド、ブレーキは約24個のヘッドで構成されています。この構成が確立されたことは、ヘッド単体の除去がマージンにわずか数分の nat しか影響しない一方、90ヘッド全体を除去すると0.74 nat だけに大きく減少することで裏付けられます。対照的にブレーキヘッドを除去するとマージンが1.39 nat(±0.22)上昇し、レトリアリズムバイアスを抑えていることが示されます。

FIGURE 13(コード参照)では、個々の読者ヘッドを除去した場合、マージンに与える影響がほぼゼロであることが示されます。ブレーキヘッドをまとめて除去すると、Qwenでは1.39 nat、Llamaでは1.90 natのマージン増加が観測され、ブレーキが重要な役割を果たすことが明らかです。

ヒートマップ風に、Readerヘッドの除去効果とBrakeヘッドの除去効果を示す図
Figure 13. 個々のReaderヘッドおよびBrakeヘッドを除去した場合のマージン変化。Gao, Andrew, Gao, William · arXiv:2611.05344v1 · Figure 13: · CC BY 4.0

しかし、プロンプト長が長くなるとソフトマックスの読み取り規則が崩れ、18個のデモで失敗します。これは、ゲート信号がラベルの重複を検知して読者を開く機能に依存していることを示唆しています。小型モデルではゲートが学習されず、nullアクションが増加し精度が低下します。

本研究は、事前学習済み言語モデルがパラメータ更新なしで任意ラベルの少数ショット分類を実行する際に、キーとバリューのメモリを用いたクラスター化された注意機構が内部で機能していることを明らかにしました。

元論文

A Circuit for In-Context Learning

自然言語処理機械学習
arXiv で見る