Abstract
Bayesian Neural Networks (BNNs) provide a robust framework for uncertainty quantification, yet their deployment is often hindered by the computational burden of ensemble-based inference. We introduce Generalized Bayesian Posterior Expectation Distillation (GPED), a framework designed to compress the rich information of a Bayesian posterior into a single, efficient student network. Unlike previous methods that focus solely on predictive means, GPED generalizes distillation to arbitrary posterior expectations, including predictive entropy. By integrating online distillation with automated architecture search and pruning, GPED achieves state-of-the-art performance in out-of-distribution detection and uncertainty ranking while significantly reducing computational overhead.
Introduction
The "gold standard" for uncertainty quantification in deep learning is often considered to be Bayesian Neural Networks (BNNs). By treating model weights as distributions, BNNs provide well-calibrated uncertainty estimates that are crucial for safety-critical applications. However, the mathematical intractability of the posterior necessitates the use of Monte Carlo approximations, resulting in ensembles that are computationally expensive to run at inference time. This paper presents Generalized Bayesian Posterior Expectation Distillation (GPED), a method to distill the "wisdom" of these ensembles into a single, deployable student network.
The Gap in Existing Distillation
Previous efforts, such as Bayesian Dark Knowledge (BDK), primarily focused on distilling the predictive mean. While effective for standard classification, this approach discards vital information regarding model disagreement—often referred to as epistemic or knowledge uncertainty. Furthermore, traditional distillation assumes a fixed student architecture, which may not be optimal for capturing the complex statistics of the teacher's posterior.
The GPED Framework
GPED addresses these limitations through several key innovations:
- Generalized Targets: GPED can distill any posterior expectation, such as expected entropy, allowing the student to learn the teacher's uncertainty directly.
- Online Distillation: Utilizing Stochastic Gradient Langevin Dynamics (SGLD), GPED samples the teacher's posterior on-the-fly, avoiding the need to store large ensembles.
- Architecture Search: The framework employs Group Lasso regularization to automatically prune the student network, identifying the optimal balance between capacity and efficiency.
Key Insights: The "Goldilocks Zone"
A significant finding is the existence of a "Goldilocks Zone" of task difficulty. The distillation gap—the difference in performance between the teacher and student—is most pronounced at moderate levels of data corruption (masking rates). In very simple or extremely noisy scenarios, the teacher's output is easily mimicked. The true "knowledge" of the ensemble is most complex in the middle ground.
Results and Efficiency
GPED demonstrates superior performance across various benchmarks. In out-of-distribution (OOD) detection tasks, GPED outperformed existing methods like Ensemble Distribution Distillation (EnD²) in 75% of tested scenarios. Moreover, the architecture search capability allows for the discovery of highly efficient models.
As shown in the Pareto frontier, GPED can identify student models that achieve better Negative Log-Likelihood (NLL) than baseline models while using up to 6.4x fewer FLOPs. This efficiency is achieved by allowing the student model to have a different capacity and structure than the teacher, optimized through the distillation process.
Conclusion and Future Work
GPED provides a flexible and powerful framework for bringing Bayesian uncertainty to resource-constrained environments. By distilling complex posterior statistics and optimizing model architecture simultaneously, it bridges the gap between the theoretical advantages of BNNs and the practical requirements of real-world deployment. Future work will explore scaling these techniques to larger datasets and a wider variety of posterior statistics.
Summary updated