AI and the World's Hard Problems · Physics · arXiv · 2026-12-01
Exact theory of next-token prediction

The authors study the next-token prediction ability of self-attention-based transformers using statistical mechanics and random matrix theory. They build an exact theory of free energy, state equation, and test-error scaling for both finite and infinite context lengths. A double descent phenomenon appears for zero-temperature learning, suggesting that data load and context length are coupled, and with infinite context length the errors match those of deterministic ridge shrinkage.