LLMs are Bayesian, In Expectation, Not in Realization
Not on the map. Why?
Abstract (arXiv)
Bayesian accounts of in-context learning face a direct objection: exact posterior predictives for exchangeable data are invariant to task-preserving order, yet transformers change next-token probabilities when the same examples are serialized differently. We show this objection targets a structural invariant rather than the quantity scoring online prediction. For any Bayesian reference, excess prequential code length is exactly cumulative predictive KL. For unordered support sets that must be serialized, the expected regret of a single admissible ordering decomposes into that of the order-averaged predictor plus an order-averaging gain. Exchangeability violations are therefore not binary refutations; they are priced by log loss. We instantiate the theory with KT/Dirichlet finite-alphabet prediction and coarsened Bayesian linear-regression (BLR) predictive distributions. On Qwen2.5-7B/14B, floored candidate distributions at support 256 have one-step excess code lengths of 0.020/0.011 bits for Bernoulli and 0.039/0.022 bits for four-way categorical prediction, with candidate mass above 0.999; coarsened BLR continuations increasingly match the posterior-predictive digit distribution as support grows. A frequentist plug-in baseline sharpens the reading: the predictive distributions sit closer to the Bayesian posterior predictive than to the maximum-likelihood plug-in, by a margin largest at small support, where the plug-in is degenerate, and vanishing as the references converge. Position interventions and a from-scratch ablation localize order sensitivity to the positional encoding, activation patching tests causal use of decoded sufficient statistics, and permutation mixtures quantify the downstream log-loss cost of arbitrary orderings. Transformers need not realize exchangeable posterior predictives for every serialization to be Bayes-competitive prequential predictors.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 32 of its 37 references that are in the map. First posted on arXiv 15 Jul 2025.
Builds on
32 of 37 references.
References · 32
- 2017Attention Is All You Needcited by 60,361
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2021Training Verifiers to Solve Math Word Problemscited by 10,109
- 2020Measuring Massive Multitask Language Understandingcited by 7,963
- 2024Qwen2.5 Technical Reportcited by 4,942
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,754
- 2022Locating and Editing Factual Associations in GPTcited by 2,691
- 2022Beyond the Imitation Game: Quantifying and extrapolating the capabilities of language modelscited by 1,998
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,392
- 2018FEVER: a large-scale dataset for Fact Extraction and VERificationcited by 1,375
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,135
20 more
- 2018Self-Attention with Relative Position Representationscited by 1,120
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
- 2023Semantic Uncertainty: Linguistic Invariances for Uncertainty Estimation in Natural Language Generationcited by 819
- 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
- 2019Designing and Interpreting Probes with Control Taskscited by 640
- 2021Causal Abstractions of Neural Networkscited by 422
- 2021Transformers Can Do Bayesian Inferencecited by 360
- 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 327
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
- 2023A Survey of Confidence Estimation and Calibration in Large Language Modelscited by 256
- 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 222
- 2020Probing the Probing Paradigm: Does Probing Accuracy Entail Task Relevance?cited by 151
- 2021Inducing Causal Structure for Interpretable Neural Networkscited by 110
- 2024Is In-Context Learning in Large Language Models Bayesian? A Martingale Perspectivecited by 57
- 2024Contextual Position Encoding: Learning to Count What's Importantcited by 54
- 2024Bayes' Power for Explaining In-Context Learning Generalizationscited by 8
- 2024Can Generative AI Solve Your In-Context Learning Problem? A Martingale Perspectivecited by 2
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026When are likely answers right? On Sequence Probability and Correctness in LLMs
- 2025Don't Pass@k: A Bayesian Framework for Large Language Model Evaluation
- 2026Eliciting Numerical Predictive Distributions of LLMs Without Autoregression
- 2024Beyond the Black Box: A Statistical Model for LLM Reasoning and Inference
- 2025Large Language Models as Discounted Bayesian Filters
- 2026Bayesian Optimality of In-Context Learning with Selective State Spaces
- 2026Tracing LLM Behavior to the Training Data with Empirical Next-Token Distributions
- 2025Demystifying LLM-as-a-Judge: Analytically Tractable Model for Inference-Time Scaling