Research map / Architectures and efficiency / Attention and transformers
Consensus Is All You Get: The Role of Attention in Transformers
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Shows via a continuous-time control-theoretic model of attention on ellipsoids/spheres that tokens converge to consensus (collapse) under several assumptions, and checks this empirically on GPT-2 XL and GPT-Neo 2.7B.
Problem
Understanding why transformer tokens cluster (rank/representation collapse) as depth grows, with rigorous asymptotic guarantees for the attention dynamics.
Approach
Models attention as a continuous-time dynamical system on an ellipsoid (layer normalization as projection) and applies consensus dynamics and input-to-state stability from control theory, instead of mean-field or stochastic methods, to prove token convergence to a single cluster under several assumptions on Q, K, U and number of heads.
Key results
- Theorem 3.2: for full attention with any number of heads, tokens converge to consensus when starting in an open hemisphere, given bounded and uniformly continuous P=Q^T K and identity U.
- Theorem 4.2: for causal attention with identity U, the consensus set is asymptotically stable with a domain of attraction covering almost all initial conditions.
- GPT-2 XL and GPT-Neo 2.7B layer-wise cosine-consensus error E converges toward 0 across depth when feedforward layers are removed, and still converges with them present.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Include feedforward layers rather than remove them (ablation) | GPT-2 XL and GPT-Neo 2.7B · Repeated model passes on 100 random prompts | rate of convergence of average cosine-similarity error E | Mixed |
| Include feedforward layers rather than remove them (ablation) | GPT-2 XL and GPT-Neo 2.7B with random weight matrices · Repeated model passes on 100 random prompts | rate of convergence of average cosine-similarity error E | Hurt |
Surprising findings
- Consensus still occurs in GPT-2 and GPT-Neo with random weight matrices, suggesting collapse is a structural property of the architecture rather than of learned weights.
- Feedforward layers may slow convergence in GPT-Neo while speeding it up in GPT-2.
Limitations
- Theory holds under strong assumptions (bounded P, identity or single-head U); the symmetric-U result is proved only for a single head.
- Theoretical model excludes feedforward layers and uses continuous-time approximation.
- Experiments repeat tokens through the model to simulate increased depth, which deviates from standard usage.
Experimental setup
Datasets: 100 random prompts of 200 GPT-2 tokenizer tokens each (synthetic)
Metrics: cosine-similarity token consensus error E Lyapunov function V
Baselines: Geshkovski et al. 2023a Karagodin et al. 2024
Builds on: Geshkovski et al. 2023 mathematical model of attention Karagodin et al. 2024 consensus dynamics on manifolds
Closest papers by meaning
- On the Emergence of Position Bias in Transformers (ICML 2025 · similarity 0.89)
- Dynamical Properties of Tokens in Self-Attention and Effects of Positional Encoding (NeurIPS 2025 · similarity 0.89)
- What are you sinking? A geometric approach on attention sink (NeurIPS 2025 · similarity 0.89)
- Spectral Conditioning of Attention Improves Transformer Performance (NeurIPS 2025 · similarity 0.87)
- On the Role of Attention Masks and LayerNorm in Transformers (NeurIPS 2024 · similarity 0.87)
- The underlying structures of self-attention: symmetry, directionality, and emergent dynamics in Transformer training (ICML 2025 · similarity 0.86)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
