On the Statistical Mechanics of Attention
cs.LG, cond-mat.dis-nn, cond-mat.stat-mech, cs.AI, stat.ML
Submitted: 2026-10-12
Updated: 2026-10-12
License: http://creativecommons.org/licenses/by-nc-sa/4.0/
The gist: We revisit the statistical mechanics of Transformer attention via modern Hopfield models.
Abstract
We revisit the statistical mechanics of Transformer attention via modern Hopfield models. We present a free-energy formalism to characterize parameter regimes and critical thresholds for robust attention inference. The resulting free-energy landscape incorporates randomness in query states and attention weights. Attention then emerges as the equation of motion of the corresponding statistical-mechanical system (i.e., modern Hopfield model) through the standard free-energy minimization principle. This allows us to identify first-order phase transitions in attention between glassy and robust-inference phases. We further extend to attentions with stochastic queries and keys. Together, our results provide a rigorous statistical-mechanics framework for characterizing phase structure and inference reliability across a family of Transformer attention mechanisms.
Sources
- NRGPT: An Energy-based Alternative for GPT
- Auto-Encoding Variational Bayes
- Exploring the Temperature-Dependent Phase Transition in Modern Hopfield Networks
- Large Associative Memory Problem in Neurobiology and Machine Learning
- Gradient Descent Converges to Minimizers
- Hopfield Networks is All You Need
- STanHop: Sparse Tandem Hopfield Model for Memory-Enhanced Time Series Prediction
Related papers
- Polynomial-Augmented Neural Networks (PANNs) with Weak Orthogonality Constraints for Enhanced Function and PDE Approximation
- AIRL-S: Unifying Reinforcement Learning and Search-Based Test-Time Scaling via Adversarial Inverse Reinforcement Learning
- Transformers as Bayesian In-Context Experimenters: Smoothness-Adaptive Efficient ATE Estimation
- Convergence issues in Relational Concept Analysis based on AOC-posets
- Beliefs Beyond Posteriors: The Predictive Cost of ELBO Binding
- Understanding Diffusion Models via Ratio-Based Function Approximation with SignReLU Networks