Dropout distillation

Samuel Rota Bulò, Lorenzo Porzi, Peter Kontschieder

Dropout training implicitly creates an ensemble of exponentially many neural networks. However, at test time, practitioners typically settle for a simple "weight scaling" heuristic that poorly approximates this ensemble. This paper introduces Dropout Distillation, a method that trains a single, efficient model to explicitly mimic the behavior of the ideal dropout ensemble. The result achieves the accuracy of expensive Monte Carlo sampling at the speed of a standard forward pass.

The Problem with Standard Dropout

When training a network with dropout, we are essentially training an ensemble of $2^n$ different architectures (where $n$ is the number of units) that all share the same weights. To get the best possible prediction at test time, theoretical best practice dictates averaging the outputs of all these $2^n$ networks.

Because calculating this exact average is mathematically intractable, the deep learning community typically uses a "standard dropout" workaround: at test time, the full network is used, but weights are scaled by the probability of them being active (e.g., multiplying by $0.5$). While fast, this is a crude approximation that leaves accuracy on the table. An alternative approach, "Monte Carlo (MC) Dropout," averages several random forward passes, but this is computationally expensive and slow. The authors seek a "best of both worlds" solution: the high accuracy of the ensemble with the inference speed of a single model.

Methodology: Distilling the Ensemble

The authors propose treating the intractable ensemble average as a "teacher" and a deterministic network as a "student." The process involves:

  1. The Ideal Predictor: Defining the "ideal" dropout predictor as the expected output over all possible dropout masks.
  2. The Distillation Objective: Minimizing a divergence (such as KL-divergence or Mean Squared Error) between the student model and this ideal teacher.
  3. Stochastic Optimization: Because the teacher is intractable, the authors use a clever trick during the distillation phase: they sample random dropout masks for the teacher in each iteration.
  4. Theoretical Justification: The paper provides a theorem showing that if the loss function belongs to the class of Bregman divergences (which includes MSE and KL-divergence), this stochastic sampling approach correctly optimizes the student to match the true ensemble average.

Crucially, this distillation process does not require labeled data. The student only needs input images (the "unlabeled" distribution) to learn how the ensemble behaves.

Key Insights and Results

The researchers evaluated their method on standard computer vision benchmarks, including MNIST, CIFAR-10, and CIFAR-100, using architectures like LeNet, Network in Network (NiN), and All Convolutional networks.

Accuracy Gains and Efficiency The paper reinforces that the standard $1-p$ scaling trick used in almost every production neural network is a weak approximation. On the CIFAR-10 dataset (using the Quick architecture), standard dropout yielded an 18.15% error rate. Dropout Distillation reduced this to 17.20%, closely approaching the 16.78% achieved by the much slower MC Dropout.

Test error comparison across datasets

Because the final distilled model is just a single deterministic network, Dropout Distillation provides a ~100x speedup over MC Dropout (which required 100 samples to reach similar accuracy).

Training curve comparing Standard, Monte Carlo, and Distillation

Robustness and Compression One of the most interesting findings is that once a model is trained with dropout, its test-time performance can be improved using unlabeled data or even slightly perturbed versions of the training set. The "knowledge" is already in the weights; distillation simply extracts it into a usable form.

Furthermore, distillation allows for joint compression. The authors demonstrated that they could remove 40% of the parameters from a CIFAR-10 model and, through distillation, still achieve better accuracy than the original full-sized model using standard weight scaling.

Limitations and Future Work

While inference is incredibly fast, Dropout Distillation requires an extra training pass after the initial model is trained, adding to the total pipeline time. Additionally, the distillation process introduces its own set of hyperparameters (e.g., learning rates, number of distillation epochs) that require tuning.

The paper primarily focuses on feed-forward and convolutional networks. While the authors mention potential applications for Recurrent Neural Networks (RNNs) and other types of stochastic regularization beyond simple dropout, they leave these explorations for future work.

Summary updated

BibTeX
@inproceedings{bulo2016dropout,
  author = {Samuel Rota Bulò and Lorenzo Porzi and Peter Kontschieder},
  title = {{Dropout distillation}},
  booktitle = {International Conference on Machine Learning},
  year = {2016},
}
Figure