Distilling the Knowledge in a Neural Network

Geoffrey Hinton, Oriol Vinyals, Jeff Dean

2015 · NeurIPS Workshop

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

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.

qi=exp(zi/T)jexp(zj/T)q_i = \frac{\exp(z_i/T)}{\sum_j \exp(z_j/T)} L=αT2H(pteacher(T),qstudent(T))+(1α)H(y,qstudent(1))\mathcal{L} = \alpha \, T^2 \, H(\mathbf{p}^{(T)}_{\text{teacher}}, \mathbf{q}^{(T)}_{\text{student}}) + (1-\alpha) \, H(\mathbf{y}, \mathbf{q}^{(1)}_{\text{student}})

Sampling Rule / Algorithm

Distillation uses high-temperature teacher probabilities during training, then restores the student to standard inference temperature.

qitrain=exp(zi/T)jexp(zj/T),qitest=exp(zi)jexp(zj)q_i^{\text{train}} = \frac{\exp(z_i/T)}{\sum_j \exp(z_j/T)}, \qquad q_i^{\text{test}} = \frac{\exp(z_i)}{\sum_j \exp(z_j)} Czi=1T(qipi)\frac{\partial C}{\partial z_i} = \frac{1}{T}\left(q_i - p_i\right)

Training Procedure

Evaluation

Datasets

Metrics

Headline results

Ablations

Method Strengths and Weaknesses

Strengths

Weaknesses

Suggestions from the authors

Links

Prior Papers

Further Papers