mlsanityData to 14 Oct 2026

Pathologies in priors and inference for Bayesian transformers

arXiv 2110.04020 ↗First posted 8 Oct 2021cs.LG stat.MLcited by 13

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

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2014Adam: A Method for Stochastic Optimizationcited by 37,240
  4. 2020Language Models are Few-Shot Learnerscited by 32,419
  5. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
  6. 2017On Calibration of Modern Neural Networkscited by 4,960
  7. 2015Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learningcited by 4,448
  8. 2016Simple and Scalable Predictive Uncertainty Estimation using Deep Ensemblescited by 3,926
  9. 2016Gaussian Error Linear Units (GELUs)cited by 3,502
  10. 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,546
  11. 2021Segmenter: Transformer for Semantic Segmentationcited by 855
  12. 2021VideoGPT: Video Generation using VQ-VAE and Transformerscited by 658
36 more
  1. 2021AST: Audio Spectrogram Transformercited by 643
  2. 2015Weight Uncertainty in Neural Networkscited by 554
  3. 2015Variational Dropout and the Local Reparameterization Trickcited by 490
  4. 2020Bayesian Deep Learning and a Probabilistic Perspective of Generalizationcited by 480
  5. 2014Stochastic Gradient Hamiltonian Monte Carlocited by 343
  6. 2020Visual Transformers: Token-based Image Representation and Processing for Computer Visioncited by 334
  7. 2021What Are Bayesian Neural Network Posteriors Really Like?cited by 308
  8. 2020Being Bayesian, Even Just a Bit, Fixes Overconfidence in ReLU Networkscited by 231
  9. 2017Concrete Dropoutcited by 227
  10. 2019Cyclical Stochastic Gradient MCMC for Bayesian Deep Learningcited by 203
  11. 2020Efficient and Scalable Bayesian Neural Nets with Rank-1 Factorscited by 171
  12. 2021TransGAN: Two Pure Transformers Can Make One Strong GAN, and That Can Scale Upcited by 162
  13. 2017Multiplicative Normalizing Flows for Variational Bayesian Neural Networkscited by 157
  14. 2018Flipout: Efficient Pseudo-Independent Weight Perturbations on Mini-Batchescited by 133
  15. 2021Bayesian Neural Network Priors Revisitedcited by 121
  16. 2021Scalable Marginal Likelihood Estimation for Model Selection in Deep Learningcited by 106
  17. 2021Repulsive Deep Ensembles are Bayesiancited by 104
  18. 2021Priors in Bayesian Deep Learning: A Reviewcited by 101
  19. 2018Uncertainty in Neural Networks: Approximately Bayesian Ensemblingcited by 94
  20. 2020Bayesian Deep Learning via Subnetwork Inferencecited by 87
  21. 2018Implicit Reparameterization Gradientscited by 85
  22. 2016Structured and Efficient Variational Deep Learning with Matrix Gaussian Posteriorscited by 82
  23. 2018Bayesian Layers: A Module for Neural Network Uncertaintycited by 57
  24. 2020Bayesian Attention Modulescited by 51
  25. 2019Dirichlet Variational Autoencodercited by 43
  26. 2018Latent Alignment and Variational Attentioncited by 36
  27. 2018SLANG: Fast Structured Covariance Approximations for Bayesian Deep Learning with Natural Gradientcited by 34
  28. 2021Exact Langevin Dynamics with Stochastic Gradientscited by 30
  29. 2017Variational Attention for Sequence-to-Sequence Modelscited by 29
  30. 2021Bayesian Transformer Language Models for Speech Recognitioncited by 22
  31. 2021On Stein Variational Neural Network Ensemblescited by 21
  32. 2021BNNpriors: A library for Bayesian neural network inference with different prior distributionscited by 20
  33. 2019On the Validity of Bayesian Neural Networks for Uncertainty Estimationcited by 14
  34. 2020Adaptive Transformers in RLcited by 13
  35. 2020Repulsive Attention: Rethinking Multi-head Attention as Bayesian Inferencecited by 13
  36. 2020The Monte Carlo Transformer: a stochastic self-attention model for sequence predictioncited by 6

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 2; 2024: 5; 2025: 5; 2026: 1.

13 papers.

Sort:

By area: