NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Functional Ensemble Distillation

Coby Penso, Idan Achituve, Ethan Fetaya

Abstract

Bayesian Neural Networks (BNNs) are considered the gold standard for uncertainty estimation in deep learning, yet their computational demands often prohibit real-world deployment. While deep ensembles offer a practical alternative, they remain memory-intensive and slow. We present Functional Ensemble Distillation (FED), a novel method to compress a large ensemble into a single, efficient generator network. By leveraging Maximum Mean Discrepancy (MMD) and mixup augmentation, FED captures the functional diversity of an ensemble, achieving state-of-the-art uncertainty estimation with a 200x speedup and 100x memory reduction.

Introduction

In safety-critical applications like autonomous driving, knowing when a model is "unsure" is as vital as the prediction itself. Bayesian Neural Networks provide this by outputting a distribution over possible answers. However, the cost of Bayesian inference is notoriously high. Ensembles—averaging multiple models—are the standard workaround but are still too resource-heavy for edge devices or real-time systems.

In "Functional Ensemble Distillation," Penso et al. propose a way to retain the benefits of ensembles while drastically reducing their footprint. FED distills an ensemble into a single "generator" network that uses random noise to mimic the ensemble's predictive distribution.

The Problem with Traditional Distillation

Existing distillation methods typically face two major hurdles:

  1. Expressive Limitations: Many approaches assume predictive distributions follow a simple parametric form (e.g., Dirichlet). This fails to capture the complex correlations between predictions for different inputs—a critical requirement for downstream tasks.
  2. The Overfitting Trap: In low-data regimes, ensemble members often achieve near-zero training loss, meaning they produce identical predictions on the training set. If the teacher models agree perfectly on training data, the student model fails to learn the diversity that characterizes the ensemble's uncertainty on unseen data.

Methodology: Functional Ensemble Distillation

FED treats distillation as a conditional generative modeling problem. Instead of a standard deterministic network, FED employs a Generator Network $g_w(x, \epsilon)$. For any input $x$, a noise variable $\epsilon$ is sampled from a fixed Gaussian distribution. Each $\epsilon$ produces a distinct prediction, effectively acting as a member of a distilled ensemble.

The FED pipeline (right) compared to a standard ensemble (left). FED uses a single generator and noise samples to produce a distribution of predictions.

Key Innovations

  • Functional Matching with MMD: The generator is trained using Maximum Mean Discrepancy (MMD), which measures the distance between the distribution of functions produced by the original ensemble and those from the generator.
  • Multi-Stage Noise Injection: Noise is concatenated to intermediate features throughout the network architecture. The standard deviation of this noise is a learnable parameter, allowing the model to optimize its own diversity.
  • Mixup as an Auxiliary Dataset: To solve the overfitting problem, the authors use mixup augmentation (interpolating between real examples). On these synthetic points, ensemble members naturally disagree more, providing the necessary signal for the student to learn the teacher's diversity.

Experimental Results

The authors evaluated FED on CIFAR-10, CIFAR-100, and STL-10 benchmarks.

Superior Uncertainty Estimation

FED consistently outperformed baselines in Out-of-Distribution (OOD) detection. On the STL-10 dataset, FED's ROC curve for OOD detection was significantly higher than competitors like Hydra or DM-ODS, demonstrating its ability to capture complex epistemic uncertainty.

ROC curves for OOD detection on the STL-10 dataset. FED (blue) shows superior performance compared to existing baselines.

Efficiency and Speed

The computational gains are substantial. A 120-model ensemble requiring over 5GB of memory and 4.075 seconds for inference was compressed into a 43MB generator. The FED generator with 120 noise samples took only 0.020 seconds—a roughly 200x speedup. Because the generator shares linear operations across noise samples, running multiple "noise-members" adds negligible overhead.

Conclusion

Functional Ensemble Distillation offers a powerful framework for compressing the functional diversity of deep ensembles into a single, efficient model. By moving beyond point-wise distillation to functional matching, FED provides a scalable solution for deploying high-quality uncertainty estimation in real-time, resource-constrained environments.

Summary updated

BibTeX
@inproceedings{penso2022functional,
  author = {Coby Penso and Idan Achituve and Ethan Fetaya},
  title = {{Functional Ensemble Distillation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
}
Figure