Emergence of the transformer architecture as the score of entropic laws of random measures
Abstract
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.
Create a lesson
Metadata
- Categories
- cs.AI, math.PR, stat.ML
- Comments
- 38 pages, 3 figures
Related papers
STEdgeFormer: MCU and NPU Deployable Transformer Architecture
Shared title terminologycs.AISudhakar Sah
PruneNAS: Constraint Aware Neural Architecture Search based Pruning
Shared title terminologycs.AISudhakar Sah, Nikhil Chhabra, Honnesh Rohmetra et al.
EA-Bench: Measuring information and action efficiency under imperfect instructions
Shared title terminologycs.AIXu Wan, Wenyue Xu, Shenjie Zhao
When do stored facts become available in looped transformers?
Shared title terminologycs.AIFabio Valerio Massoli, Arnau Padrés Masdemont, Jordi Ros Giralt et al.
Specialized Large Language Models for Markovian Reasoning: Structural Cache Compression, Transition Pretraining, and Dual-Loop Transformers
Shared title terminologycs.AIHaibin Tong, Liangliang Xin, Yamei Zhu et al.
Comparative Performance of Machine Learning Architectures for Fault Detection and Diagnosis in Chemical Processes
Shared title terminologycs.AIRayane Ammar Khodja, Alexandre Voisin, Victor Costa et al.