Giacomo Greco
Elegant, rigorous max-entropy derivation of attention heads, untied QK/V and causal masking, but partly circular, purely theoretical, single-layer, and without empirical consequences.
We show that the transformer architecture emerges as the score of last-token laws in a natural statistical model of language, where sentences are empirical measures of tokens, a language is a law on , and our prior belief is that sentences carry no structure at all. By the maximum-entropy principle, we select the law closest to this prior in relative entropy among those reproducing an observed sentence-level statistic. We discuss the relevance of the statistic in the posterior interaction between tokens and we build a statistic, able to capture that interaction, with Luce's choice axiom truncated at the lowest relational order. This procedure gives the softmax choice rule, with the attention cross-moment as its mean parameter. The query--key matrix is then the Lagrange multiplier of a maximum-entropy problem inside each sentence, and the value matrix the multiplier of the constraint over the language, so that the two are untied. Under the optimal entropic law we then show that a transformer head appears in the score of the last-token law. For ordered sentences, causal masking follows from the masked reference choice rule, and with a next-token cross-moment the score equals one causally masked attention head. We also discuss multi-head attention, weight-tied unembedding, and a heuristic reading of residual blocks as projected Langevin steps.
The paper offers a statistical "origin story" for softmax attention. Sentences are empirical measures on the sphere, and a language is a law on P(P(S^d)). The null model is structureless: i.i.d. uniform tokens with a random length. The author selects the KL-closest law that reproduces an observed sentence-level statistic. Pair-additive or moment statistics are shown to give no key competition. Relational structure is then built from Luce's choice axiom, and a harmonic truncation at lowest relational order gives the bilinear softmax rule with matrix Λ = QᵀK. The statistic is the attention cross-moment S_Λ, which is the mean parameter of the choice-rule exponential family. The Gibbs tilt has the value matrix V as its Lagrange multiplier, so Λ and V are untied. This contrasts with the free-energy statistic, which forces V = λΛ.
The mathematics is careful and largely correct.
The weaknesses are in the modeling logic rather than the proofs.
This is a theory-flavored paper in the "why does the architecture look like this" genre. It connects to maximum-entropy language models (Berger, Rosenfeld), minimax entropy (Zhu–Wu–Mumford), discrete choice, and mean-field and measure-based views of transformers. Its main value is conceptual: untied QK/V as inner and outer multipliers, the explanation of why moment statistics produce no competition, and masking as a consequence of a masked reference measure. It does not change practice and offers no new architectures or training algorithms. Its suggestions, such as a fixed unembedding or higher-order harmonic attention, are speculative and untested. The audience is mathematicians working on transformer theory (probability, optimal transport, mean-field), with limited reach to mainstream ML practitioners. Its influence may be modest but real within the mathematical-theory niche, and it is an elegant derivation others could cite.
Mathematical understanding of transformers is active (Geshkovski et al., Rigollet, Sinkformers, entropic OT readings of attention), so the paper is relevant. The shift from studying dynamics given attention to asking where attention comes from is a fresh framing. The paper positions itself well against Litman, Hopfield-network derivations, and Fraiman. However, the "derivations of attention" space is crowded, and derivations that do not yield predictions often have limited uptake.
Reproducibility is not applicable in the empirical sense. All proofs are included, and the AI-assisted-checking disclosure is notable. Clarity is decent but heavy: the notation is dense, with many nested definitions, though the Meta-Theorems help.
Generated Oct 30, 2026
Elegant, rigorous max-entropy derivation of attention heads, untied QK/V and causal masking, but partly circular, purely theoretical, single-layer, and without empirical consequences.