On the Statistical Mechanics of Attention

Jerry Yao-Chieh Hu, Yu-An Chen, Maojiang Su, Han Liu
10/12/2026
cs.LGcond-mat.dis-nncond-mat.stat-mech
transformer-attention

No confident code implementation found for this paper.

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{hu2026statistical,
  title  = {On the Statistical Mechanics of Attention},
  author = {Jerry Yao-Chieh Hu and Yu-An Chen and Maojiang Su and Han Liu},
  year   = {2026},
  eprint = {2610.17347},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.17347v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2610.17347.svg)](https://codeofpaper.com/paper/2610.17347)

Discussion