The Bayesian Geometry of Transformer Attention
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
- 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,718
- 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,465
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
- 2023Progress measures for grokking via mechanistic interpretabilitycited by 839
- 2022Transformers learn in-context by gradient descentcited by 732
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
- 2015Weight Uncertainty in Neural Networkscited by 554
- 2023Hyena Hierarchy: Towards Larger Convolutional Language Modelscited by 393
- 2024Repeat After Me: Transformers are Better than State Space Models at Copyingcited by 216
- 2023In-Context Learning through the Bayesian Prismcited by 83
- 2025Can Transformers Learn Full Bayesian Inference in Context?cited by 31
Built on by
Citing papers per year: 2025: 1; 2026: 12.
13 papers.
Sort:
By area:
- 2026Kalman Linear Attention: Parallel Bayesian Filtering For Efficient Language Modelling and State Trackingcited by 8
- 2026The Geometric Reasoner: Manifold-Informed Latent Foresight Search for Long-Context Reasoningcited by 3
- 2026Fundamental Reasoning Paradigms Induce Out-of-Domain Generalization in Language Modelscited by 3
- 2026Position: agentic AI orchestration should be Bayes-consistentcited by 3
- 2026Mechanistic Tomography: Designed Measurement for Control-Oriented Interpretabilitycited by 2
- 2025Gradient Descent as Implicit EM in Distance-Based Neural Modelscited by 1
- 2026Universal priors: solving empirical Bayes via Bayesian inference and pretrainingcited by 1
- 2026ObserverBench: Testing Mechanistic Estimates for Intervention and Controlcited by 1
- 2026Attractor Geometry of Transformer Memory: From Conflict Arbitration to Confident Hallucinationcited by 0
- 2026In-context learning enables continental-scale subsurface temperature prediction from sparse local observationscited by 0
- 2026Meta-Attention: Bayesian Per-Token Routing for Efficient Transformer Inferencecited by 0
- 2026Bayesian Wind Tunnels for Model Selectioncited by 0
- 2026Small transformers track Bayesian evidence for latent common causes via a context-invariant mechanism28 Sep 2026
- 2026ObserverBench: Testing Mechanistic Estimates for Intervention and Control2 Sep 2026
- 2026Mechanistic Tomography: Designed Measurement for Control-Oriented Interpretability19 Aug 2026
- 2026Bayesian Wind Tunnels for Model Selection1 Jul 2026
- 2026Meta-Attention: Bayesian Per-Token Routing for Efficient Transformer Inference27 May 2026
- 2026In-context learning enables continental-scale subsurface temperature prediction from sparse local observations15 May 2026
- 2026Attractor Geometry of Transformer Memory: From Conflict Arbitration to Confident Hallucination7 May 2026
- 2026Position: agentic AI orchestration should be Bayes-consistent1 May 2026
- 2026Universal priors: solving empirical Bayes via Bayesian inference and pretraining16 Feb 2026
- 2026Kalman Linear Attention: Parallel Bayesian Filtering For Efficient Language Modelling and State Tracking11 Feb 2026
- 2026Fundamental Reasoning Paradigms Induce Out-of-Domain Generalization in Language Models9 Feb 2026
- 2026The Geometric Reasoner: Manifold-Informed Latent Foresight Search for Long-Context Reasoning25 Jan 2026
1 more
- 2026Kalman Linear Attention: Parallel Bayesian Filtering For Efficient Language Modelling and State Trackingcited by 8
- 2025Gradient Descent as Implicit EM in Distance-Based Neural Modelscited by 1
- 2026Universal priors: solving empirical Bayes via Bayesian inference and pretrainingcited by 1
- 2026Attractor Geometry of Transformer Memory: From Conflict Arbitration to Confident Hallucinationcited by 0
- 2026In-context learning enables continental-scale subsurface temperature prediction from sparse local observationscited by 0
- 2026Meta-Attention: Bayesian Per-Token Routing for Efficient Transformer Inferencecited by 0
- 2026Bayesian Wind Tunnels for Model Selectioncited by 0
- 2026Small transformers track Bayesian evidence for latent common causes via a context-invariant mechanismcited by 0
- 2026Small transformers track Bayesian evidence for latent common causes via a context-invariant mechanism28 Sep 2026
- 2026Bayesian Wind Tunnels for Model Selection1 Jul 2026
- 2026Meta-Attention: Bayesian Per-Token Routing for Efficient Transformer Inference27 May 2026
- 2026In-context learning enables continental-scale subsurface temperature prediction from sparse local observations15 May 2026
- 2026Attractor Geometry of Transformer Memory: From Conflict Arbitration to Confident Hallucination7 May 2026
- 2026Universal priors: solving empirical Bayes via Bayesian inference and pretraining16 Feb 2026
- 2026Kalman Linear Attention: Parallel Bayesian Filtering For Efficient Language Modelling and State Tracking11 Feb 2026
- 2025Gradient Descent as Implicit EM in Distance-Based Neural Models31 Dec 2025