Deep ensembles—collections of neural networks trained from different random initializations—have become the industry standard for estimating predictive uncertainty in deep learning. Despite their empirical success, particularly in identifying out-of-distribution (OOD) data, the mathematical mechanisms driving their predictive variance have remained largely a "black box." This paper, presented at NeurIPS 2022, provides a theoretical framework to understand these mechanisms by applying the lens of the Neural Tangent Kernel (NTK).
The Problem: Why Do Ensembles Disagree?
When we use an ensemble, we typically measure the variance (disagreement) between the models' predictions to signal when the system is "confused" by new data. However, most existing theory focuses on infinitely wide networks at initialization (Bayesian Neural Networks), whereas real-world ensembles are finite and trained using Gradient Descent. This research addresses the gap between the empirical success of ensembles and our mathematical understanding of the inductive biases that drive their predictive variance.
Methods: Linearized Training and Noise Decomposition
The authors bridge the gap between theory and practice by studying networks in the linearized training regime. In this regime, a sufficiently wide network behaves like a linear model governed by its NTK. Using a statistical tool known as the Delta Method, the authors provide a first-order approximation of the predictive variance, decomposing it into distinct "noise sources" present at initialization ($\theta_0$):
- Functional Noise ($V^a$): The randomness in the network's initial output before any training occurs (similar to a Gaussian Process).
- Kernel Noise ($V^c$): The randomness in the gradients (the Jacobian) at initialization, which determines the "shape" of the NTK.
- Interaction Term ($V^i$): A term representing the interaction between functional and kernel noise.
Disentangled Ensemble Variants
To test the impact of these noise sources, the authors proposed two modified ensemble versions:
- Centered Ensembles ($f^{gd-c}$): By subtracting the initial random function from the model during training, they effectively "silence" the functional noise, leaving only the kernel noise.
- Averaged Kernel Ensembles ($f^{gd-a}$): A method designed to remove kernel noise while retaining functional noise.
Geometric Inductive Biases
A key insight of the paper is that these initialization "ghosts" persist even after extensive training. Furthermore, they exhibit different geometric behaviors:
- Functional noise ($V^a$) tends to increase based on the distance of a test point from the training data.
- Kernel noise ($V^c$) is more sensitive to the angle or direction of the test point relative to the training data.
Crucially, the authors prove that these variance terms survive even when the network is trained non-linearly, provided the network is sufficiently wide.
Experimental Results
The authors validated their theory across a range of complexities, including MLPs, CNNs, and WideResNets (WRN 28-10). They utilized standard in-distribution datasets (MNIST, CIFAR-10/100) and various OOD benchmarks (SVHN, LSUN, TinyImageNet, FashionMNIST).
Key Findings:
- Scaling Laws: Empirical tests confirmed that the variance terms scale with $1/h$ (where $h$ is layer width), matching theoretical predictions.
- Improved OOD Detection: On WideResNet trained on CIFAR-10, the "Centered" ensemble ($f^{sgd-c}$) frequently outperformed the standard ensemble ($f^{sgd}$) on OOD tasks. For example, when detecting SVHN as OOD, the centered version showed a significant performance edge in AUROC. This suggests that functional noise can sometimes act as a "distraction," and removing it allows for a cleaner uncertainty signal.
- Consistency: The behavior of linearized models tracked the behavior of standard, non-linear deep networks very closely, validating the use of NTK as a proxy for understanding real-world ensembles.
Limitations and Future Work
While the study provides a rigorous foundation for ensemble variance, it relies on the assumption that networks are "wide." This theory might be less accurate for very narrow or highly bottlenecked architectures. Additionally, calculating the exact NTK involves high computational complexity ($O(N^3)$), making it difficult to apply to massive datasets like ImageNet without approximation.
Future work may involve using this variance decomposition to create a more formal, mathematically grounded definition of what makes data "out-of-distribution" for a specific model architecture.
Summary updated