Bayesian Neural Network Ensembles

Tim Pearce, Mohamed Zaki, Andy NeelyarXiv 2018

Introduction

Quantifying uncertainty is critical for deploying deep learning in high-stakes environments. While Bayesian Neural Networks (BNNs) provide a principled framework for this, they are notoriously difficult to scale and implement. On the other hand, simple ensembles—training multiple models with different initializations—work surprisingly well in practice but have historically lacked a formal Bayesian justification. This paper introduces a simple yet theoretically grounded way to bridge this gap, turning standard neural network ensembles into "Bayesian" ones.

Methods: Randomized MAP Sampling

The core contribution is a technique called Randomised MAP Sampling. In standard training, L2 regularization encourages weights to stay near zero, which is equivalent to finding the Maximum A Posteriori (MAP) estimate with a prior centered at zero. The authors propose a modified ensembling scheme using an anchored loss function:

$$Loss_{anchor} = \frac{1}{N} ||y - \hat{y}||^2_2 + \frac{1}{N} ||\Gamma^{1/2}(\theta - \theta_0)||^2_2$$

In this formulation:

  • $\theta$: The current network parameters.
  • $\theta_0$: A random vector drawn from the prior distribution ($N(\mu_{prior}, \Sigma_{prior})$) at the start of training for each ensemble member.
  • $\Gamma$: A regularization matrix representing the ratio of data noise to prior variance.

Instead of pulling weights toward zero, each ensemble member is "anchored" to a different random point drawn from the prior. The authors prove that for "wide" neural networks, this simple trick allows the ensemble to approximate the Bayesian posterior without the need for expensive Markov Chain Monte Carlo (MCMC) or complex Variational Inference (VI).

Key Insights

  • The "Wide NN" Simplification: As a network gets wider ($H \to \infty$), the complex relationship between the likelihood and the prior simplifies. This allows the method to ignore difficult-to-calculate likelihood covariance and use the prior distribution to set the "anchor" noise.
  • Predictive vs. Parameter Space: While mapping a complex parameter posterior might require thousands of samples, the authors argue that for the predictive distribution (the output), a small ensemble of 5–10 networks is often sufficient.
  • Better Interpolation: Unlike popular methods like MC Dropout or Variational Inference, which often fail to account for correlations between parameters, the anchored ensemble captures uncertainty in interpolated regions much more effectively, mimicking the behavior of Gaussian Processes.

Evaluation and Results

The authors evaluated their method on toy regression problems to visualize predictive distributions and on ten UCI benchmark datasets (e.g., Boston Housing, Concrete, Wine) to compare Root Mean Square Error (RMSE) and Negative Log-Likelihood (NLL) against state-of-the-art Deep Ensembles.

Qualitative comparison of predictive distributions across different methods. "Our Method" closely matches the gold-standard GP and HMC.

Qualitative Excellence

In toy problems, the anchored ensemble produced predictive distributions that closely matched the "Gold Standard" Gaussian Processes (GP) and Hamiltonian Monte Carlo (HMC). It captured the "wavy" nature of the true posterior significantly better than MC Dropout or VI, which often produced overly smooth or poorly calibrated uncertainty estimates.

Superior Benchmarks

On the UCI datasets, the Bayesian Ensemble consistently outperformed standard Deep Ensembles. This was particularly evident in datasets where epistemic uncertainty (uncertainty due to lack of data) was the primary factor.

Quantitative performance (RMSE and NLL) on UCI regression benchmarks. Bold values indicate the best performing method.

Limitations and Future Work

While the method is highly efficient—requiring no more computational power than standard ensembling—the authors noted a slight tendency to over-predict variance in some scenarios. Current work focuses on extending this theory from single-layer wide MLPs to more complex architectures like Convolutional Neural Networks (CNNs) and applying the framework to classification tasks.

Summary updated

BibTeX
@misc{pearce2018bayesian,
  author = {Tim Pearce and Mohamed Zaki and Andy Neely},
  title = {{Bayesian Neural Network Ensembles}},
  year = {2018},
  eprint = {1811.12188},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1811.12188},
}
Figure