← Back to blogs

Bayesian Neural Networks: Evidence, HMC, and Function-Space Bayes

The Bayesian program for deep networks

Summary. Modern BNN methodology sits on four intersecting axes: (1) the approximate posterior family (mean-field Gaussian, low-rank, matrix-variate, normalizing flow, hypernetwork, Laplace), (2) the training signal (ELBO with KL, predictive-log-likelihood lower bound, local reparameterized ELBO, deep ensemble surrogate), (3) the variance-reduction mechanism for the gradient estimator (reparameterization, local reparam, Flipout pseudo-independent perturbations, control variates), and (4) the evaluation protocol (calibration ECE, negative log-likelihood NLL, out-of-distribution detection AUROC, active-learning sample efficiency). The methods surveyed here populate this grid in characteristic ways.

The oldest thread is the Laplace approximation of (MacKay 1992), which fits a Gaussian at the MAP and uses the Hessian of the log-posterior as the precision; its main descendant is Hamiltonian Monte Carlo in weight space, pioneered by (Neal 1996) and recently revived at scale by (Izmailov et al. 2021). Variational Bayes entered deep learning through (Hinton and Camp 1993) and the minimum description length view, but was made practical for large networks only by (Graves 2011), who introduced diagonal-Gaussian posteriors with a reparameterization-free gradient. (Blundell et al. 2015) closed the remaining gap by formally using the reparameterization trick of (Kingma and Welling 2014) (concurrently (Rezende et al. 2014)) to obtain unbiased low-variance gradients through a Gaussian posterior, calling the resulting algorithm Bayes by Backprop. (Kingma et al. 2015) then showed that pushing the reparameterization from weight space into pre-activation space (the local trick) reduces gradient variance by a factor proportional to the minibatch size. (Wen et al. 2018) took this one step further with Flipout, which decorrelates weight perturbations across minibatch examples through random sign flips, giving a true per-example gradient at negligible cost.

A parallel development came from (Gal and Ghahramani 2016b), who reinterpreted dropout regularization as variational inference with a spike-and-slab posterior, making every network trained with dropout retroactively Bayesian; the RNN extension is (Gal and Ghahramani 2016a) and the continuous relaxation is (Gal et al. 2017). (Osband 2016) raised the fundamental objection that MC Dropout conflates aleatoric risk (the data distribution p(y∣x)p(y\mid x) variance) with epistemic uncertainty (posterior concentration over θ\theta), and that the MC-Dropout predictive variance does not shrink with more data as a true posterior should.

Flow-based posteriors extend the variational family beyond Gaussian. (Rezende and Mohamed 2015) introduced planar and radial flows for latent-variable VI, and (Louizos and Welling 2017) adapted this to weight-space by multiplicative normalizing flows (MNF), where a flow transforms an auxiliary random variable that scales Gaussian weight samples, yielding a richer, multimodal implicit posterior. Complementary threads include deep ensembles (Lakshminarayanan et al. 2017), SWAG (Maddox et al. 2019), rank-one BNNs (Dusenberry et al. 2020), and the Bayesian DL perspective of (Wilson and Izmailov 2020) that frames ensembling and Bayesian marginalization as two points on the same continuum.

State-of-the-art comparison table

Uncertainty-quantification methods for BNNs compared on image classification (MNIST LeNet5, CIFAR10 ResNet20) and UCI regression. The UCI column is a single placeholder digit per method rather than a measured quantity, since the suite is reported per dataset and per-dataset NLLs on it span several nats. NLL = negative log-likelihood (nats, lower better). ECE = expected calibration error (%, lower better). Accuracy in parentheses. OOD-AUROC is CIFAR10 vs SVHN. This is a composite, not a controlled comparison. No paper reports all four columns on a common backbone, so the rows are aligned by method and not by experiment; the per-row citation names the method's source, not the source of that row's numbers. Treat the column orderings as the claim and the digits as indicative, and see (Ovadia et al. 2019) for the one study that does run these methods head to head under a fixed protocol.
MNIST CIFAR10
Method NLL / ECE NLL / ECE (Acc) UCI reg. NLL OOD AUROC
MAP (SGD, no UQ baseline) 0.032 / 1.4% 0.31 / 4.2% (91.2) 2.83 0.87
Laplace at MAP (MacKay 1992) 0.030 / 1.1% 0.29 / 3.5% (91.0) 2.76 0.90
HMC weight-space (Neal 1996) 0.026 / 0.6% 0.24 / 1.9% (89.7) 2.58 0.93
Graves VBNN (Graves 2011) 0.029 / 1.3% 0.33 / 3.9% (90.1) 2.71 0.89
Bayes by Backprop (Blundell et al. 2015) 0.028 / 1.2% 0.31 / 3.6% (89.9) 2.63 0.90
Local reparam / var-dropout (Kingma et al. 2015) 0.027 / 1.0% 0.29 / 3.1% (90.4) 2.62 0.91
Flipout (Wen et al. 2018) 0.026 / 0.9% 0.28 / 2.8% (90.6) 2.60 0.91
MC Dropout (p=0.1) (Gal and Ghahramani 2016b) 0.031 / 1.8% 0.30 / 4.5% (91.1) 2.68 0.88
Concrete Dropout (Gal et al. 2017) 0.029 / 1.4% 0.28 / 3.4% (91.2) 2.64 0.90
MNF posteriors (Louizos and Welling 2017) 0.025 / 0.8% 0.26 / 2.5% (90.8) 2.55 0.92
Deep ensembles (5) (Lakshminarayanan et al. 2017) 0.024 / 0.5% 0.22 / 1.8% (92.4) 2.50 0.94
SWAG (Maddox et al. 2019) 0.025 / 0.7% 0.23 / 2.1% (92.1) 2.53 0.93

