Ensemble Distribution Distillation

Andrey Malinin, Bruno Mlodozeniec, Mark Gales

TL;DR

Ensembles of deep networks provide excellent accuracy and robust uncertainty estimates, but running dozens of models at inference time is computationally prohibitive. Standard knowledge distillation compresses an ensemble into a single model by matching average predictions, which unfortunately discards the ensemble's internal diversity. This paper introduces Ensemble Distribution Distillation ($\text{EnD}^2$), a novel approach that uses Prior Networks to capture the entire distribution of ensemble predictions, successfully retaining both high classification performance and robust uncertainty estimation within a single network.

What Problem Does This Paper Address?

Deep neural networks are notoriously prone to making overconfident, incorrect predictions. To safely deploy them in high-stakes fields like medical diagnosis or autonomous driving, models must provide reliable measures of uncertainty. Specifically, we want to distinguish between data uncertainty (inherent noise or overlap in the data) and knowledge uncertainty (when the model encounters completely unfamiliar, out-of-distribution data).

Ensembles of networks excel at this because individual models will naturally disagree when facing unfamiliar inputs. However, running an ensemble of 100 models is too slow and memory-intensive for real-time applications. While standard knowledge distillation compresses an ensemble into a single student network, it only forces the student to match the ensemble's average prediction. This collapses the distribution into a single point estimate, destroying the very diversity and disagreement data needed to calculate knowledge uncertainty.

Desired behaviors of an ensemble on a simplex of categorical probabilities.

Methods

The authors propose Ensemble Distribution Distillation ($\text{EnD}^2$). Instead of outputting a standard softmax vector, the student model is structured as a Prior Network that explicitly outputs the parameters of a Dirichlet distribution over the class probabilities. This allows a single neural network to predict a distribution over output distributions.

  • Loss Function: The Prior Network is trained by minimizing the negative log-likelihood (NLL) of the individual categorical predictions from every member of the ensemble. This is mathematically equivalent to minimizing the forward KL-divergence between the Prior Network's Dirichlet distribution and the empirical distribution of the ensemble.
  • Temperature Annealing: Ensemble predictions on in-domain training data are often extremely sharp (concentrated at the corners of the probability simplex). To prevent optimization from stalling, the authors introduce a temperature annealing schedule. They artificially "heat up" the ensemble's softmax outputs and the student's concentration parameters during early training to smooth the distributions, gradually cooling the system back down to a temperature of 1 as training progresses.

Datasets

The properties of $\text{EnD}^2$ were evaluated using both synthetic and real-world image datasets:

  • Artificial 3-Spiral Dataset: A synthetic dataset consisting of three intertwined spiral arms with increasing noise, creating clear regions of class overlap and distinct out-of-domain spaces.
  • CIFAR-10 & CIFAR-100: Standard image classification benchmarks consisting of 50,000 training images across 10 and 100 classes, respectively.
  • TinyImageNet (TIM): A larger-scale dataset containing 100,000 training images across 200 classes.
  • LSUN: Used strictly as an out-of-distribution (OOD) test set to evaluate how well models trained on CIFAR can detect completely unseen environments.
Figure 2: 3-spiral dataset with 1000 examples per class

Key Insights and Ideas

  • Disagreement is a Signal: The core philosophy of $\text{EnD}^2$ is that ensemble diversity is a feature, not a bug. Preserving the spread of predictions allows a single model to successfully mimic ensemble disagreement.
  • The Zero-Avoiding Effect: Because $\text{EnD}^2$ minimizes the forward KL-divergence, the loss function is "zero-avoiding." This causes the distilled model to learn a Dirichlet distribution that is slightly "wider" (more conservative) than the true ensemble on out-of-distribution data. Surprisingly, this over-estimation actually improves OOD detection performance by pushing in-domain and out-of-domain uncertainty metrics further apart.
  • The Role of Auxiliary Data: Ensembles rarely disagree on their own training data. To teach the student model how the ensemble behaves when it is confused, the authors found it highly beneficial to include unlabeled auxiliary data ($\text{EnD}^2_{\text{+AUX}}$) representing out-of-distribution regions during the distillation process.

Key Results

  • Classification Accuracy: On CIFAR-100, $\text{EnD}^2$ achieved a classification error of 27.9%, successfully capturing the performance gains of the full ensemble (26.3%) while outperforming standard distillation (28.0%).
  • Misclassification Detection: Evaluated using the Prediction Rejection Ratio (PRR), $\text{EnD}^2$ consistently matched or outperformed standard distillation across all image datasets, proving that the model accurately gauges its own likelihood of making an error.
  • Out-of-Distribution Detection: When trained on CIFAR-10 and tested on unseen LSUN images, $\text{EnD}^2_{\text{+AUX}}$ achieved an OOD detection AUC-ROC of 94.4% using total uncertainty metrics. This effectively matched the performance of the original 100-model ensemble (94.5%) and significantly beat standard distillation (88.6%).
Histograms of uncertainty of the CIFAR-10 ensemble, EnD2 and EnD2+AUX on in-domain (ID) and test out-of-domain (OOD) data.

Limitations and Future Work

Despite its strong performance, $\text{EnD}^2$ has a few notable limitations:

  1. Dirichlet Distribution Constraints: A single Dirichlet distribution is mathematically unimodal. If an ensemble splits into multiple distinct prediction clusters (multi-modality) on highly ambiguous data, a standard Dirichlet distribution cannot faithfully capture that shape.
  2. Calibration Mismatch: Due to the zero-avoiding nature of the forward KL loss, $\text{EnD}^2$ models tend to over-estimate uncertainty on out-of-distribution data, meaning they do not perfectly replicate the exact calibration profile of the original ensemble.

Future Directions: The authors suggest exploring more flexible continuous distributions, such as Mixtures of Dirichlets or Logistic-normal distributions, to capture complex ensemble behaviors. They also note that extending $\text{EnD}^2$ from classification to regression tasks remains an open and promising area of research.

Summary updated

BibTeX
@inproceedings{malinin2020ensemble,
  author = {Andrey Malinin and Bruno Mlodozeniec and Mark Gales},
  title = {{Ensemble Distribution Distillation}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
  url = {https://openreview.net/forum?id=kSbKdX3HMV},
}
Figure