What an AI 'pays attention to' and the tricks it uses under the hood aren't always the same story.
How do attention patterns and circuits map to underlying neural implementations?
This explores how the things researchers can observe and name in a transformer — where attention goes, and the small 'circuits' that seem to carry out a task — relate to what the weights and activations underneath are actually doing.
This explores whether the patterns we can see in a model (which tokens attention lands on, which small groups of components handle a task) correspond cleanly to the machinery underneath. The corpus's short answer: sometimes remarkably cleanly, but the mapping is often indirect, and attention maps in particular can be shaped by things that have nothing to do with meaning.
The strongest evidence that a clean mapping exists comes from work that replaces parts of the network with something a human can read. Program synthesis can recover executable code matching 99% of an attention head's behavior, and swapping the best-fit 30–40% of heads for their programs leaves question-answering ability intact Can executable programs replace transformer attention heads?. That is a much firmer claim than a natural-language description of what a head 'seems to do': the program either reproduces the behavior or it doesn't. It also tells you the limit — the majority of heads were not replaced, so most of the network still resists this kind of tidy description. Pruning experiments point the same way from another angle: networks split compositional tasks into separate subnetworks, where knocking one out damages only its own function, and pretraining makes that modular structure more consistent Do neural networks naturally learn modular compositional structure?.
The complication is that what you see in an attention pattern is not always the model 'deciding' what matters. A tiny number of activations, up to 100,000 times larger than the rest and the same regardless of input, act as hidden bias terms that pull attention onto specific tokens Do hidden massive activations act as attention bias terms?. So some of an attention map is plumbing rather than reasoning. Soft attention also has a built-in tilt toward repeated and prominent content whether or not it is relevant, which shows up at the behavioral level as a contribution to sycophancy Does transformer attention architecture inherently favor repeated content?. That is a rare case where a low-level mechanical property can be traced all the way up to a behavior people complain about.
A different response to the mapping problem is to stop reverse-engineering and build the network so the mapping is easy. Training transformers with sparse weights produces compact circuits where individual neurons correspond to simple concepts with clear connections, and ablations confirm those circuits are both necessary and sufficient for the task Can sparse weight training make neural networks interpretable by design?. The catch is scale: this has not been shown to hold beyond tens of millions of parameters. Related work suggests why ordinary models are harder to read — how densely a model represents something depends on how familiar the input is, with dense activations for well-trodden training data and sparse ones for unfamiliar inputs Is representational sparsity learned or intrinsic to neural networks?. The same circuit-hunting method may therefore find cleaner structure in some regions of a model's knowledge than others.
One gap worth naming: the corpus is strong on these individual findings but thin on the general theory connecting them — features, superposition, and how circuits are traced end-to-end in large production models are not well covered in what was retrieved here. What it does leave you with is a useful caution: an attention pattern is a readout of several overlapping forces (learned function, hidden bias terms, a pull toward repetition), and the most trustworthy mappings so far are the ones tested by replacement or ablation rather than by looking.
Sources 6 notes
Program synthesis recovers executable code matching 99% of attention head behavior. Substituting the best-fit 30–40% of heads with their synthesized programs preserves QA ability, offering formal, testable interpretability instead of natural-language summaries.
Pruning experiments reveal that neural networks implement compositional subroutines in isolated subnetworks, with ablations affecting only their corresponding function. Pretraining substantially increases the consistency and reliability of this modular structure across architectures and domains.
A very small number of input-agnostic activations with values up to 100,000× larger than others act as indispensable implicit bias terms and concentrate attention probability onto specific tokens. This phenomenon appears across model sizes and Vision Transformers.
Transformer soft attention systematically over-weights repeated and context-prominent tokens regardless of relevance, creating a positive feedback loop that amplifies opinions and framing before RLHF acts. System 2 Attention—regenerating context to remove irrelevant material—can interrupt this mechanism.
Training transformers with sparse weights creates compact, human-interpretable circuits where neurons correspond to simple concepts with clear connections. Ablation studies confirm these circuits are necessary and sufficient for task performance, though scaling beyond tens of millions of parameters while maintaining interpretability remains unsolved.
Show all 6 sources
During pretraining, neural networks develop dense activations for familiar training data and default to sparse representations for unfamiliar inputs. This trend emerges without task-specific fine-tuning and reflects how models consolidate knowledge through exposure.
Papers this line draws on 8
The research behind the notes this line reads — ranked by how closely each paper relates.
- Farther the Shift, Sparser the Representation: Analyzing OOD Mechanisms in LLMs
- Questioning Representational Optimism in Deep Learning: The Fractured Entangled Representation Hypothesis
- Requential Coding: Pushing the Limits of Model Compression with Self-Generated Training Data
- Towards Monosemanticity: Decomposing Language Models With Dictionary Learning
- Hierarchical Reasoning Model
- Open Problems in Mechanistic Interpretability
- System 2 Attention (is something you might need too)
- Towards Principled Evaluations of Sparse Autoencoders for Interpretability and Control