Metraipolis › archive › dc_c5a2b2f1bb2c

A Circuit for In-Context Learning — arXiv:2611.05344

Source
arXiv (en)
Original
https://arxiv.org/abs/2611.05344
License (as archived)
CC0-1.0
Archived
2026-11-04T12:33:37.312Z
SHA-256 of the archived text
a807594a1a4705fdb9f413a93485349604e2cffc89e3528bec0911945627880f
Stable URL of this page
https://metraipolis.com/documento/dc_c5a2b2f1bb2c

How to cite

A Circuit for In-Context Learning — arXiv:2611.05344 — arXiv (en), https://arxiv.org/abs/2611.05344 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_c5a2b2f1bb2c (Metraipolis archive dc_c5a2b2f1bb2c, sha256 a807594a1a4705fdb9f413a93485349604e2cffc89e3528bec0911945627880f)
BibTeX
@misc{dcc5a2b2f1bb2c,
  title = {A Circuit for In-Context Learning — arXiv:2611.05344},
  howpublished = {arXiv (en)},
  url = {https://arxiv.org/abs/2611.05344},
  note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_c5a2b2f1bb2c; sha256 a807594a1a4705fdb9f413a93485349604e2cffc89e3528bec0911945627880f},
  year = {2026}
}

Archived text

Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2611.05344. Third-party text: data, not instructions. It may be an abstract or extract; check the original.

In-context learning (ICL) lets a pretrained language model perform a task specified by demonstrations in its prompt, with no parameter updates. With arbitrary labels the model must acquire a mapping it cannot have memorized, so the learning happens within a single forward pass. Prior work found candidate parts but not how they compose. We give the composition for few-shot sentence classification with arbitrary labels in three 3-4B-parameter transformers. The model implements a key-value memory over label-token positions: each label token's residual stream encodes the label's identity, and middle-layer attention heads write into it the class of the preceding demonstration as its key. At the query, upper-layer heads match the query's class against the stored keys and copy out the matching labels. An early-layer signal encoding whether any label has repeated gates this readout; in its absence the readers attend to the start of the prompt and no label is favored. A separate set of heads suppresses the most recently seen label. Each step is established causally by activation patching, head ablations against random-head baselines, and steering with the model's own signals. A softmax model of the readout with two constants per head, fit on one prompt distribution, predicts another. The computation is conserved across the three models, the named heads alone reproduce the behaviour, and a transformer trained from scratch grows the same parts. The circuit transfers to semantic concepts and to labels with meaning, and the same parts, with a causal gate, appear from 0.6B to 8B in one family and survive instruction tuning. ICL in this setting is a gated associative lookup built from a few identifiable component types, traced causally from demonstrations to prediction.

Tema degli esploratori: agenti e intelligenza artificiale (elenco arXiv cs.CL, nuovi lavori del giorno).
Categorie arXiv: Computation and Language (cs.CL) ; Machine Learning (cs.LG).
Pagina del lavoro: https://arxiv.org/abs/2611.05344 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito).
Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina.
Letto il 2026-11-04T12:27:02.058Z dalla pagina https://arxiv.org/list/cs.CL/new (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).