Greedy Bayesian Posterior Approximation with Deep Ensembles

Aleksei Tiulpin, Matthew B. Blaschko

Introduction

Deep ensembles—training multiple neural networks independently and averaging their predictions—have become the gold standard for uncertainty estimation in deep learning. However, they are often criticized for being "uncontrolled." Standard ensembles rely on the non-convexity of the loss landscape and random initialization to find different "modes" (local minima) of the posterior distribution. This paper provides a principled theoretical framework for building deep ensembles by greedily minimizing the $f$-divergence between the true posterior and a kernel density estimator in function space.

The Challenge of Posterior Coverage

The authors argue that standard "mode-seeking" behavior is insufficient for reliable uncertainty estimation. It doesn't guarantee that the ensemble will cover the full support of the posterior distribution, which is crucial when encountering data far from the training set (OOD data). Ideally, we want "mean-seeking" behavior: an ensemble that covers as much of the high-density regions of the posterior as possible, rather than just hitting a few random peaks.

Comparison of posterior approximation strategies: (a) Randomization-based mode picking, (b) Naive diversity, and (c) the proposed principled greedy approach.

Methodology: Submodular Optimization in Function Space

The core of the paper is a shift from weight-space Bayesian inference to function-space inference. The authors treat an ensemble as a Kernel Density Estimator (KDE) of the posterior distribution and aim to minimize the $f$-divergence between the true posterior and their KDE-based approximation.

Submodularity and Greedy Selection

The key mathematical insight is proving that fitting a KDE using $f$-divergence is a submodular maximization problem. Submodularity is a property of set functions that allows for efficient greedy optimization with provable approximation guarantees (typically within a factor of $1 - 1/e$ of the optimum).

The Random Greedy algorithm used to sequentially build the ensemble by maximizing marginal gain.

Instead of training all models at once, the authors use a Random Greedy algorithm. They add ensemble members one by one, where each new member is trained to maximize the "marginal gain" of the objective. From this marginal gain, they derive a novel diversity term that explicitly penalizes new ensemble members for being too similar to existing ones in function space.

Key Results and Insights

The proposed method, "Greedy Ensembles," consistently outperformed standard Deep Ensembles (DE) in OOD detection across various architectures (ResNet164, VGG16BN, WideResNet28x10):

  • OOD Detection: On CIFAR-100, the method improved the Area Under the ROC Curve (AUC) from 0.79 to 0.88 for PreResNet164 and from 0.83 to 0.89 for VGG16BN.
  • Small Ensembles: Performance gains were particularly notable for small ensemble sizes (e.g., $M=3$), where standard ensembles often fail to capture sufficient diversity.
  • Accuracy Preservation: Crucially, the added diversity did not hurt in-distribution accuracy; the models remained as accurate as standard ensembles on the original training tasks.

Limitations and Future Work

Because the algorithm is greedy, models must be trained sequentially, leading to a 70-90% computational overhead during training compared to the trivial parallelization of standard ensembles. Additionally, the diversity term requires a weighting distribution $p^*(x)$, currently handled via a simple Gaussian heuristic. Future research may explore more sophisticated ways to define this distribution or adaptive kernel widths to further improve the posterior approximation.

Summary updated

BibTeX
@article{tiulpin2022greedy,
  author = {Aleksei Tiulpin and Matthew B. Blaschko},
  title = {{Greedy Bayesian Posterior Approximation with Deep Ensembles}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2022},
  url = {https://openreview.net/forum?id=ceLQcTe5jYW},
}
Figure