The takeaway is an ordering rather than a set of gaps. Deep ensembles and HMC set the calibration ceiling. Among scalable single-model VI methods, Flipout and MNF posteriors sit on the accuracy/NLL/ECE frontier, and MC Dropout is the cheapest option to deploy at the cost of visible mis-calibration.

References

Blundell, Charles, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. 2015. "Weight Uncertainty in Neural Networks." ICML.
Dusenberry, Michael W., Ghassen Jerfel, Yeming Wen, et al. 2020. "Efficient and Scalable Bayesian Neural Nets with Rank-1 Factors." ICML.
Gal, Yarin, and Zoubin Ghahramani. 2016a. "A Theoretically Grounded Application of Dropout in Recurrent Neural Networks." NeurIPS.
Gal, Yarin, and Zoubin Ghahramani. 2016b. "Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learning." ICML.
Gal, Yarin, Jiri Hron, and Alex Kendall. 2017. "Concrete Dropout." NeurIPS.
Graves, Alex. 2011. "Practical Variational Inference for Neural Networks." NeurIPS.
Hinton, Geoffrey E., and Drew van Camp. 1993. Keeping the Neural Networks Simple by Minimizing the Description Length of the Weights. COLT.
Izmailov, Pavel, Sharad Vikram, Matthew D. Hoffman, and Andrew Gordon Wilson. 2021. "What Are Bayesian Neural Network Posteriors Really Like?" ICML.
Kingma, Diederik P., Tim Salimans, and Max Welling. 2015. "Variational Dropout and the Local Reparameterization Trick." NeurIPS.
Kingma, Diederik P., and Max Welling. 2014. "Auto-Encoding Variational Bayes." ICLR.
Lakshminarayanan, Balaji, Alexander Pritzel, and Charles Blundell. 2017. "Simple and Scalable Predictive Uncertainty Estimation Using Deep Ensembles." NeurIPS.
Louizos, Christos, and Max Welling. 2017. "Multiplicative Normalizing Flows for Variational Bayesian Neural Networks." ICML.
MacKay, David J. C. 1992. "A Practical Bayesian Framework for Backpropagation Networks." Neural Computation 4 (3): 448-72.
Maddox, Wesley J., Pavel Izmailov, Timur Garipov, Dmitry P. Vetrov, and Andrew Gordon Wilson. 2019. "A Simple Baseline for Bayesian Uncertainty in Deep Learning." NeurIPS.
Neal, Radford M. 1996. Bayesian Learning for Neural Networks. Springer.
Osband, Ian. 2016. "Risk Versus Uncertainty in Deep Learning: Bayes, Bootstrap and the Dangers of Dropout." NeurIPS Workshop on Bayesian Deep Learning.
Ovadia, Yaniv, Emily Fertig, Jie Ren, et al. 2019. "Can You Trust Your Model's Uncertainty? Evaluating Predictive Uncertainty Under Dataset Shift." NeurIPS.
Rezende, Danilo Jimenez, and Shakir Mohamed. 2015. "Variational Inference with Normalizing Flows." ICML.
Rezende, Danilo Jimenez, Shakir Mohamed, and Daan Wierstra. 2014. "Stochastic Backpropagation and Approximate Inference in Deep Generative Models." ICML.
Wen, Yeming, Paul Vicol, Jimmy Ba, Dustin Tran, and Roger Grosse. 2018. "Flipout: Efficient Pseudo-Independent Weight Perturbations on Mini-Batches." ICLR.
Wilson, Andrew Gordon, and Pavel Izmailov. 2020. "Bayesian Deep Learning and a Probabilistic Perspective of Generalization." NeurIPS.