Self-Attention Dynamics: Models and Mechanisms
- Self-attention dynamics is the study of how evolving attention weights, token states, and interaction geometries convert similarity structures into dynamic evolution.
- It employs continuous and discrete formulations, revealing nonlocal transport phenomena, spectral selection, and clustering mechanisms in neural networks.
- Architectural models leveraging dynamic routing, energy-based, and probabilistic approaches demonstrate practical applications in NLP, vision, and biological inference.
Self-attention dynamics denotes the study of how attention weights, token states, and induced interaction geometries evolve under repeated attention updates, continuous-depth limits, or training. In the current literature, the term spans several distinct but related objects: interacting-particle flows on the unit sphere, mean-field transport equations, recurrent discrete-time attention maps, dynamic-routing sentence encoders, task-conditioned directed graphs over multivariate time series, and probabilistic generative models in which attention directly parameterizes transition or exponential-family conditionals (Kuehn et al., 28 Apr 2026, Burger et al., 6 Jan 2025, Yoon et al., 2018, Mahmood et al., 2021, Ildiz et al., 2024, Wibisono et al., 28 Jan 2025). Across these settings, the common question is how attention converts similarity structure into dynamical evolution—whether by clustering, spectral selection, synchronization, adaptive routing, or optimization-induced geometric bias.
1. Core formulations of self-attention as a dynamical system
A canonical continuous-time formulation models tokens on a product of spheres, with attention matrix defined row-wise by
and dynamics
In this representation, time corresponds to continuous depth, the tangent projection models layer normalization, and the interaction graph is fully connected but state-dependent (Altafini, 14 Nov 2025). Closely related formulations impose the symmetry constraint , yielding an idealized Transformer-type flow
which makes the spectral structure of directly visible in the induced motion (Kuehn et al., 28 Apr 2026).
A second line of work treats self-attention dynamics as a mean-field transport problem. For layer-normalized attention on the sphere, the empirical measure of particles converges formally to a continuity equation
with velocity
or, in a related fixed-weight setting,
These PDE limits make explicit that self-attention is a nonlocal transport mechanism whose velocity depends on the entire token distribution (Burger et al., 6 Jan 2025, Geshkovski et al., 2023).
Not all self-attention dynamics are continuous. In Dynamic Self-Attention, the dynamics are iterative and sentence-specific: projected word features 0 are combined through routing logits 1, weights 2, aggregates 3, and dynamic vectors 4, with updates 5. The resulting 6 are dynamic weight vectors that vary across sentences and routing iterations rather than being fixed learned queries (Yoon et al., 2018). In CARSA, the temporal dimension is first compressed per variable through
7
after which self-attention acts across variables rather than across time: 8 Here the induced attention weights define a subject-specific directed adjacency 9 from component 0 to component 1 (Mahmood et al., 2021).
These formulations differ in state space, iteration variable, and semantics, but they share a common structure: attention weights are endogenous, state-dependent couplings, and the ensuing dynamics can be studied either at the level of individual tokens, variables, or distributions.
2. Geometric, variational, and energy-based structures
A major mathematical theme is that certain self-attention systems admit a gradient-flow interpretation. For multi-head self-attention with symmetric score matrices 2 and value alignment 3, the interaction energy
4
satisfies the exact Lyapunov identity
5
for both flat and spherical dynamics (Pendharkar, 5 May 2026). In the symmetric single-kernel setting, the same phenomenon appears as a weighted Riemannian gradient flow: with
6
the induced vector field is precisely the weighted gradient of 7 under a state-dependent metric involving the partition functions 8 (Kuehn et al., 28 Apr 2026).
At the mean-field level, layer-normalized self-attention with 9 yields the interaction energy
0
together with a Wasserstein-type geometry with nonlocal mobility
1
The resulting PDE is a metric gradient flow in 2, and stationary measures are exactly those for which 3 on the support (Burger et al., 6 Jan 2025). This places self-attention near the theory of aggregation equations, but with two nonstandard ingredients: confinement to the sphere and a mobility depending on the current measure.
A distinct but related construction expresses self-attention as the negative gradient of local energies rather than a single global energy. With vector spins 4 and pairwise couplings 5, define
6
Then
7
so the local attention update is exactly a negative local-energy gradient, with a pseudo-likelihood interpretation rather than a global Hopfield energy (D'Amico et al., 2024).
These variational viewpoints are powerful but conditional. Multi-head monotonicity can fail at the per-head level on the sphere because of radial shadow terms 8, and approximate value alignment, orthogonality, or projection structure are treated as controlled idealizations rather than generic properties of trained Transformers (Pendharkar, 5 May 2026). The mean-field and local-energy theories similarly rely on symmetry or architectural tying assumptions that are mathematically advantageous but narrower than standard large-scale practice (Burger et al., 6 Jan 2025, D'Amico et al., 2024).
3. Spectral selection, clustering, multistability, and metastability
When self-attention is viewed as an interacting particle system, asymptotic behavior is organized by clustering and by the spectrum of the value operator. In the fixed-weight continuous-time model
9
the rescaled dynamics 0 exhibits convergence to specific geometric limiting objects (Geshkovski et al., 2023). For 1 and 2, the convex hull of the rescaled particles is non-increasing and converges to a convex polytope, and each token converges either to 3 or to a point in a finite set 4. In one dimension, the self-attention matrix itself converges to a low-rank Boolean matrix, analytically confirming the emergence of leaders (Geshkovski et al., 2023).
The symmetric spectral theory sharpens this picture. In the eigenbasis of 5, coefficient dynamics take the replicator-type form
6
with 7 the softmax kernel and 8 the modal average. This reveals a mode-selection mechanism: if one positive eigenvalue 9 strictly dominates all others in modulus and initial conditions lie in a forward-invariant cone, then all tokens converge to the dominant eigendirection; if 0 is negative definite, the dynamics selects sign-split polarization toward the most negative eigendirection (Kuehn et al., 28 Apr 2026). The same spectral dependence appears in the broader single-head ODE on spheres, where equilibria fall into four classes—consensus, bipartite consensus, clustering, and polygonal—and multistability is typical rather than exceptional (Altafini, 14 Nov 2025).
Metastability introduces a slower timescale. For self-attention on the unit sphere with separated low-temperature initial clusters, particles remain trapped near a multi-cluster configuration for an exponentially long period, even though the global asymptotic state is full collapse to a single cluster (Geshkovski et al., 2024). The metastability theorem gives explicit times
1
such that particles remain within their spherical caps up to 2 and intra-cap distances are exponentially small on 3. Beyond this regime, after an appropriate time-rescaling, the energy exhibits a staircase profile with saddle-to-saddle-like behavior (Geshkovski et al., 2024).
Clustering is accompanied by entropy dynamics. In the scalar-head equiangular regime of multi-head attention, the attention entropy
4
obeys
5
and increases monotonically toward 6 as clustering progresses (Pendharkar, 5 May 2026). A plausible implication is that “collapse” in self-attention need not mean low-entropy concentration of row distributions; in several symmetric regimes, geometric clustering of states coincides with equalization of scores and more uniform attention.
4. Training dynamics, optimization geometry, and objective-induced structure
Another use of the phrase “self-attention dynamics” concerns how training shapes the score geometry itself. In a single-layer softmax self-attention model trained for linear regression, the finite-data predictor
7
reduces in the infinite-data Gaussian limit to the bilinear map 8. The population loss becomes
9
which is a weighted matrix factorization problem. A balancing regularizer
0
and a geometry-aware preconditioner in the 1 metric yield geometric convergence, with population excess loss
2
under spectral initialization and sufficiently small step size (Goel et al., 2 Mar 2026). This establishes a rare global optimization result for softmax self-attention.
Training objective also leaves a structural signature on the bilinear form 3. The update
4
decomposes into rank-1 token-pair outer products, making symmetry and directionality analytically tractable (Saponati et al., 15 Feb 2025). Bidirectional objectives induce approximate symmetry because pairwise contributions appear in both directions, whereas autoregressive objectives induce directionality and column dominance because a token is used disproportionately as context for future predictions. Empirically, encoder-only models such as BERT, RoBERTa, XLM-R, ALBERT, and ModernBERT exhibit high symmetry scores, while decoder-only models such as GPT, LLaMA2/3, Mistral, Mixtral, and Phi exhibit strong negative directionality scores and low symmetry (Saponati et al., 15 Feb 2025).
When energy structure is absent or relaxed, Jacobian analysis becomes central. For recurrent self-attention systems such as
5
the Jacobian factorizes as
6
and normalization layers suppress the spectral radius by removing radial components and shrinking complex modes (Tomihari et al., 26 May 2025). The normalization bound
7
formalizes this effect. Empirically, learned 8 remains small, Lyapunov exponents concentrate near zero, and the best-performing models operate slightly on the chaotic side of criticality (Tomihari et al., 26 May 2025).
A complementary large-9 theory derives dynamical mean-field equations for a simplified 1-bit self-attention network. The order parameters
0
and attention field 1 satisfy closed equations obtained from a generating functional, and the resulting mean-field dynamics exhibits periodic, quasi-periodic, and chaotic regimes, with nonequilibrium phase transitions and chaotic bifurcations even for short context 2 and few features 3 (Poc-López et al., 2024). This moves the subject beyond asymptotic equilibrium analysis and shows that rich nonstationary behavior already appears in minimal self-attention systems.
5. Architectural realizations across domains
Several architectures build the dynamics directly into the attention mechanism rather than merely analyzing it post hoc. Kuramoto Attention places each hidden coordinate on the torus, 4, and scores tokens by gated cosine similarity with rotary phase drift,
5
Because values are raw phase states, the tangent update is exactly
6
the classical Kuramoto coupling term (Nunley, 10 Jun 2026). The model therefore interprets attention as “selection then synchronization.” On enwiki8, its validation bits-per-character stays within 7 BPC of a matched RoPE+SwiGLU transformer at one million parameters and is level on the median at five million parameters (Nunley, 10 Jun 2026).
In spiking Transformers, Neural Dynamics Self-Attention replaces explicit matrix storage by membrane dynamics. Standard Spiking Self-Attention computes
8
but still requires the 9 intermediate 0 (Zhang et al., 9 Mar 2026). LRF-Dyn adds localized receptive fields and rewrites attention as charge-fire-reset dynamics,
1
thereby eliminating explicit 2 storage. On Spikformer-8-512, LRF-Dyn reduces inference memory by 3 while improving accuracy by 4, and Table 1 lists storage complexity 5 rather than 6 (Zhang et al., 9 Mar 2026).
Task-specific attention dynamics also appear in more conventional domains. CARSA uses a single-layer bidirectional LSTM with hidden size 7 to encode per-component autoregression, then applies self-attention across 8 ICA components, treating the learned attention matrix as a subject-specific directed connectivity graph for schizophrenia classification (Mahmood et al., 2021). Dynamic Self-Attention adapts capsule-network routing to NLP: with 9 routing iterations, it computes sentence-specific dynamic vectors 0 and achieves 1 on SNLI for the 2D single-DSA model and 3 for the 4D multiple-DSA model, while the single model uses 5M parameters (Yoon et al., 2018).
A different biological route derives self-attention as an emergent property of neuron–astrocyte dynamics. In astrocyte-gated associative memory, gains 6 evolve on the simplex by the entropy-regularized replicator equation
7
with squared-overlap scores
8
At fixed points,
9
so astrocytic gains implement softmax-normalized routing over memory patterns (Vivet et al., 28 Apr 2026). In high-load, high-interference retrieval, this mechanism improves accuracy relative to classical Hopfield dynamics and recent neuron–astrocyte baselines (Vivet et al., 28 Apr 2026).
6. Probabilistic interpretations, interpretability, and limitations
A probabilistic reading identifies self-attention with conditional generative structure. For a one-layer model with tied embeddings and identity values, the attention output
00
is exactly equivalent to a context-conditioned Markov chain whose transition probabilities are reweighted by the empirical token frequencies of the prompt (Ildiz et al., 2024). The CCMC transition is
01
and this equivalence yields consistency and sample-complexity results under co-occurrence connectivity conditions (Ildiz et al., 2024). For a single autoregressive trajectory, however, the same mechanism produces a winner-takes-all effect: in the 02 case with one weak token, the weak token’s empirical frequency decays polynomially, providing a mathematical explanation for repetitive generation (Ildiz et al., 2024).
Exponential Family Attention generalizes this probabilistic viewpoint beyond categorical next-token prediction. It models
03
with natural parameter 04 obtained from the attended context
05
This allows the same self-attention dynamics to parameterize categorical, Bernoulli, Gaussian, or Poisson conditionals, and the theory establishes linear identifiability up to invertible transforms together with a 06-type excess-risk bound (Wibisono et al., 28 Jan 2025).
Interpretability claims are domain-dependent and must be qualified. In CARSA, attention-derived adjacency matrices are interpretable as subject-specific effective connectivity and highlight predictive components, but they are explicitly not a proof of causality; hemodynamic lag, sampling rate, and noise remain confounds, and the learned graph is tuned for classification rather than mechanistic inference (Mahmood et al., 2021). In next-token prediction, Token Priority Graphs give a graph-theoretic account of why topic stability dominates: the priority order induced by self-attention is preserved under mixed-topic training, and a spontaneous topic change can occur only if lower-priority tokens outnumber all higher-priority tokens of the input topic; longer contexts and more ambiguous topics reduce the likelihood of such a change (Jia et al., 10 Jan 2025).
Theoretical limitations are equally explicit. Energy-based monotonicity results typically require symmetry, value alignment, projection structure, or orthogonality conditions, and approximate robustness is only partially understood (Pendharkar, 5 May 2026). The Jacobian-based perspective emphasizes that standard multi-head, discrete-time, normalized attention often does not admit a useful global energy function at all, motivating pseudo-energy diagnostics such as
07
for monitoring inference instead of asserting true Lyapunov behavior (Tomihari et al., 26 May 2025). A plausible synthesis is that “self-attention dynamics” names not one dynamical theory but a family of compatible lenses—variational, spectral, probabilistic, recurrent, and training-geometric—each exact only on its own regime of assumptions.