Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Distilling the Knowledge in a Neural Network

  • Problem Large, accurate ensembles are costly to deploy, so the question is whether a small model can absorb their knowledge.
  • Method Trains a small model on high-temperature class probabilities from a cumbersome model, combined with hard labels, and adds specialist models for very large label sets.
  • Results The distilled single speech model reached 60.8% frame accuracy and 10.7% WER on the development set, against 61.1% and 10.7% for the 10-model ensemble.

Why compress an ensemble

Compressing the knowledge of an ensemble into a single model makes the ensemble far easier to deploy, and the earlier work on this point is the starting place here. The argument is an analogy with insects: training can rely on a very cumbersome model, while deployment needs something small that suits real-time use and limited computation.

The cumbersome model may be an ensemble of separately trained models or one very large model trained with a strong regularizer such as dropout, and distillation moves its knowledge into a small model. The authors also treat the knowledge in a trained model as an input-to-output mapping rather than as a fixed set of parameter values, which means the form of the model can change while the knowledge stays.

The knowledge that matters for generalization sits in the small probabilities given to wrong answers, not in the top answer alone. A picture of a BMW is far more likely to be confused with a garbage truck than with a carrot, and that ranking of mistakes reflects how the model generalizes. Ordinary training optimizes the training data, while the real goal is generalization, so a small model that copies the cumbersome model's way of generalizing can beat one trained on hard labels alone.

Softened outputs and the distillation objective

A softmax output turns each logit \(z_i\) into a class probability \(q_i = \frac{\exp(z_i/T)}{\sum_j \exp(z_j/T)}\), where \(T\) is normally set to 1. A larger \(T\) spreads the probability mass more evenly over the classes, so the output becomes softer. Soft targets with high entropy carry more information per training case than hard labels and give gradients that vary less from case to case, so the small model can train on less data at a higher learning rate.

In the simplest form, the cumbersome model is run at a high temperature to produce a soft target for each case in a transfer set, and the distilled model is trained at that same temperature. After training, the distilled model is used at temperature 1, which is the setting for deployment. The soft targets can come from an arithmetic or geometric mean of the individual predictive distributions when the cumbersome model is an ensemble.

When correct labels exist, the distilled model is also trained on them, and the authors found it better to take a weighted average of two objectives than to edit the soft targets with the labels. The gradients from the soft targets scale as \(1/T^2\), so the soft term is multiplied by \(T^2\), which keeps the balance between the two terms roughly unchanged when the temperature changes.

The transfer set may be unlabeled data, as in the earlier work, or the original training set, and the original training set works well when a small hard-label term is added.

Logit matching as a limiting case

For a distilled logit \(z_i\), the cross-entropy gradient is \[\frac{\partial C}{\partial z_i} = \frac{1}{T}(q_i - p_i)\], where \(p_i\) is the soft probability that the cumbersome model with logits \(v_i\) produces at temperature \(T\). When \(T\) is large compared with the logit magnitudes, the expression can be approximated by a form in which the logits appear linearly and a constant \(N\) enters the denominator.

Under these conditions, distillation at high temperature is equivalent to minimizing one half of the squared difference between the distilled and cumbersome logits, which is the objective used by Caruana and his collaborators. At lower temperatures, distillation pays much less attention to logits that are far more negative than average. Those very negative logits are almost unconstrained by the training of the cumbersome model and may be noisy, but they may also carry useful knowledge, so the authors treat which effect dominates as an empirical question.

MNIST: transfer with and without a digit

The cumbersome model is a net with two hidden layers of 1200 rectified linear units, trained on all 60,000 training cases with dropout and weight constraints. The large net made 67 test errors, while a smaller net with 800 units per hidden layer and no regularization made 146. The smaller net regularized only by matching the large net's soft targets at a temperature of 20 made 74 test errors.

With 300 or more units in each hidden layer, every temperature above 8 gave fairly similar results. When each hidden layer was reduced to 30 units, temperatures in the range 2.5 to 4 worked significantly better than higher or lower ones.

With all examples of the digit 3 omitted from the transfer set, the distilled model made 206 test errors, 133 of them on the 1010 threes in the test set. Most of these errors came from a learned bias for the 3 class that was far too low. Raising that bias by 3.5, a value chosen to optimize overall test performance, brought the total to 109 errors, 14 of them on 3s, and the distilled model classified 98.6% of the test 3s correctly.

Because the bias was tuned on the test set, this figure is an optimistic reading of a model that never saw a 3 during training.

When the transfer set contains only the 7s and 8s, the distilled model makes 47.3% test errors, and reducing the biases for 7 and 8 by 7.6 to optimize test performance lowers this to 13.2%.

Speech recognition: distilling a 10-model ensemble

The baseline is a DNN with 8 hidden layers of 2 560 rectified linear units and a softmax over 14,000 labels, which predicts HMM states from 26 frames of 40 Mel-scaled filterbank coefficients. The baseline reached 58.9% frame accuracy and a WER of 10.9% on the development set.

The ensemble consists of 10 models with the same architecture and training procedure as the baseline, differing in their random initial parameter values, which the authors found enough to make the averaged ensemble beat its members. Varying the data each model sees did not significantly change the results, so the simpler approach was kept.

The distilled single model reached 60.8% frame accuracy and 10.7% WER, against 61.1% and 10.7% for the 10-model ensemble.

More than 80% of the frame-accuracy improvement of the ensemble over the baseline transferred to the distilled model. The ensemble's WER gain is smaller, which the authors attribute to a mismatch between the training objective and WER, but the WER gain of the ensemble also carried over to the distilled model. WER was measured on a 23K-word test set.

