すべての人に一次情報を
少数ショットで任意ラベルを使う文章分類タスクを、プロンプト内にメモリを構築するゲート付き連想検索回路が解決します。回路は4つの要素から成り、書き手が説明文のクラスをラベルトークンに残し、読者がクエリのクラスに一致するラベルを探してラベルをコピーします。閉じた状態の「ゲート」は、ラベルが重複している場合にのみ読者を起動し、最後に現れたラベルを抑制する「ブレーキ」によって余剰な最新事例へのバイアスを防ぎます。
| Term | Meaning |
|---|---|
| slot | the residual stream at a label token, which holds a key and a value |
| key | the class of the sentence the label followed; written into the slot by writer heads, read through the readers’ WK |
| value | the identity of the label; read through the readers’ WV |
| writer heads | about twenty middle-layer heads that copy a sentence’s class into its label token |
| reader heads | about ninety upper-layer heads that attend from the query arrow to slots whose key matches the query’s class, and copy their values |
| query code | the representation of the query’s class that the readers match against the keys |
|---|
| gate g | a direction at the query arrow that signals that some label has repeated, and opens the read |
|---|
| null action | the readers putting their attention on the sink at position zero and copying nothing |
|---|
| brake heads | about two dozen heads that write against the most recently seen label |
|---|
| copier heads | heads in the last six layers that turn what the readers collect into logits |
|---|
| margin | log-probability of the correct label minus that of the other label, in nats |
|---|
| twin | a prompt identical to another except inside one span |
|---|
| knockout | mean-ablation of a head’s output |
|---|
| handoff | patching an activation from a twin into the intact run |
|---|
| steering | adding a direction to the residual stream at the dose the model itself uses |
|---|
| hold | fixing a downstream component at its intact value while a handoff runs |
|---|
実験は、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のマージン増加が観測され、ブレーキが重要な役割を果たすことが明らかです。

しかし、プロンプト長が長くなるとソフトマックスの読み取り規則が崩れ、18個のデモで失敗します。これは、ゲート信号がラベルの重複を検知して読者を開く機能に依存していることを示唆しています。小型モデルではゲートが学習されず、nullアクションが増加し精度が低下します。
本研究は、事前学習済み言語モデルがパラメータ更新なしで任意ラベルの少数ショット分類を実行する際に、キーとバリューのメモリを用いたクラスター化された注意機構が内部で機能していることを明らかにしました。