mlsanityData to 14 Oct 2026

Transformers Can Do Bayesian Inference

arXiv 2112.10510 ↗First posted 20 Dec 2021cs.LG stat.MLcited by 360

Not on the map. Why?

Abstract (arXiv)

Currently, it is hard to reap the benefits of deep learning for Bayesian methods, which allow the explicit specification of prior knowledge and accurately capture model uncertainty. We present Prior-Data Fitted Networks (PFNs). PFNs leverage in-context learning in large-scale machine learning techniques to approximate a large set of posteriors. The only requirement for PFNs to work is the ability to sample from a prior distribution over supervised learning tasks (or functions). Our method restates the objective of posterior approximation as a supervised classification problem with a set-valued input: it repeatedly draws a task (or function) from the prior, draws a set of data points and their labels from it, masks one of the labels and learns to make probabilistic predictions for it based on the set-valued input of the rest of the data points. Presented with a set of samples from a new supervised learning task as input, PFNs make probabilistic predictions for arbitrary other data points in a single forward propagation, having learned to approximate Bayesian inference. We demonstrate that PFNs can near-perfectly mimic Gaussian processes and also enable efficient Bayesian inference for intractable problems, with over 200-fold speedups in multiple setups compared to current methods. We obtain strong results in very diverse areas such as Gaussian process regression, Bayesian neural networks, classification for small tabular data sets, and few-shot image classification, demonstrating the generality of PFNs. Code and trained PFNs are released at https://github.com/automl/TransformersCanDoBayesianInference.

Key facts. Cited by 360 papers in the map (data through 14 Oct 2026). Builds on 40 of its 67 references that are in the map. First posted on arXiv 20 Dec 2021.

Builds on

40 of 67 references.

References · 40

  1. 2017Attention Is All You Needcited by 60,361
  2. 2015Deep Residual Learning for Image Recognitioncited by 52,096
  3. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  4. 2014Adam: A Method for Stochastic Optimizationcited by 37,240
  5. 2020Language Models are Few-Shot Learnerscited by 32,419
  6. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,305
  7. 2020A Simple Framework for Contrastive Learning of Visual Representationscited by 12,049
  8. 2016XGBoost: A Scalable Tree Boosting Systemcited by 5,166
  9. 2016SGDR: Stochastic Gradient Descent with Warm Restartscited by 5,045
  10. 2017Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networkscited by 4,897
  11. 2020Exploring Simple Siamese Representation Learningcited by 2,866
  12. 2019RandAugment: Practical automated data augmentation with a reduced search spacecited by 2,269
28 more
  1. 2018DARTS: Differentiable Architecture Searchcited by 1,798
  2. 2016Variational Inference: A Review for Statisticianscited by 1,472
  3. 2017Learning Transferable Architectures for Scalable Image Recognitioncited by 1,101
  4. 2019AugMix: A Simple Data Processing Method to Improve Robustness and Uncertaintycited by 901
  5. 2017A Distributional Perspective on Reinforcement Learningcited by 765
  6. 2016Stein Variational Gradient Descent: A General Purpose Bayesian Inference Algorithmcited by 507
  7. 2019The frontier of simulation-based inferencecited by 502
  8. 2018Conditional Neural Processescited by 426
  9. 2018Pyro: Deep Universal Probabilistic Programmingcited by 380
  10. 2018Neural Processescited by 311
  11. 2021What Are Bayesian Neural Network Posteriors Really Like?cited by 308
  12. 2019Attentive Neural Processescited by 283
  13. 2017One-Shot Visual Imitation Learning via Meta-Learningcited by 228
  14. 2018Neural Architecture Search with Bayesian Optimisation and Optimal Transportcited by 195
  15. 2018Bayesian Model-Agnostic Meta-Learningcited by 194
  16. 2021Benchmarking Simulation-Based Inferencecited by 162
  17. 2021Bayesian Neural Network Priors Revisitedcited by 121
  18. 2018Meta-Learning Probabilistic Inference For Predictioncited by 110
  19. 2019An Open Source AutoML Benchmarkcited by 85
  20. 2020PACOH: Bayes-Optimal Meta-Learning with PAC-Guaranteescited by 85
  21. 2017Meta-Learning by Adjusting Priors Based on Extended PAC-Bayes Theorycited by 76
  22. 2020Meta-Learning Stationary Stochastic Process Prediction with Convolutional Neural Processescited by 76
  23. 2019Meta-learning of Sequential Strategiescited by 70
  24. 2019BayesNAS: A Bayesian Approach for Neural Architecture Searchcited by 68
  25. 2020Neural Ensemble Search for Uncertainty Estimation and Dataset Shiftcited by 56
  26. 2018A Likelihood-Free Inference Framework for Population Genetic Data using Exchangeable Neural Networkscited by 31
  27. 2016Deep Amortized Inference for Probabilistic Programscited by 23
  28. 2017Analysis of dropout learning regarded as ensemble learningcited by 15

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2022: 9; 2023: 28; 2024: 61; 2025: 93; 2026: 169.

