What Are Bayesian Neural Network Posteriors Really Like?

Pavel Izmailov, Sharad Vikram, Matthew D. Hoffman, Andrew Gordon Wilson
4/29/2021
cs.LGstat.ML

Official code: google-research/google-research (39,000 stars, Apache-2.0, last commit 2026-04-30).

Abstract

The posterior over Bayesian neural network (BNN) parameters is extremely high-dimensional and non-convex. For computational reasons, researchers approximate this posterior using inexpensive mini-batch methods such as mean-field variational inference or stochastic-gradient Markov chain Monte Carlo (SGMCMC). To investigate foundational questions in Bayesian deep learning, we instead use full-batch Hamiltonian Monte Carlo (HMC) on modern architectures. We show that (1) BNNs can achieve significant performance gains over standard training and deep ensembles; (2) a single long HMC chain can provide a comparable representation of the posterior to multiple shorter chains; (3) in contrast to recent studies, we find posterior tempering is not needed for near-optimal performance, with little evidence for a "cold posterior" effect, which we show is largely an artifact of data augmentation; (4) BMA performance is robust to the choice of prior scale, and relatively similar for diagonal Gaussian, mixture of Gaussian, and logistic priors; (5) Bayesian neural networks show surprisingly poor generalization under domain shift; (6) while cheaper alternatives such as deep ensembles and SGMCMC methods can provide good generalization, they provide distinct predictive distributions from HMC. Notably, deep ensemble predictive distributions are similarly close to HMC as standard SGLD, and closer than standard variational inference.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Google Research

39,0008,488C, ROct 4, 20185 months agoApache-2.0
aimachine-learningresearch

Cite this paper

@article{izmailov2021what,
  title  = {What Are Bayesian Neural Network Posteriors Really Like?},
  author = {Pavel Izmailov and Sharad Vikram and Matthew D. Hoffman and Andrew Gordon Wilson},
  year   = {2021},
  eprint = {2104.14421},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2104.14421}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2104.14421.svg)](https://codeofpaper.com/paper/2104.14421)

Discussion