Bayesian Deep Learning and a Probabilistic Perspective of Generalization

Andrew Gordon Wilson, Pavel IzmailovarXiv 2020

Abstract

The key distinguishing property of a Bayesian approach is marginalization, rather than using a single setting of weights. Bayesian marginalization can particularly improve the accuracy and calibration of modern deep neural networks, which are typically underspecified by the data, and can represent many compelling but different solutions. We show that deep ensembles provide an effective mechanism for approximate Bayesian marginalization, and propose a related approach that further improves the predictive distribution by marginalizing within basins of attraction, without significant overhead. We also investigate the prior over functions implied by a vague distribution over neural network weights, explaining the generalization properties of such models from a probabilistic perspective. From this perspective, we explain results that have been presented as mysterious and distinct to neural network generalization, such as the ability to fit images with random labels, and show that these results can be reproduced with Gaussian processes. We also show that Bayesian model averaging alleviates double descent, resulting in monotonic performance improvements with increased flexibility. Finally, we provide a Bayesian perspective on tempering for calibrating predictive distributions.

Introduction

In classical statistics, we are taught that models with too many parameters will overfit. Yet, modern deep learning involves models with millions of parameters fitting relatively small datasets, often achieving excellent generalization. This creates a paradox: why don't these massive networks just memorize the noise? Furthermore, recent research has highlighted "mysterious" behaviors, such as the ability of neural networks to perfectly fit images with random labels and the "double descent" phenomenon where test error increases and then decreases again as model complexity grows. This paper addresses these questions by moving away from "parameter counting" and toward a probabilistic perspective of model support and inductive bias.

Bayesian Model Averaging and MultiSWAG

The core of the paper is Bayesian Model Averaging (BMA). Instead of finding a single "best" set of weights $w$ (optimization), BMA integrates over the entire posterior distribution of weights: $$p(y|x, \mathcal{D}) = \int p(y|x, w)p(w|\mathcal{D})dw$$

Key methodological contributions include:

  • Deep Ensembles as BMA: The authors argue that deep ensembles (training the same architecture multiple times with different seeds) are a practical way to sample from different "basins of attraction" in the posterior.
  • MultiSWAG: They propose a hybrid approach. While deep ensembles capture different basins, they don't account for the local geometry within a basin. MultiSWAG combines multiple independently trained SWAG (SWA-Gaussian) models. Each SWAG model approximates the posterior within one basin as a Gaussian, and MultiSWAG averages across these Gaussians to capture both between-basin and within-basin uncertainty.

A Probabilistic Framework for Generalization

The authors define generalization using two dimensions: Support (the range of datasets a model can fit) and Inductive Bias (the prior probability assigned to those datasets).

Conceptual view of generalization through support and inductive bias.

From this perspective, the "random label" mystery is solved. The fact that CNNs can fit random labels indicates wide support, but the marginal likelihood (evidence) is much lower for random labels than for real ones, showing the model "prefers" structured data. Generalization depends on where the model puts its prior mass, not just how many weights it has.

Key Results

The authors evaluate their claims using standard image classification benchmarks (CIFAR-10/100, MNIST) and regression tasks.

  • Eliminating Double Descent: The authors show that while standard SGD training suffers from double descent, Bayesian Model Averaging (via MultiSWAG) results in monotonic improvement. As the model gets wider and more flexible, BMA performance only gets better.
  • Robustness to Corruption: MultiSWAG significantly outperforms deep ensembles and standard SGD on CIFAR-10 with Gaussian blur corruption, especially when the number of available models is small.
Performance of MultiSWAG vs. baselines on corrupted data.

Conclusion

This work demonstrates that generalization in deep learning is best understood through the lens of Bayesian marginalization. By averaging over multiple basins of attraction and local geometries, methods like MultiSWAG provide superior calibration and robustness, resolving several apparent paradoxes in modern deep learning theory.

Summary updated

BibTeX
@misc{wilson2020bayesian,
  author = {Andrew Gordon Wilson and Pavel Izmailov},
  title = {{Bayesian Deep Learning and a Probabilistic Perspective of Generalization}},
  year = {2020},
  eprint = {2002.08791},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.08791},
}
Figure