360 papers.

Sort:

By area:

  1. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
  2. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
  3. 2022TabPFN: A Transformer That Solves Small Tabular Classification Problems in a Secondcited by 674
  4. 2025TabICL: A Tabular Foundation Model for In-Context Learning on Large Datacited by 289
  5. 2023When Do Neural Nets Outperform Boosted Trees on Tabular Data?cited by 223
  6. 2023Embers of Autoregression: Understanding Large Language Models Through the Problem They are Trained to Solvecited by 178
  7. 2023Looped Transformers are Better at Learning Learning Algorithmscited by 149
  8. 2022Transformer Neural Processes: Uncertainty-Aware Meta Learning Via Sequence Modelingcited by 127
  9. 2024TabDPT: Scaling Tabular Foundation Models on Real Datacited by 113
  10. 2022General-Purpose In-Context Learning by Meta-Learning Transformerscited by 105
  11. 2023ForecastPFN: Synthetically-Trained Zero-Shot Forecastingcited by 104
  12. 2022Towards Learning Universal Hyperparameter Optimizers with Transformerscited by 81
38 more
  1. 2023PFNs4BO: In-Context Learning for Bayesian Optimizationcited by 73
  2. 2022Learning to Induce Causal Structurecited by 68
  3. 2023Statistical Foundations of Prior-Data Fitted Networkscited by 65
  4. 2023The No Free Lunch Theorem, Kolmogorov Complexity, and the Role of Inductive Biases in Machine Learningcited by 63
  5. 2024Position: Bayesian Deep Learning is Needed in the Age of Large-Scale AIcited by 62
  6. 2024Retrieval & Fine-Tuning for In-Context Tabular Modelscited by 59
  7. 2023In-Context Learning Learns Label Relationships but Is Not Conventional Learningcited by 51
  8. 2025Do-PFN: In-Context Learning for Causal Effect Estimationcited by 51
  9. 2025CausalPFN: Amortized Causal Effect Estimation via In-Context Learningcited by 49
  10. 2024TuneTables: Context Optimization for Scalable Prior-Data Fitted Networkscited by 47
  11. 2024Retrieval Augmented Time Series Forecastingcited by 46
  12. 2024Is Mamba Capable of In-Context Learning?cited by 45
  13. 2023Modeling rapid language learning by distilling Bayesian priors into artificial neural networkscited by 42
  14. 2022TACTiS: Transformer-Attentional Copulas for Time Seriescited by 38
  15. 2023Efficient Bayesian Learning Curve Extrapolation using Prior-Data Fitted Networkscited by 37
  16. 2025Representation Learning for Tabular Data: A Comprehensive Surveycited by 36
  17. 2024Mixture of In-Context Prompters for Tabular PFNscited by 33
  18. 2023End-to-End Meta-Bayesian Optimisation with Transformer Neural Processescited by 32
  19. 2025Foundation Models for Causal Inference via Prior-Data Fitted Networkscited by 32
  20. 2026Toto 2.0: Time Series Forecasting Enters the Scaling Eracited by 30
  21. 2025TimePFN: Effective Multivariate Time Series Forecasting with Synthetic Datacited by 29
  22. 2024TabPFGen -- Tabular Data Generation with TabPFNcited by 28
  23. 2023Emergence of In-Context Reinforcement Learning from Noise Distillationcited by 27
  24. 2024In-Context Freeze-Thaw Bayesian Optimization for Hyperparameter Optimizationcited by 26
  25. 2024Drift-Resilient TabPFN: In-Context Learning Temporal Distribution Shifts on Tabular Datacited by 25
  26. 2023Neuralizer: General Neuroimage Analysis without Re-Trainingcited by 24
  27. 2023From Supervised to Generative: A Novel Paradigm for Tabular Deep Learning with Large Language Modelscited by 24
  28. 2024Learning Syntax Without Planting Trees: Understanding Hierarchical Generalization in Transformerscited by 24
  29. 2024Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyondcited by 24
  30. 2024In-context Time Series Predictorcited by 23
  31. 2024Amortized Probabilistic Conditioning for Optimization, Simulation and Inferencecited by 23
  32. 2023ExPT: Synthetic Pretraining for Few-Shot Experimental Designcited by 22
  33. 2023A General Framework for User-Guided Bayesian Optimizationcited by 22
  34. 2023Context-Aware Meta-Learningcited by 21
  35. 2024Position: Leverage Foundational Models for Black-Box Optimizationcited by 21
  36. 2024Amortized Bayesian Experimental Design for Decision-Makingcited by 21
  37. 2025GraphPFN: A Prior-Data Fitted Graph Foundation Modelcited by 21
  38. 2024Estimating the Hallucination Rate of Generative AIcited by 20

50 most cited of 360 All 360 (JSON)