Self-Attention as a Covariance Readout: A Unified View of In-Context Learning and Repetition
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) exhibit two striking and ostensibly unrelated behaviours: in-context learning (ICL) and repetitive generation. In both, the model behaves as though it had summarised the context into a population-level statistic and discarded token-level detail. We ask whether this ``summarisation and forgetting'' can be derived from the attention mechanism itself, and answer in the affirmative. Under stationary, ergodic and elliptical inputs, the softmax attention output converges almost surely to ThetaVSigmaThetaKtopThetaQ xt, where Sigma is the input covariance; the long-context limit is therefore a linear readout of the input's second-order statistics. Two consequences follow. (i) For in-context linear regression, a single softmax head can implement one step of population gradient descent. Stacking such heads with residual connections iterates this update and implements multiple gradient descent steps. (ii) Propagated across an L-layer transformer, this readout drives the terminal hidden state at the parametric 1/t rate to a deterministic function of the current token alone, so that autoregressive generation collapses asymptotically to a first-order Markov chain whose attracting orbits furnish a structural account of repetition and mode collapse. The two phenomena thus emerge as facets of a single covariance-readout principle.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 12 of its 17 references that are in the map. First posted on arXiv 11 May 2026.
Builds on
12 of 17 references.
References · 12
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2019The Curious Case of Neural Text Degenerationcited by 2,916
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
- 2022Transformers learn in-context by gradient descentcited by 732
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
- 2019Neural Text Generation with Unlikelihood Trainingcited by 503
- 2023Trained Transformers Learn Linear Models In-Contextcited by 337
- 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 309
- 2023Large Language Models Are Latent Variable Models: Explaining and Finding Good Demonstrations for In-Context Learningcited by 149
- 2022Learning to Break the Loop: Analyzing and Mitigating Repetitions for Neural Text Generationcited by 94
- 2020A Theoretical Analysis of the Repetition Problem in Text Generationcited by 83
Built on by
Not cited yet.