mlsanityData to 14 Oct 2026

The Bayesian Geometry of Transformer Attention

arXiv 2512.22471 ↗First posted 27 Dec 2025cs.LG cs.AI stat.MLcited by 13

Not on the map. Why?

Abstract (arXiv)

Transformers often appear to perform Bayesian reasoning in context, but verifying this rigorously has been impossible: natural data lack analytic posteriors, and large models conflate reasoning with memorization. We address this by constructing Bayesian wind tunnels -- controlled environments where the true posterior is known in closed form and memorization is provably impossible. In these settings, small transformers reproduce Bayesian posteriors with 10-3-10-4 bit accuracy, while capacity-matched MLPs fail by orders of magnitude, establishing a clear architectural separation. Across two tasks -- bijection elimination and Hidden Markov Model (HMM) state tracking -- we find that transformers implement Bayesian inference through a consistent geometric mechanism: residual streams serve as the belief substrate, feed-forward networks perform the posterior update, and attention provides content-addressable routing. Geometric diagnostics reveal orthogonal key bases, progressive query-key alignment, and a low-dimensional value manifold parameterized by posterior entropy. During training this manifold unfurls while attention patterns remain stable, a frame-precision dissociation predicted by recent gradient analyses. Taken together, these results demonstrate that hierarchical attention realizes Bayesian inference by geometric design, explaining both the necessity of attention and the failure of flat architectures. Bayesian wind tunnels provide a foundation for mechanistically connecting small, verifiable systems to reasoning phenomena observed in large language models.

Key facts. Cited by 13 papers in the map (data through 14 Oct 2026). Builds on 12 of its 26 references that are in the map. First posted on arXiv 27 Dec 2025.

Builds on

12 of 26 references.

References · 12

  1. 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,718
  2. 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,465
  3. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
  4. 2023Progress measures for grokking via mechanistic interpretabilitycited by 839
  5. 2022Transformers learn in-context by gradient descentcited by 732
  6. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
  7. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
  8. 2015Weight Uncertainty in Neural Networkscited by 554
  9. 2023Hyena Hierarchy: Towards Larger Convolutional Language Modelscited by 393
  10. 2024Repeat After Me: Transformers are Better than State Space Models at Copyingcited by 216
  11. 2023In-Context Learning through the Bayesian Prismcited by 83
  12. 2025Can Transformers Learn Full Bayesian Inference in Context?cited by 31

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 12.

13 papers.

Sort:

By area: