Pathologies in priors and inference for Bayesian transformers
Not on the map. Why?
Abstract (arXiv)
In recent years, the transformer has established itself as a workhorse in many applications ranging from natural language processing to reinforcement learning. Similarly, Bayesian deep learning has become the gold-standard for uncertainty estimation in safety-critical applications, where robustness and calibration are crucial. Surprisingly, no successful attempts to improve transformer models in terms of predictive uncertainty using Bayesian inference exist. In this work, we study this curiously underpopulated area of Bayesian transformers. We find that weight-space inference in transformers does not work well, regardless of the approximate posterior. We also find that the prior is at least partially at fault, but that it is very hard to find well-specified weight priors for these models. We hypothesize that these problems stem from the complexity of obtaining a meaningful mapping from weight-space to function-space distributions in the transformer. Therefore, moving closer to function-space, we propose a novel method based on the implicit reparameterization of the Dirichlet distribution to apply variational inference directly to the attention weights. We find that this proposed method performs competitively with our baselines.
Key facts. Cited by 13 papers in the map (data through 14 Oct 2026). Builds on 48 of its 69 references that are in the map. First posted on arXiv 8 Oct 2021.
Builds on
48 of 69 references.
References · 48
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2014Adam: A Method for Stochastic Optimizationcited by 37,240
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2017On Calibration of Modern Neural Networkscited by 4,960
- 2015Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learningcited by 4,448
- 2016Simple and Scalable Predictive Uncertainty Estimation using Deep Ensemblescited by 3,926
- 2016Gaussian Error Linear Units (GELUs)cited by 3,502
- 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,546
- 2021Segmenter: Transformer for Semantic Segmentationcited by 855
- 2021VideoGPT: Video Generation using VQ-VAE and Transformerscited by 658
36 more
- 2021AST: Audio Spectrogram Transformercited by 643
- 2015Weight Uncertainty in Neural Networkscited by 554
- 2015Variational Dropout and the Local Reparameterization Trickcited by 490
- 2020Bayesian Deep Learning and a Probabilistic Perspective of Generalizationcited by 480
- 2014Stochastic Gradient Hamiltonian Monte Carlocited by 343
- 2020Visual Transformers: Token-based Image Representation and Processing for Computer Visioncited by 334
- 2021What Are Bayesian Neural Network Posteriors Really Like?cited by 308
- 2020Being Bayesian, Even Just a Bit, Fixes Overconfidence in ReLU Networkscited by 231
- 2017Concrete Dropoutcited by 227
- 2019Cyclical Stochastic Gradient MCMC for Bayesian Deep Learningcited by 203
- 2020Efficient and Scalable Bayesian Neural Nets with Rank-1 Factorscited by 171
- 2021TransGAN: Two Pure Transformers Can Make One Strong GAN, and That Can Scale Upcited by 162
- 2017Multiplicative Normalizing Flows for Variational Bayesian Neural Networkscited by 157
- 2018Flipout: Efficient Pseudo-Independent Weight Perturbations on Mini-Batchescited by 133
- 2021Bayesian Neural Network Priors Revisitedcited by 121
- 2021Scalable Marginal Likelihood Estimation for Model Selection in Deep Learningcited by 106
- 2021Repulsive Deep Ensembles are Bayesiancited by 104
- 2021Priors in Bayesian Deep Learning: A Reviewcited by 101
- 2018Uncertainty in Neural Networks: Approximately Bayesian Ensemblingcited by 94
- 2020Bayesian Deep Learning via Subnetwork Inferencecited by 87
- 2018Implicit Reparameterization Gradientscited by 85
- 2016Structured and Efficient Variational Deep Learning with Matrix Gaussian Posteriorscited by 82
- 2018Bayesian Layers: A Module for Neural Network Uncertaintycited by 57
- 2020Bayesian Attention Modulescited by 51
- 2019Dirichlet Variational Autoencodercited by 43
- 2018Latent Alignment and Variational Attentioncited by 36
- 2018SLANG: Fast Structured Covariance Approximations for Bayesian Deep Learning with Natural Gradientcited by 34
- 2021Exact Langevin Dynamics with Stochastic Gradientscited by 30
- 2017Variational Attention for Sequence-to-Sequence Modelscited by 29
- 2021Bayesian Transformer Language Models for Speech Recognitioncited by 22
- 2021On Stein Variational Neural Network Ensemblescited by 21
- 2021BNNpriors: A library for Bayesian neural network inference with different prior distributionscited by 20
- 2019On the Validity of Bayesian Neural Networks for Uncertainty Estimationcited by 14
- 2020Adaptive Transformers in RLcited by 13
- 2020Repulsive Attention: Rethinking Multi-head Attention as Bayesian Inferencecited by 13
- 2020The Monte Carlo Transformer: a stochastic self-attention model for sequence predictioncited by 6
Built on by
Citing papers per year: 2023: 2; 2024: 5; 2025: 5; 2026: 1.
13 papers.
Sort:
By area:
- 2023Bayesian Low-rank Adaptation for Large Language Modelscited by 115
- 2024BLoB: Bayesian Low-Rank Adaptation by Backpropagation for Large Language Modelscited by 50
- 2024Uncertainty quantification in fine-tuned LLMs using LoRA ensemblescited by 37
- 2023Calibrating Transformers via Sparse Gaussian Processescited by 21
- 2024Gaussian Stochastic Weight Averaging for Bayesian Low-Rank Adaptation of Large Language Modelscited by 20
- 2025Revisiting Kernel Attention with Correlated Gaussian Process Representationcited by 10
- 2025Bridging Kolmogorov Complexity and Deep Learning: Asymptotically Optimal Description Length Objectives for Transformerscited by 6
- 2024Self-Attention through Kernel-Eigen Pair Sparse Variational Gaussian Processescited by 5
- 2025Comparing Uncertainty Measurement and Mitigation Methods for Large Language Models: A Systematic Reviewcited by 4
- 2025Bayesian Mixture of Experts For Large Language Modelscited by 4
- 2024Regularized KL-Divergence for Well-Defined Function-Space Variational Inference in Bayesian neural networkscited by 3
- 2025Variational Deep Learning via Implicit Regularizationcited by 0
1 more
- 2026Soft Specialists: α-R'enyi Ensembles for Uncertainty-Aware LLM Post-Training26 May 2026
- 2025Bayesian Mixture of Experts For Large Language Models12 Nov 2025
- 2025Bridging Kolmogorov Complexity and Deep Learning: Asymptotically Optimal Description Length Objectives for Transformers26 Sep 2025
- 2025Variational Deep Learning via Implicit Regularization26 May 2025
- 2025Comparing Uncertainty Measurement and Mitigation Methods for Large Language Models: A Systematic Review25 Apr 2025
- 2025Revisiting Kernel Attention with Correlated Gaussian Process Representation27 Feb 2025
- 2024BLoB: Bayesian Low-Rank Adaptation by Backpropagation for Large Language Models17 Jun 2024
- 2024Regularized KL-Divergence for Well-Defined Function-Space Variational Inference in Bayesian neural networks6 Jun 2024
- 2024Gaussian Stochastic Weight Averaging for Bayesian Low-Rank Adaptation of Large Language Models6 May 2024
- 2024Uncertainty quantification in fine-tuned LLMs using LoRA ensembles19 Feb 2024
- 2024Self-Attention through Kernel-Eigen Pair Sparse Variational Gaussian Processes2 Feb 2024
- 2023Bayesian Low-rank Adaptation for Large Language Models24 Aug 2023
1 more
- 2023Calibrating Transformers via Sparse Gaussian Processes4 Mar 2023
- 2025Bayesian Mixture of Experts For Large Language Modelscited by 4
- 2025Bayesian Mixture of Experts For Large Language Models12 Nov 2025
- 2023Bayesian Low-rank Adaptation for Large Language Modelscited by 115
- 2024BLoB: Bayesian Low-Rank Adaptation by Backpropagation for Large Language Modelscited by 50
- 2024Uncertainty quantification in fine-tuned LLMs using LoRA ensemblescited by 37
- 2023Calibrating Transformers via Sparse Gaussian Processescited by 21
- 2024Gaussian Stochastic Weight Averaging for Bayesian Low-Rank Adaptation of Large Language Modelscited by 20
- 2025Revisiting Kernel Attention with Correlated Gaussian Process Representationcited by 10
- 2025Bridging Kolmogorov Complexity and Deep Learning: Asymptotically Optimal Description Length Objectives for Transformerscited by 6
- 2024Self-Attention through Kernel-Eigen Pair Sparse Variational Gaussian Processescited by 5
- 2025Comparing Uncertainty Measurement and Mitigation Methods for Large Language Models: A Systematic Reviewcited by 4
- 2024Regularized KL-Divergence for Well-Defined Function-Space Variational Inference in Bayesian neural networkscited by 3
- 2025Variational Deep Learning via Implicit Regularizationcited by 0
- 2026Soft Specialists: α-R'enyi Ensembles for Uncertainty-Aware LLM Post-Trainingcited by 0
- 2026Soft Specialists: α-R'enyi Ensembles for Uncertainty-Aware LLM Post-Training26 May 2026
- 2025Bridging Kolmogorov Complexity and Deep Learning: Asymptotically Optimal Description Length Objectives for Transformers26 Sep 2025
- 2025Variational Deep Learning via Implicit Regularization26 May 2025
- 2025Comparing Uncertainty Measurement and Mitigation Methods for Large Language Models: A Systematic Review25 Apr 2025
- 2025Revisiting Kernel Attention with Correlated Gaussian Process Representation27 Feb 2025
- 2024BLoB: Bayesian Low-Rank Adaptation by Backpropagation for Large Language Models17 Jun 2024
- 2024Regularized KL-Divergence for Well-Defined Function-Space Variational Inference in Bayesian neural networks6 Jun 2024
- 2024Gaussian Stochastic Weight Averaging for Bayesian Low-Rank Adaptation of Large Language Models6 May 2024
- 2024Uncertainty quantification in fine-tuned LLMs using LoRA ensembles19 Feb 2024
- 2024Self-Attention through Kernel-Eigen Pair Sparse Variational Gaussian Processes2 Feb 2024
- 2023Bayesian Low-rank Adaptation for Large Language Models24 Aug 2023
- 2023Calibrating Transformers via Sparse Gaussian Processes4 Mar 2023