Distilling the Knowledge in a Neural Network
Distilling the Knowledge in a Neural Network
Problem
Framing
Ensembles improve accuracy, but deployment cost scales with the number of models. The paper closes this gap by training a small student on softened teacher predictions, so compression preserves the teacher's class-similarity structure. On MNIST, a small net drops from 146 to 74 test errors under distillation.
Currently Used Methods
Foundational
- @goodfellowGAN2014 — adversarial training for strong predictive ensembles and uncertainty smoothing.
- Limitation in context: not a compression method for test-time-efficient deployment.
- @srivastavaDropout2014 — dropout approximates averaging many shared-weight subnetworks.
- Limitation in context: deployment still uses one model, without explicit teacher-to-student transfer.
- @hintonDeepBeliefNets2006 — deep layered pretraining for strong but cumbersome classifiers.
- Limitation in context: says little about compressing learned function into smaller architectures.
- "Model Compression" — compresses ensembles into one model by matching ensemble behavior.
- Limitation in context: lacks the temperature-based soft-target formulation used here.
Proposed Method
Architecture
The method is teacher–student training, not a new network block. Teachers can be an ensemble or a large regularized network; students are smaller deployment models. The paper evaluates a 1200-1200 ReLU teacher and 800-800 or 30-30 students on MNIST, and an 8-layer 2560-unit acoustic model with 14,000-way softmax for speech.
Loss / Objective
The student minimizes a weighted sum of soft-target and hard-label cross-entropies, both computed from the same logits at different temperatures.
Sampling Rule / Algorithm
Distillation uses high-temperature teacher probabilities during training, then restores the student to standard inference temperature.
Training Procedure
- Distillation temperature on MNIST: in the main small-model transfer result.
- Temperature sweep for tiny students: best range .
- MNIST teacher: 2 hidden layers, 1200 ReLU units each.
- MNIST student: 2 hidden layers, 800 ReLU units each; tiny variant 30 units each.
- Speech model: 8 hidden layers, 2560 ReLU units each.
- Speech output layer: 14,000 HMM targets.
- Speech input context: 26 frames of 40 Mel filter-bank coefficients.
Evaluation
Datasets
- MNIST, 60,000 training cases.
- Large-vocabulary speech recognition, about 2000 hours of spoken English.
- JFT image classification for specialist-model experiments.
Metrics
- MNIST: test errors.
- Speech: frame accuracy, word error rate (WER).
- JFT: top-1 test accuracy, conditional test accuracy.
Headline results
- MNIST small net: 146 test errors without distillation; 74 with soft targets.
- MNIST large teacher: 67 test errors.
- Speech baseline: 58.9% frame accuracy, 10.9% WER.
- Speech 10-model ensemble: 61.1% frame accuracy, 10.7% WER.
- Speech distilled single model: 60.8% frame accuracy, 10.7% WER.
Ablations
- Distillation temperature: tiny 30-30 students work best at to .
- Transfer-set class removal: student still gets 98.6% of test 3s with bias correction.
- Transfer-set size: soft targets retain strong speech accuracy with only 3% training data.
- Specialist models: targeted experts improve fine-grained confusions over a generalist alone.
Method Strengths and Weaknesses
Strengths
- Preserves ensemble-level WER: distilled speech model matches 10-model ensemble at 10.7%.
- Uses soft targets to expose inter-class similarity absent from one-hot labels.
- Works with unlabeled transfer data or the original labeled training set.
- Unifies logit matching as a high-temperature limit of one objective.
Weaknesses
- Gains depend on tuning temperature; tiny students degrade outside to .
- Main theory is for classification logits, not broader structured prediction settings.
- Student bias can drift when classes are missing from transfer data.
- Paper gives few optimization details beyond architecture and temperature choices.
Suggestions from the authors
- Study when very negative teacher logits help or hurt small students.
- Use unlabeled transfer sets more aggressively for student training.
- Distill ensembles with specialist models for very large label spaces.
- Train specialists independently to reduce ensemble-training cost.
Links
Prior Papers
- @srivastavaDropout2014 — cited as a strong regularizer that can create a cumbersome teacher.
- @hintonDeepBeliefNets2006 — earlier Hinton line on deep neural representations preceding this compression view.
Further Papers
- @rombachLatentDiffusion2022 — another teacher-student-style efficiency move, compressing expensive generation into a cheaper space.
- @songConsistencyModels2023 — pursues faster inference by distilling multi-step generative processes into cheaper models.
- @leviathanSpeculativeDecoding2023 — shares the deployment theme: transfer computation from expensive models to cheaper helpers.