A separate study learned a small acoustic model by matching class probabilities at temperature 1 on a large unlabeled dataset, and its best distilled model closed 28% of the gap between the small and large models trained on hard labels.

Specialists for confusable classes

JFT is an internal Google dataset of 100 million labeled images with 15,000 labels. Its baseline deep convolutional network had been trained for about six months with asynchronous stochastic gradient descent across many cores, and adding an ensemble would have needed far more cores than were available. Waiting years to train an ensemble was not an option, so the authors aimed for a faster way to improve the baseline.

The ensemble has one generalist model trained on all the data and many specialist models, each trained on data enriched in a confusable subset of classes. After training, the dustbin logit is corrected by adding the log of the proportion by which the specialist class was oversampled.

The classes for each specialist come from clustering the covariance matrix of the generalist's predictions, so that classes often predicted together form one specialist's target set \(S_m\). An on-line version of K-means is applied to the columns of that covariance matrix, and the authors report that other clustering algorithms gave similar results.

Table 2 lists example classes from these clusters, and the authors used the generalist's predictions so that the true labels were not needed to form the clusters.

Combining the generalist with active specialists

For each image, the generalist's most probable class is taken first, with \(n = 1\) in the experiments. The active set \(A_k\) holds every specialist whose subset \(S_m\) intersects that top class, and the set can be empty. A full distribution \(q\) over all classes is then found by minimizing the sum of the KL divergences from the generalist distribution and from each active specialist distribution, \[KL(p_g, q) + \sum_{m \in A_k} KL(p_m, q)\].

A specialist distribution covers its own classes plus the dustbin class, so when its divergence is computed, the q mass over all classes in that dustbin is summed. Equation 5 has no general closed form, although when every model gives a single probability per class the solution is the arithmetic or the geometric mean, depending on whether KL(p,q) or KL(q,p) is used.

The authors parameterize \(q = \mathrm{softmax}(z)\) with \(T = 1\) and optimize the logits \(z\) by gradient descent, which has to be carried out for each image.

JFT results with 61 specialists

The baseline reached 25.0% test accuracy and 43.1% conditional test accuracy on the JFT development set. Adding 61 specialist models raised these to 26.1% and 45.9%. Overall test accuracy improved by 4.4% relative, with 61 specialist models each covering 300 classes plus the dustbin class. Specialists are trained independently and quickly, taking days where the baseline took many weeks.

Because the class subsets overlap, many images are covered by several specialists, and the table groups the test examples by that count. The relative top-1 gain is +3.4% for one covering specialist, +7.4% for two, +16.6% for nine and +14.1% for ten or more. The gain generally grows as more specialists cover the correct class, and the authors describe this trend as encouraging because independent specialists are easy to parallelize.

Soft targets with 3% of the speech data

That model reached 67.3% train frame accuracy and 44.5% test frame accuracy, and it was stopped early because accuracy dropped after that point. A model trained on the same 3% with soft targets from the full-data model reached 65.4% train and 57.0% test frame accuracy. The full-data baseline reached 63.4% train and 58.9% test frame accuracy for reference.

The soft-target model did not need early stopping and simply converged to 57%. The authors read this as evidence that soft targets pass the regularities a model learned from all the data to another model.

Soft targets as a fix for specialist overfitting

The specialists in the JFT experiments collapse all non-special classes into a single dustbin class. A specialist is trained on heavily enriched data, so its effective training set is small and it tends to overfit its special classes, and making it smaller would lose the transfer effects from the other classes. The authors suggest that a specialist initialized from the generalist could keep most of its knowledge of the non-special classes if it is also trained with soft targets for those classes, with the soft targets supplied by the generalist.

This idea is being explored and was not tested in the paper.

Comparison with mixtures of experts

Specialists resemble mixtures of experts, which use a gating network to decide how each example is assigned to each expert. In a mixture of experts, the experts and the gating network are learned together, and the assignments depend on how well each expert performs on each example. That coupling makes training hard to parallelize, because each expert's weighted training set keeps changing with the other experts and the gating network must compare experts on the same example.

Specialists avoid this by taking subsets from a generalist first and then training each one independently, so only the relevant specialists need to run at test time.

The relationship section says the confusion matrix defines the specialist subsets, while the clustering described earlier uses the covariance matrix of the generalist's predictions, and the authors state that the true labels are not needed for that clustering.

Limitations

The knowledge held by the specialists has not yet been distilled back into the single large net. Combining the specialists requires gradient descent on the logits, repeated for every image. The specialist results are reported on JFT only, and the speech experiments use distillation of the 10-model ensemble. The distilled model's WER gain is smaller than its frame-accuracy gain, and the authors attribute this to an objective mismatch.

The MNIST biases that give the best results were tuned on the test set, and the small-data speech experiment uses only the baseline speech model. Soft targets for the non-special classes of specialists remain untested.

Paper info

Authors
Geoffrey Hinton, Oriol Vinyals, Jeff Dean
Venue
arXiv · Preprint
First published
2015-3-9
Added
2026-10-20
Updated
2015-3-9
Version
v1
arXiv
1503.02531
Category
stat.ML · cs.LG · cs.NE
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Geoffrey Hinton, Oriol Vinyals, Jeff Dean (2015). Distilling the Knowledge in a Neural Network. arXiv:1503.02531v1. https://arxiv.org/abs/1503.02531v1

BibTeX
@misc{hinton2015distilling,
  title = {{Distilling the Knowledge in a Neural Network}},
  author = {Geoffrey Hinton and Oriol Vinyals and Jeff Dean},
  year = {2015},
  eprint = {1503.02531},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1503.02531v1}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up