Introduction
Deep ensembles—training multiple neural networks independently from different random initializations—are a popular and highly effective way to estimate predictive uncertainty. However, as models become larger and more overparameterized, they often suffer from functional collapse. Ensemble members tend to converge to similar functions, meaning that adding more models doesn't actually improve diversity or the ensemble's ability to flag out-of-distribution (OOD) data.
Furthermore, standard deep ensembles are essentially just a collection of Maximum A Posteriori (MAP) estimates; they lack theoretical guarantees that they are sampling from the true Bayesian posterior. Because neural networks are overparameterized, two models can have very different weights but represent the exact same function (non-identifiability). This makes standard techniques that enforce diversity in weight space highly inefficient.
This paper introduces a "repulsive" term to the training process that forces ensemble members to diversify. Crucially, the authors prove this simple modification transforms standard deep ensembles into proper Bayesian inference by approximating a Wasserstein gradient flow to the true posterior.
Methods: Repulsive Ensembles via Wasserstein Gradient Flow
The authors propose adding a kernelized repulsive term to the gradient descent update rule of deep ensembles. This acts as a force pushing the ensemble members (particles) away from each other during training.
Wasserstein Gradient Flow (WGD): The authors show mathematically that with the right repulsive term, the ensemble's training dynamics approximate a Wasserstein gradient flow of the KL divergence. This endows the ensemble with asymptotic convergence guarantees to the true Bayesian posterior. To compute this repulsive force practically, they utilize sample-based approximations of the gradient: Kernel Density Estimation (KDE), Stein Gradient Estimators (SGE), and Spectral SGE (SSGE).
Function-Space Repulsion (fWGD): To solve the non-identifiability problem, they define the repulsive force in function space rather than weight space. The models repel each other based on their actual output predictions on a batch of data. Because neural networks are parameterized by weights, this function-space update is projected back into weight space using the network's Jacobian.
Contrast with SVGD: Unlike Stein Variational Gradient Descent (SVGD), which averages posterior gradients across all particles based on their similarity, WGD keeps particle gradients separate. This avoids a known SVGD pitfall where particles are pulled away from true modes in high-dimensional, multi-modal spaces.
Key Insights and Results
A carefully designed repulsive force isn't just a heuristic trick to force diversity; it mathematically bridges the gap between standard deep ensembles and true Bayesian posterior sampling. Furthermore, pushing models apart in weight space doesn't guarantee they will behave differently on actual data. Function-space repulsion ensures the models actually disagree on unseen regions, capturing true epistemic (model) uncertainty.
Perfecting "In-Between" Uncertainty
On synthetic 1D regression tasks, function-space WGD (fWGD) successfully captured the uncertainty between clusters of training data, closely matching the gold-standard Hamiltonian Monte Carlo (HMC) posterior. Standard deep ensembles and weight-space methods were dangerously overconfident in these gaps.
Improved Accuracy and OOD Detection
The authors found that measuring functional diversity via Model Disagreement (MD)—how much the ensemble members disagree with each other—is a more robust metric for detecting out-of-distribution data than standard predictive entropy.
- FashionMNIST: The proposed
sge-WGDachieved the highest accuracy (91.3%), while the function-spacekde-fWGDachieved the best OOD detection against MNIST (AUROC of 0.980 using Model Disagreement). - CIFAR-10: Scaling to ResNet32, weight-space WGD methods achieved the best accuracy (85.9%), outperforming standard deep ensembles (85.5%) and SVGD (85.1%). Function-space methods maintained highly competitive OOD detection capabilities against SVHN.
Limitations and Future Work
Function-space updates require computing the Jacobian of the neural network. For very large models, this can be computationally expensive and memory-intensive. Additionally, the theoretical guarantees rely on specific kernel constraints (e.g., the kernel must belong to the Stein class for SGE/SSGE estimators).
Future work will investigate the impact of the Jacobian in the fWGD update in more detail, potentially comparing it to more scalable approximations like Neural Tangent Kernels (NTK) or generalized Gauss-Newton matrices. The authors also aim to derive explicit theoretical convergence bounds for their proposed method to compare directly against existing bounds for SVGD.
Summary updated