Token Sample Complexity of Attention
Not on the map. Why?
Abstract (arXiv)
As context windows in large language models continue to expand, it is essential to characterize how attention behaves at extreme sequence lengths. We introduce token sample complexity: the rate at which attention computed on n tokens converges to its infinite-token limit. We estimate finite-n convergence bounds at two levels: pointwise uniform convergence of the attention map, and convergence of moments for the transformed token distribution. For compactly supported (and more generally sub-Gaussian) distributions, our first result shows that the attention map converges uniformly on a ball of radius R at rate C(R)/√n, where C(R) grows exponentially with R. For large R, this estimate loses practical value, and our second result addresses this issue by establishing convergence rates for the moments of the transformed distribution (the token output of the attention layer). In this case, the rate is C'(R)/nβ with β<tfrac12, and C'(R) depends polynomially on the size of the support of the distribution. The exponent β depends on the attention geometry and the spectral properties of the token distribution. We also examine the regime in which the attention parameter tends to infinity and the softmax approaches a hardmax, and in this setting, we establish a logarithmic rate of convergence. Experiments on synthetic and real data support our predictions and show that the predicted slowdown is reflected in downstream accuracy.
Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Builds on 27 of its 48 references that are in the map. First posted on arXiv 11 Dec 2025.
Builds on
27 of 48 references.
References · 27
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2020Longformer: The Long-Document Transformercited by 3,362
- 2024Gemini 1.5: Unlocking multimodal understanding across millions of tokens of contextcited by 3,175
- 2020Big Bird: Transformers for Longer Sequencescited by 1,673
- 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
- 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 721
- 2024KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantizationcited by 571
- 2021Datasets: A Community Library for Natural Language Processingcited by 526
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
15 more
- 2023A mathematical perspective on Transformerscited by 160
- 2021Sinkformers: Transformers with Doubly Stochastic Attentioncited by 136
- 2023The emergence of clusters in self-attention dynamicscited by 133
- 2023What and How does In-Context Learning Learn? Bayesian Model Averaging, Parameterization, and Generalizationcited by 112
- 2023In-Context Convergence of Transformerscited by 112
- 2019Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of Viewcited by 108
- 2019A Short Note on Concentration Inequalities for Random Vectors with SubGaussian Normcited by 105
- 2020A Mathematical Theory of Attentioncited by 43
- 2024Emergence of meta-stable clustering in mean-field transformer modelscited by 35
- 2024Clustering in Causal Attention Maskingcited by 31
- 2025A Unified Perspective on the Dynamics of Deep Transformerscited by 30
- 2025Quantitative Clustering in Mean-Field Transformer Modelscited by 23
- 2024How do Transformers perform In-Context Autoregressive Learning?cited by 16
- 2018Stochastic Deep Networkscited by 13
- 2019Approximation capability of neural networks on spaces of probability measures and tree-structured domainscited by 9
Built on by
Citing papers per year: 2025: 1; 2026: 2.
3 papers.