Transformers Can Learn Posterior Predictive Distributions In-Context
Not on the map. Why?
Abstract (arXiv)
Prior-data fitted networks (PFNs) have recently emerged as a powerful approach for Bayesian prediction tasks, approximating the posterior predictive distribution (PPD) through in-context learning. Despite their strong empirical performance and ability to go beyond point predictions, theoretical understandings of the algorithmic capability of transformers to learn distributions in context are still lacking. Focusing on Gaussian process regression problems, we show by construction that transformers can implement a gradient descent algorithm targeting the posterior predictive mean and variance, followed by nonlinear mappings that yield binned probabilities of PPD. We study the error bounds of the approximated PPD in terms of attention depth and bin resolution. Based on these results, we further demonstrate the key role of normalization and the choice of attention depth in enabling the extrapolation abilities of transformers beyond the pretraining sample size range. We conduct simulations that corroborate our findings, providing insight into the expressivity of PFNs targeting PPDs and how architectural choices may influence generalization capabilities.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 25 of its 49 references that are in the map. First posted on arXiv 26 May 2026.
Builds on
25 of 49 references.
References · 25
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Transformers learn in-context by gradient descentcited by 714
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2022TabPFN: A Transformer That Solves Small Tabular Classification Problems in a Secondcited by 643
- 2021Transformers Can Do Bayesian Inferencecited by 338
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
- 2025TabICL: A Tabular Foundation Model for In-Context Learning on Large Datacited by 267
- 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 168
13 more
- 2025TabPFN-2.5: Advancing the State of the Art in Tabular Foundation Modelscited by 115
- 2023PFNs4BO: In-Context Learning for Bayesian Optimizationcited by 70
- 2023Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Contextcited by 63
- 2019Rates of Convergence for Sparse Variational Gaussian Process Regressioncited by 62
- 2023Statistical Foundations of Prior-Data Fitted Networkscited by 59
- 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 47
- 2024TuneTables: Context Optimization for Scalable Prior-Data Fitted Networkscited by 47
- 2016Preconditioning Kernel Matricescited by 32
- 2024Linear Transformers are Versatile In-Context Learnerscited by 28
- 2025Position: The Future of Bayesian Prediction Is Prior-Fittedcited by 19
- 2025TabPFN: One Model to Rule Them All?cited by 10
- 2025Prior-Fitted Networks Scale to Larger Datasets When Treated as Weak Learnerscited by 7
- 2025GIT-BO: High-Dimensional Bayesian Optimization with Tabular Foundation Modelscited by 3
Built on by
Not cited yet.