English

Scaling Limits of Long-Context Transformers

Machine Learning 2026-05-12 v1 Artificial Intelligence Probability Statistics Theory Statistics Theory

Abstract

We study the long-context limit of softmax self-attention with a fixed query and a random context of nn i.i.d. keys on the sphere, viewing the inverse temperature βn\beta_n as the scaling parameter that decides whether attention degenerates into uniform averaging or collapses onto the single closest key. We show that the critical scale at which selectivity emerges is determined by the local exponent of the distance-to-query distribution near zero rather than by global features of the context, and scales like βnn2/(d1)\beta_n^\ast \asymp n^{2/(d-1)} for uniform keys on Sd1\mathbb{S}^{d-1}. Furthermore, we characterize the limiting laws of the ordered attention weights and of the attention output across all regimes of βn\beta_n: a subcritical regime in which the output reduces to a local average around qq with explicit deterministic bias and Gaussian fluctuations; a critical regime in which a finite collection of nearest keys retains macroscopic mass without single-key collapse; and a supercritical regime in which all mass concentrates on the closest key. Of notable interest is the subcritical case with identity value matrix where the attention map approximately implements a backward heat equation.

Cite

@article{arxiv.2605.08505,
  title  = {Scaling Limits of Long-Context Transformers},
  author = {Giuseppe Bruno and Shi Chen and Zhengjiang Lin and Yury Polyanskiy and Philippe Rigollet},
  journal= {arXiv preprint arXiv:2605.08505},
  year   = {2026}
}

Comments

40 pages, 4 figures

R2 v1 2026-07-01T12:59:10.172Z