Emergent skills trace back to sparse attention: patching 16 heads triggers a capability early

Emergent Capabilities Arise Randomly from Learning Sparse Attention Patterns

Vatsal Baherwani, Zixi Chen, Shikai Qiu, Andrew Gordon Wilson, Pavel Izmailov

cs.LG, cs.CL

2026-06-24

NYU: capabilities emerge randomly when attention heads abruptly learn sparse task patterns; patching 16 learned heads triggers the skill before it arises naturally.

What problem this solves

Neural scaling laws promise smooth loss curves as parameters grow, yet capabilities like in-context learning show up abruptly past a scale threshold, with no warning in the loss. What changes inside the model at that moment? Three clues existed separately: emergence is sharp, not gradual; at a fixed scale it depends on the random seed (Zhao et al. 2026); and the formation of induction heads coincides with the in-context learning phase transition (Olsson et al. 2022). This NYU paper connects them into one causal chain: emergence is bottlenecked by learning attention patterns, those patterns are sparse and hard to find, and the moment one is found looks like a phase transition.

Method

Two experimental programs.

The first runs a causal analysis on Pythia, an open suite of language models with checkpoints saved throughout training up to step 143000. The paper uses five sizes from 14M to 410M parameters, ten random initializations each. A binary search over checkpoints locates the emergence point, defined as the first step where greedy decoding outputs the correct token. Then comes activation patching: attention maps from individual heads in the post-emergence checkpoint are pasted into the pre-emergence checkpoint, heads are ranked by the resulting gain in correct-token probability, and the top K=16 causal heads are tested on whether they alone elicit the capability early.

The second program builds synthetic tasks, because natural language has no single ground-truth attention map and the variables cannot be controlled. A linear map task asks the model to predict xA mod 2, where each row of A has exactly s nonzero entries; predicting each output bit amounts to computing parity over a sparse subset of the input, so A itself is the ground-truth attention pattern. A cellular automata task updates cells through a local-window lookup table, so the pattern stays fixed while context length grows arbitrarily. Together the tasks separate sparsity from context length, and an attention bias lets the authors hand the correct pattern to the model as a control.

Results

FindingSetupResult
Emergence is random, stabilizes with scalePythia repetition task, 10 seeds per sizeAll ten seeds solve it at 160M and 410M, earlier on average; smaller sizes leave some seeds failing through end of training
Patching 16 heads triggers earlyPre-emergence checkpoint plus causal head mapsRecovers most of the pre/post-emergence gap; the capability is spread across heads, no single head suffices
Medium sparsity is hardestLinear map, sweeping s/SAny sparsity is learnable at S=8; at S=32 almost nothing learns within 10,000 steps except s=1 and s=S
Context length is the bottleneckCellular automata, S up to 512Zero progress in 10,000 steps at S=512; with a ground-truth attention bias the plateau drops to about 100 steps and stops growing with S
Head count beats head dimensionFixed width 128, sweeping head count128 heads at head dim 1 still solve the linear map; the same config learns slower on cellular automata
Architectures split by taskBoth tasksMLP-Mixer learns the linear map an order of magnitude faster than a transformer but does worse on cellular automata; Mamba, Gated DeltaNet, and RWKV trail the transformer on both

A reverse check: adding c·A to the attention logits erases the loss plateau on the linear map entirely. The hard part is finding the pattern; computing mod 2 is trivial.

Why it matters

This moves emergence from phenomenon to mechanism: larger models emerge more because they learn attention patterns faster and more reliably, and scale needs no extra mystical story. For people running training, the paper points at three levers: attention interventions during training, attention designs with a sparsity inductive bias, and distilling attention maps from stronger models. The conclusion also floats synthetic pre-pretraining to seed the pattern search, with preliminary results in Appendix C. These are research directions, not production tricks.

Limitations

The authors list three: all Pythia experiments sit below 1B parameters and the capabilities studied are elementary; the synthetic tasks use positional attention patterns, and content-dependent patterns like induction heads may behave differently; the MLP-Mixer win appears on a single synthetic task.

Two more concerns from reading closely. Emergence is operationalized as greedy output matching the answer on a single sample, a narrow definition, and robustness to other samples or samplers rests mainly on the appendix. The S=512, 10,000-step budgets sit far from real language pretraining, and the paper offers no direct natural-language evidence that longer contexts make patterns harder to learn in production settings.

Terms

Source

What people are saying

Related papers

All paper explainers