Abstract
Last Layer Empirical Bayes (LLEB) is a novel approach to uncertainty quantification (UQ) that bridges the gap between Bayesian Neural Networks (BNNs) and Deep Ensembles. By utilizing Normalizing Flows to learn a data-dependent prior specifically for the network's final layer, LLEB seeks to capture the high performance and calibration of ensembles without the massive computational overhead of training multiple models. We evaluate LLEB on standard image classification benchmarks, finding it performs competitively with existing single-model UQ methods while providing a theoretically grounded framework for learning strong priors.
Introduction
In deep learning, knowing how much a model doesn't know—Uncertainty Quantification (UQ)—is often as critical as the prediction itself. Currently, two paradigms dominate:
- Bayesian Neural Networks (BNNs): These treat weights as distributions. While theoretically elegant, they often underperform due to "weak," pre-defined priors (e.g., simple Gaussians) that fail to capture the complexity of the data.
- Deep Ensembles: These train multiple independent models and average their outputs. They are the gold standard for performance and calibration but are computationally expensive, requiring $M$ times the resources for an ensemble of size $M$.
Recent research suggests that Deep Ensembles perform a hidden form of "Empirical Bayes," where the model effectively learns a "strong" prior from the data. LLEB asks: Can we explicitly learn a strong, data-dependent prior to achieve ensemble-like performance more efficiently?
Methodology
The authors introduce Last Layer Empirical Bayes (LLEB), focusing the Bayesian treatment on the final layer to maintain mathematical tractability.
Normalizing Flows as Priors
Instead of a simple Gaussian prior, LLEB employs a Normalizing Flow (NF) to represent the distribution of last-layer weights. NFs transform a simple base distribution into a complex, multi-modal one through a series of invertible mappings. This allows the model to learn a much more flexible and "strong" prior than traditional BNNs.
Learning the Prior
Unlike standard BNNs with fixed priors, LLEB learns the NF parameters by maximizing the Evidence Lower Bound (ELBO). To ensure stability in large models, the authors utilize a two-step training approach:
- MLE Pre-training: Perform standard Maximum Likelihood Estimation to train the entire network.
- Bayesian Refinement: Freeze the early layers and train the Normalizing Flow on the last layer's weights to maximize the ELBO.
Experimental Setup
LLEB was evaluated on standard UQ benchmarks:
- MNIST & Fashion-MNIST: Used for in-distribution and out-of-distribution (OOD) testing.
- CIFAR-10 & SVHN: A more challenging pair for testing robustness and OOD detection.
The method was compared against Last Layer Laplace (LLL) and Monte Carlo Dropout (MCD) baselines.
Results and Discussion
LLEB demonstrates competitive performance across various metrics, including accuracy, Expected Calibration Error (ECE), and OOD detection (AUC).
As shown in Figure 1, on CIFAR-10, LLEB achieved an accuracy of ~92.85% and an OOD detection AUC of 0.94, matching or slightly exceeding LLL and MCD. In the ensemble setting ($M=5$), LLEB maintains high accuracy while significantly improving calibration (ECE).
Figure 2 illustrates similar trends for the MNIST/Fashion-MNIST benchmarks. LLEB consistently provides strong calibration results, with ECE values often lower than or equal to competing methods.
Key Insights
- Ensembles as Empirical Bayes: LLEB formalizes the intuition that ensembles act as BNNs with implicitly learned strong priors.
- The Invertibility Trick: Normalizing Flows act as an implicit regularizer. Their invertibility prevents the learned distribution from collapsing into a single point, encouraging weight diversity.
- Computational Efficiency: By applying the Bayesian treatment only to the last layer, LLEB adds minimal overhead compared to standard training, making it far more efficient than full ensembles.
Limitations
Despite its theoretical appeal, LLEB did not consistently or significantly outperform existing baselines in all scenarios. The authors identify several bottlenecks:
- Last Layer Restriction: Limiting the Bayesian approach to the final layer may not capture the full complexity of the weight space.
- Optimization Sensitivity: Learning the prior is delicate; the authors noted that explicitly encouraging higher entropy did not necessarily improve performance, suggesting the NF might already be sufficiently diverse.
Conclusion
LLEB provides a well-motivated theoretical bridge between BNNs and ensembles. While it has not yet "claimed the crown" from Deep Ensembles in terms of raw performance, it offers a computationally efficient path toward better uncertainty quantification through learned, data-dependent priors.
Summary updated