A Circuit for In-Context Learning
Ranking
Overall
78
Content
95
Popularity
37
Observed public metrics from 1 member.
Merged summary
TL;DR - This paper identifies a causal transformer circuit for in-context classification with arbitrary labels. It shows that models implement gated associative lookup, storing class-label mappings from demonstrations and retrieving the matching label for a query.
- Middle-layer attention heads write demonstration classes into label-token representations, forming key-value memory.
- Upper-layer heads match the query class to stored keys and copy the corresponding label.
- Early-layer repetition signals gate retrieval, while separate heads suppress the most recently seen label.
- Activation patching, ablations, and steering reveal similar circuitry across model sizes, architectures, and instruction-tuned variants.
Sources (1)
A Circuit for In-Context Learning
Public signals
Semantic Scholar citations 0 · Semantic Scholar influential citations 0
TL;DR - This paper identifies a causal transformer circuit for in-context classification with arbitrary labels. It shows that models implement gated associative lookup, storing class-label mappings from demonstrations and retrieving the matching label for a query.
- Middle-layer attention heads write demonstration classes into label-token representations, forming key-value memory.
- Upper-layer heads match the query class to stored keys and copy the corresponding label.
- Early-layer repetition signals gate retrieval, while separate heads suppress the most recently seen label.
- Activation patching, ablations, and steering reveal similar circuitry across model sizes, architectures, and instruction-tuned variants.