Source-linked AI summary
Asymptotic Behavior of Transformers
Katy Blumer, Da-Cheng Juan, Jon Kleinberg, Ravi Kumar, Cyrus Rashtchian, Andrew Tomkins
TL;DR
The paper asks how a fixed transformer behaves when it generates for an arbitrarily long time, rather than how performance changes with context length. It studies empirical state through ODEs and finds that sufficiently high temperature ensures convergence for each fixed model, while no universal finite temperature guarantees convergence across models.
Problem
Most theoretical analyses fix sequence length or study context-window changes, leaving the behavior of a fixed transformer as generated tokens tend to infinity as a distinct question.
Source: §1 · p. 1Method
The paper models slowly changing empirical token or cache distributions with limiting ODEs and analyzes how temperature affects their dynamics.
Source: §3.2 · p. 15, §6 · p. 21Results
For each fixed transformer, sufficiently high temperature yields convergence to a unique limiting state, but at every finite temperature some transformer can fail to converge.
Source: §1 · p. 3, §6 · pp. 21–22Takeaways & Limitations
Temperature controls long-run stability model by model, but no universal finite temperature guarantees convergence for all transformers.
Source: §6 · p. 22The analyzed multi-layer setting assumes fixed depth and heads, fixed-width local windows, bounded reachable states and logits, and uniformly Lipschitz maps; temperature is bounded below by a positive constant.
Source: §3 · p. 9, §3.1 · p. 12
Abstract
from arXiv · showhide
In this paper we study the behavior of transformer networks generating text over long periods of time. We show that even a three-token, single-layer attention-only transformer can fail to converge. We then study a rich class of transformers with arbitrary finite depth, layer normalization, MLPs, RoPE encodings, and an arbitrary mix of local and global layers. Every transformer in this class has a softmax temperature threshold above which its empirical cache distribution converges to a unique limit, independent of initial conditions. We show further that, while each transformer has a temperature threshold, the supremum of this set is infinite, so there is no global minimal temperature that forces all transformers to converge.
1 Introduction
The paper shifts attention from fixed-length analysis to the long-run behavior of a fixed autoregressive transformer, motivated in part by models that may remain in a generated state. It describes this behavior through deterministic ODEs and shows that high temperature ensures convergence for each fixed model, but no single finite temperature works for all models.
1 Introduction
- For a single-layer attention-only model without positional encodings, MLPs, or normalization, the empirical token distribution summarizes history and tracks an ODE almost surely.Freezing the history makes the model a finite-state Markov chain whose steady state shifts as the empirical distribution drifts.Source: §1 · pp. 1–2
- The empirical cache process almost surely tracks a deterministic ODE over fixed intervals of a rescaled time, reducing long-run generation to dynamics on fixed-dimensional cache distributions.The cache changes by only 1/(t + 1) per step, motivating the s-time scale j = log t + O(1).Source: §1 · p. 3
- For every fixed transformer, sufficiently high temperature makes the cache ODE contractive and the empirical cache converges almost surely to a unique globally attracting fixed point.The convergence threshold depends on the model; no uniform threshold applies across the class.Source: §1 · p. 3
- At every fixed finite temperature, some simplified three-token, single-layer attention-only transformer fails to converge, so no universal finite temperature guarantees convergence across models.Scaling its output embeddings by the temperature leaves its next-token probabilities unchanged.Source: §1 · p. 3
1.1 Background
- Stochastic approximation relates accumulated-time ODE tracking to the process's limiting set, and a globally attracting fixed point yields convergence.The paper applies this framework to empirical token and cache distributions (Bena¨ım, 1999).Source: §1.1 · p. 4
2 Single-Layer Transformer
The single-layer analysis shows that sufficiently high softmax temperature makes the empirical token distribution converge to a unique limit, while a two-token example illustrates temperature-dependent limiting behavior. The proof tracks token frequencies with an ODE and bounds how its stationary distribution changes with history.
2 Single-Layer Transformer
- Without positional encodings, the single-layer model summarizes its history by the empirical token distribution, and next-token probabilities define a transition matrix.The model omits layer normalization and MLPs and uses one attention head.Source: §2 · p. 4
2.1 Limiting Dynamics
- The empirical token distribution tracks an ODE almost surely, whose limiting set is internally chain transitive.Its drift is the stationary distribution of the Markov chain induced by freezing the history, minus the current distribution.Source: §2.1 · p. 5
2.2 Jacobian
- The stationary-distribution map has Jacobian norm O(1/τ) at sufficiently high temperatures, making the map a contraction above a threshold.The contraction yields a unique globally attracting fixed point of the ODE.Source: §2.2 · p. 8
- For every τ > τc, the empirical token distribution converges almost surely to a unique fixed point; as τ → ∞, that point approaches uniformity.At τ ≤ τc, uniqueness of the limiting set is not guaranteed, and behavior may depend on model parameters.Source: §2.2 · p. 8
2.3 A Simple Example
- In the two-token example, τ > a gives a unique attracting fixed point, whereas τ < a yields two symmetric attracting fixed points.The paper also notes that the historical token distribution in these models converges for every positive temperature, though its limit may be random.Source: §2.3 · p. 9
3 Multi-Layer Transformer
The section analyzes fixed-width, fixed-depth transformers by representing their unbounded history with an empirical cache distribution and examining recent-token behavior with a frozen cache alongside slower cache evolution. It establishes that, above an architecture- and weight-dependent finite temperature threshold, the cache-update map has a unique fixed point and the empirical cache converges to it.
3 Multi-Layer Transformer
- A multi-layer transformer’s historical key-value vectors depend on generation context, so its unbounded history is represented by an empirical distribution over fixed-dimensional vectors; local layers depend only on the latest W = 1 + Lloc(w − 1) tokens.The section also shows that averages along RoPE phases converge to the uniform average on Hθ, uniformly in the starting phase.Source: §3 · pp. 9, 11
3.1 Frozen Cache Dynamics
- With the global cache fixed, every recent-token state is reachable and the process converges to a unique phase-dependent distribution, independently of its initial state.Over blocks long enough to forget the initial W-gram but short enough that the cache changes little, this description remains accurate; RoPE phase dependence can be averaged over a long block.Source: §3.1 · pp. 12–13
3.2 Slow Cache Dynamics
- On slow time s = log t + O(1), the empirical cache tracks the dynamics η′ = Γ(η) − η almost surely, and this equation has a unique solution for each initial cache distribution.Γ(η) is the average distribution of the next cache vector after recent tokens adjust to the frozen cache and RoPE phase is averaged; the result does not establish that the dynamics converge.Source: §3.2 · pp. 14–15
3.3 High-Temperature Convergence
- The high-temperature analysis begins by establishing a contraction result for expected next-cache states, using a weighted cache metric and the O(1/τ) sensitivity of softmax.The supplied passages state that the contraction bound has a term A(δ) that tends to zero as δ tends to zero, but do not include the complete result.Source: §3.3 · pp. 16–17
- In this high-temperature regime, the empirical cache converges almost surely to η* as time grows.The proof establishes convergence in d1,δ and uses its equivalence with d1.Source: §3.3 · p. 18
- Above a finite threshold τc, the cache-update map Γτ is a contraction and has a unique fixed point η* for every τ > τc.The threshold may depend on the transformer’s architecture and weights.Source: §3.3 · p. 18
4 Non-Convergence
A three-token, single-layer attention-only transformer can fail to converge almost surely, and the construction extends to every positive sampling temperature. Its limiting dynamics have a unique but unstable equilibrium, while sampling noise prevents convergence to that equilibrium.
4 Non-Convergence
- For c > 6, the unique equilibrium is the uniform distribution, but it is linearly unstable.Figure 3 depicts an attracting periodic orbit of the limiting ODE, with trajectories spiraling toward it from inside and outside.Source: §4 · p. 19, Figure 3 · p. 20
- Because sampling noise is nondegenerate in every tangent direction, the empirical distribution does not converge almost surely when the uniform equilibrium is the only fixed point.The non-convergence argument applies the standard stochastic-approximation result for linearly unstable equilibria.Source: §4 · p. 19
- The limiting ODE is a cyclic three-strategy logit best-response dynamic, related to rock–paper–scissors models, realized here within an explicit attention-only transformer.The paper establishes non-convergence of the transformer's empirical token frequencies.Source: §4 · p. 19
- For every temperature τ0 > 0, a single-layer, NoPE, attention-only transformer with no MLP can have an empirical token distribution that fails to converge almost surely.Scaling its output embeddings by τ0 leaves the next-token distribution unchanged, preserving the same non-convergent dynamics.Source: §4 · pp. 19–20
5 Related Work
Related work examines attention dynamics, positional information, length extrapolation, and long-context memory. This paper instead studies the long-run generation behavior of a fixed autoregressive model.
5 Related Work
- Prior attention-dynamics work studies representation evolution across layers, training, or idealized populations, whereas this paper follows a fixed model through generation time (Geshkovski et al., 2023; Burger et al., 2025; Bruno et al., 2025; Polyanskiy et al., 2025; Rigollet, 2026).Other related work addresses symmetry breaking, synchronization-inspired architectures, and cumulative attention dynamics, but not the infinite-generation limit (Silverstein et al., 2026; Liu et al., 2026; Herasymchyk et al., 2026).Source: §5 · pp. 20–21
- Other mathematical perspectives relate autoregressive attention to recurrent formulations, associative memory, and rank collapse under repeated pure self-attention (Katharopoulos et al., 2020; Ramsauer et al., 2021; Dong et al., 2021).The paper uses stochastic approximation to compare a slowly changing stochastic process with an ODE (Benaïm, 1999).Source: §5 · p. 20
- Positional-information research includes RoPE, ALiBi, and NoPE comparisons for length generalization, while other analyses study positional encodings and causal-transformer length generalization (Shaw et al., 2018; Dai et al., 2019; Press et al., 2022; Kazemnejad et al., 2023; Huang et al., 2025; Ruoss et al., 2023).RoPE extrapolation work modifies or studies positional scaling for longer inputs (Chen et al., 2023; Peng et al., 2024; Ding et al., 2024; Reid et al., 2026).Source: §5 · p. 21
- Long-context methods alter attention or memory through recurrent or compressed states, sparse local/global connections, retrieval, or bounded memory; this paper keeps ordinary global attention and studies its growing KV cache (Dai et al., 2019; Rae et al., 2020; Beltagy et al., 2020; Munkhdalai et al., 2024).Source: §5 · p. 21
6 Conclusion
For each fixed transformer in the model, sufficiently high temperature makes the associated ODE contractive and forces convergence to a unique limiting state. The required threshold depends on the transformer, so no finite temperature guarantees convergence for all transformers.
6 Conclusion
- For every fixed transformer in the model, sufficiently high temperature makes its ODE contractive and forces convergence to a unique limiting state.Source: §6 · p. 21
- At every fixed finite temperature, some transformer can have a non-convergent limiting ODE, so there is no universal finite temperature guaranteeing convergence across transformers.Source: §6 · p. 22
AI use statement
- The authors used generative AI tools to formulate and prove mathematical claims, draft parts of the paper, and identify relevant literature; they report that all LLM-assisted proofs were checked and rewritten.Source: AI use statement · p. 22
Related papers
This paper cites
- Attention Is All You Need2017
- RoFormer: Enhanced Transformer with Rotary Position Embedding2021
- Efficient Streaming Language Models with Attention Sinks2023
- Longformer: The Long-Document Transformer2020
- Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context2019
- Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention2020