# Scaling Limits of Long-Context Transformers

*Giuseppe Bruno, Chen, Zhengjiang Lin, Yury Polyanskiy, Philippe Rigollet*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/152309) · [OpenReview](https://openreview.net/forum?id=U2aowiLeMa) · [alphaXiv](https://www.alphaxiv.org/abs/2605.08505) · [Open on the map](../papers.html#p152309)

Category: [Interpretability & Model Adaptation](../pcat/15.md) › [Transformer Attention Theory](../pgroup/150.md) · Type: theory · Keywords: attention scaling, transformer long context, softmax self-attention, critical temperature, asymptotic analysis

Areas: [Long Context](../areas/longcontext.md) › Long-context mechanisms › Efficient attention

## Summary
The paper analyses the scaling limits of softmax self-attention in long-context transformers, revealing how attention transitions from uniform averaging to focusing on nearest keys as context size grows.

## Explained to a 5-year-old
Imagine a robot that looks at many pictures and picks the most similar one. When there are many pictures, the robot sometimes looks at all of them equally, sometimes looks at a few, and sometimes only at the one that looks most like the target. This paper figures out when each of these happens and how the robot decides. It shows that the number of pictures and how picky the robot is are linked. It finds a simple rule that predicts the robot's behavior.

## Explained to a 5-year-old, longer
A computer program called a transformer reads many pieces of information at once. It has a special question it wants to answer. It looks at all the pieces and decides which ones are most similar to its question. Sometimes it spreads its attention evenly over all pieces. Other times it focuses on just a few pieces. In some cases it only looks at the single piece that looks most like the question. The paper studies how this happens when there are many pieces. It finds a rule that tells us when the program will use each of these ways of looking. The rule depends on how many pieces there are and how strict the program is. When there are many pieces, the program needs to be more strict to pick the right ones. The paper also shows that in one special case the program behaves like a simple smoothing process. This helps us understand big language models that read long texts.

## For a technical reader
The paper analyses how the attention mechanism in transformer models behaves as the context length grows. It treats the inverse temperature β as a scaling factor that controls whether attention becomes uniform or focuses on the nearest key. By assuming random keys on a sphere, they derive a critical β* that scales as n2/(d-1) and identify three regimes: averaging, balanced focus, and collapse to the closest key. They also show that with identity values the attention approximates a backward heat equation, providing a theoretical link to diffusion processes.

## Problem
Understanding how attention in transformers behaves as context length grows, and when it transitions from averaging to focusing on nearest keys.

## Method
The authors study the asymptotic behavior of softmax self-attention with a fixed query and random keys on a sphere, treating the inverse temperature β_n as a scaling parameter. They derive the critical scaling β_n* ~ n2/(d-1) and characterize three regimes of attention weight distribution.

## Results
They show the critical scale β_n* scales as n2/(d-1) for uniform keys on the sphere and identify three regimes-subcritical (local averaging with deterministic bias and Gaussian fluctuations), critical (mass retained on several nearest keys), and supercritical (collapse onto the closest key)-and note that with an identity value matrix the attention map approximates a backward heat equation.

## Contributions
They provide a theoretical characterization of attention scaling in long contexts, identifying the critical temperature scaling and three distinct asymptotic regimes, and connect the subcritical case to a backward heat equation.

## Limitations and assumptions
Assumes keys are i.i.d. uniformly distributed on the sphere and the query is fixed; analysis is asymptotic and may not capture finite-n effects; results are for softmax self-attention with isotropic keys.

## Research questions this paper is counted under

- [How does attention in transformers evolve and affect model behavior under training, noise, context length, and scale?](../q/207.md)

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/152309)
