Search

Search papers and lessons

Born Again Neural Networks

Tommaso Furlanello, Zachary C. Lipton, Michael Tschannen et al. · 2018

Born-again networks train a model, then train a fresh copy of the same architecture on the first model's outputs; the copies often beat their teacher, so distillation can help without shrinking the model.

On this page

  • Colour = topic mix
  • Probability
  • Calculus
  • Discrete math
  • Neural network basics
  • Linear algebra
  • Learning basics
  • ReadReady to readNot yet

TL;DR

Distillation is usually a compression tool: a big teacher trains a small student. This paper asks what happens when the student is the same size as the teacher, and the answer is surprising. Furlanello, Lipton, Tschannen, Itti and Anandkumar (2018) train a normal teacher network, then train a brand-new network with exactly the same architecture on the teacher's output probabilities. They call the result a born-again network (BAN). Surprisingly, the BAN usually beats its teacher, and repeating the procedure and averaging the generations gives further gains. The paper reports validation error rates of 3.5% on CIFAR-10 and 15.5% on CIFAR-100 for its best single models.

Builds on: Knowledge Distillation, Residual Connection, Ensemble Learning · Leads to: Emerging Properties in Self-Supervised Vision Transformers (self-distillation without labels, a later form of the same idea)

Why it mattered

Knowledge distillation was known as a way to get a small model that behaves like a large one. Born-again networks changed the question. The paper shows that the teacher's soft outputs carry a training signal strong enough to improve a model that is not smaller at all. Its experiments cover image classification with DenseNets and Wide ResNets on CIFAR-10 and CIFAR-100, and language modelling with LSTMs on the Penn Tree Bank. The effect is not limited to one architecture: a DenseNet teacher can train a ResNet student of similar size that beats a ResNet trained from labels, and a weaker Wide ResNet teacher can train a stronger DenseNet student.

The idea is widely cited. Its lasting contribution is the experiment that separates "a better model" from "a smaller model" as the source of distillation's gains.

The problem

Before this paper, the usual explanation for distillation was compression: a student can match a teacher it cannot match on the raw data, because the teacher's probabilities are a richer target than a single correct label. The usual story also needed a smaller student, since the point was to save compute.

The paper asks a sharper question. If the teacher's outputs help a student learn, can they help a student of identical capacity learn better than the teacher did? That question needs three ingredients from the prerequisites: a model trained by Empirical Risk Minimization with Stochastic Gradient Descent, a Cross-Entropy Loss against a target distribution, and the Softmax that turns scores into that distribution. The paper's answer also relies on the idea of an ensemble, because its best results average several generations of models.

How it works

The procedure is a short pipeline. Here is one tiny image, a cat, and three classes: cat, dog and car.

flowchart LR
  D["Labelled training data"] --> T["Teacher T1, trained on labels"]
  T --> S1["Student S1, same architecture, new seed, trained on T1 outputs"]
  S1 --> S2["Student S2, trained on S1 outputs"]
  S2 --> S3["Student S3, trained on S2 outputs"]
  S1 --> E["Average of generations"]
  S2 --> E
  S3 --> E
  1. Train the teacher on labels. The teacher is an ordinary network trained to convergence with the usual labels. Suppose its scores (logits) for the cat image are (2,1,0)(2, 1, 0). Softmax turns these into probabilities p=(0.665, 0.245, 0.090)\mathbf{p} = (0.665,\ 0.245,\ 0.090). Check: the three numbers add to 1, and cat is the largest.

  2. Start a new student from scratch. It has the same architecture as the teacher but a different random seed, so it starts knowing nothing. For the cat image its scores are (0,0,0)(0, 0, 0), and its probabilities are q=(0.333, 0.333, 0.333)\mathbf{q} = (0.333,\ 0.333,\ 0.333). Check: all three are equal, so the student has no preference yet.

  3. Score the student against the teacher's distribution. The student's loss on this image is the cross-entropy between the teacher's probabilities and the student's: −∑ipiln⁡qi-\sum_i p_i \ln q_i. With the uniform student this is ln⁡3≈1.099\ln 3 \approx 1.099, whatever the teacher's numbers are. Check: a uniform student always scores ln⁡3\ln 3 when the targets sum to 1.

  4. Train until the student matches the teacher more closely. Gradient steps move the student's scores toward the teacher's. Suppose that after training the student says (0.60, 0.28, 0.12)(0.60,\ 0.28,\ 0.12) for this image. The loss falls to −(0.665ln⁡0.60+0.245ln⁡0.28+0.090ln⁡0.12)≈0.842-(0.665 \ln 0.60 + 0.245 \ln 0.28 + 0.090 \ln 0.12) \approx 0.842. Check: the loss went down from 1.099, and the student's cat probability (0.60) is now close to the teacher's (0.665).

  5. Repeat with the student as the new teacher. Student S1 becomes the teacher of a fresh student S2, which is trained the same way. The paper's sequence repeats this for several generations. In the paper's runs the gains from later generations get smaller and eventually level off.

  6. Average the generations for the final answer. Suppose S1 says (0.60,0.28,0.12)(0.60, 0.28, 0.12) and S2 says (0.64,0.24,0.12)(0.64, 0.24, 0.12) for this image. The average is (0.62, 0.26, 0.12)(0.62,\ 0.26,\ 0.12). Check: it still sums to 1, and its cat probability, 0.62, sits between the two students' 0.60 and 0.64.

The step where the student learns from the teacher's whole distribution, not only the correct label, is the heart of the method. The plot shows why that matters. Each curve is the gradient on the true-class score as a function of the teacher's confidence p∗p_* in the true class, for a student whose probability on that class is q∗=0.6q_* = 0.6. The dashed line is the gradient from the label alone, which does not depend on the teacher.

00.20.40.60.81−0.4−0.200.20.40.6teacher probability for the true class, p*gradient on the true-class score
  • teacher target: q* - p*
  • label only: q* - 1
With a confident, correct teacher (p* near 1) the teacher target pushes the same way as the label. When the teacher is unsure the push is weaker, so that sample counts for less.

The math

Definition: Born-again network

Let (x,y)(x, y) be a labelled example, and let θ1∗\theta_1^{*} be a teacher trained by ERM on the labels. A born-again network is a student f(x,θ2)f(x, \theta_2) with the same architecture as the teacher, trained to minimise a cross-entropy against the teacher's output distribution. In the pure version the label does not appear in the loss; in the BAN+L version a label term is added with some weight.

Step 1 in symbols: the teacher

The teacher is trained by empirical risk minimisation:

θ1∗=arg⁡min⁡θ1∑(x,y)L(y, f(x,θ1)).\theta_1^{*} = \arg\min_{\theta_1} \sum_{(x,y)} \mathcal{L}\big(y,\ f(x, \theta_1)\big).

Here L\mathcal{L} is the training loss, usually cross-entropy with the true label, and the sum runs over the training set. Nothing about this step is new; it is the ordinary training that the teacher receives before anything else happens.

Step 2 in symbols: the student's loss

Write the teacher's probabilities as p=softmax⁡(zT)\mathbf{p} = \operatorname{softmax}(\mathbf{z}^{T}), where zT\mathbf{z}^{T} are the teacher's logits, and the student's probabilities as q=softmax⁡(zS)\mathbf{q} = \operatorname{softmax}(\mathbf{z}^{S}). Each vector has nn entries, one per class. The student minimises

Lteacher(θ2)=−∑i=1npiln⁡qi,\mathcal{L}_{\text{teacher}}(\theta_2) = -\sum_{i=1}^{n} p_i \ln q_i,

which is the Cross-Entropy Loss with the teacher's distribution as the target. In step 3 of the walkthrough this was ln⁡3\ln 3 for the uniform student. The BAN+L variant adds a label term −ln⁡q∗-\ln q_{*}, where ∗* is the index of the true class.

Step 3 in symbols: why the gradient splits

Take the derivative with respect to the student's score for class ii. Using ∂ln⁡qj/∂zi=δij−qi\partial \ln q_j / \partial z_i = \delta_{ij} - q_i, where δij\delta_{ij} is 1 when i=ji = j and 0 otherwise:

∂Lteacher∂zi=−∑jpj (δij−qi)=qi∑jpj−pi=qi−pi.\frac{\partial \mathcal{L}_{\text{teacher}}}{\partial z_i} = -\sum_{j} p_j\,(\delta_{ij} - q_i) = q_i \sum_j p_j - p_i = q_i - p_i.

The last step uses ∑jpj=1\sum_j p_j = 1. The same formula with the one-hot label y\mathbf{y} in place of p\mathbf{p} gives the label gradient qi−yiq_i - y_i. Subtracting the two shows what the teacher adds:

qi−pi⏟teacher gradient=qi−yi⏟label gradient+(yi−pi)⏟teacher correction.\underbrace{q_i - p_i}_{\text{teacher gradient}} = \underbrace{q_i - y_i}_{\text{label gradient}} + \underbrace{(y_i - p_i)}_{\text{teacher correction}}.

For the true class ∗* with y∗=1y_{*} = 1 this reads q∗−p∗=(q∗−1)+(1−p∗)q_{*} - p_{*} = (q_{*} - 1) + (1 - p_{*}). When the teacher is confident and correct, p∗≈1p_{*} \approx 1, the correction vanishes and the true-class gradient is the label gradient. The paper reads this as a per-sample importance weight: the true-class push is scaled by the teacher's confidence. That reading is an interpretation of the formula rather than an exact identity, and the paper tests it in the experiments below.

Step 4 in symbols: generations and ensembles

Generation kk uses the previous student as its teacher. If θk−1∗\theta_{k-1}^{*} is the trained student from generation k−1k-1, then generation kk minimises the same loss with p\mathbf{p} taken from f(x,θk−1∗)f(x, \theta_{k-1}^{*}). After KK generations the ensemble averages their predictions:

f^K(x)=1K∑k=1Kf(x,θk∗).\hat{f}^{K}(x) = \frac{1}{K} \sum_{k=1}^{K} f(x, \theta_k^{*}).

With the cat image, K=2K = 2 gives f^2=(0.62, 0.26, 0.12)\hat{f}^{2} = (0.62,\ 0.26,\ 0.12), as in the walkthrough.

Worked examples

Example
Level 1: one example, two classes

A two-class image with true class 1, so y=(1,0)\mathbf{y} = (1, 0). The teacher gives p=(0.9, 0.1)\mathbf{p} = (0.9,\ 0.1) and the student gives q=(0.6, 0.4)\mathbf{q} = (0.6,\ 0.4).

  1. Label gradient: q−y=(0.6−1, 0.4−0)=(−0.4, 0.4)\mathbf{q} - \mathbf{y} = (0.6 - 1,\ 0.4 - 0) = (-0.4,\ 0.4).
  2. Teacher gradient: q−p=(0.6−0.9, 0.4−0.1)=(−0.3, 0.3)\mathbf{q} - \mathbf{p} = (0.6 - 0.9,\ 0.4 - 0.1) = (-0.3,\ 0.3).
  3. Teacher correction: y−p=(1−0.9, 0−0.1)=(0.1, −0.1)\mathbf{y} - \mathbf{p} = (1 - 0.9,\ 0 - 0.1) = (0.1,\ -0.1).
  4. Check: label gradient plus correction is (−0.4+0.1, 0.4−0.1)=(−0.3, 0.3)(-0.4 + 0.1,\ 0.4 - 0.1) = (-0.3,\ 0.3), which matches step 2.

Interpretation: the teacher agrees with the true class, so it pushes the true-class score up a little less hard than the label does (−0.3-0.3 against −0.4-0.4). The teacher also says the second class is unlikely, which pushes that score down a little less hard than the label does (0.30.3 against 0.40.4).

Example
Level 2: a batch of three, weighting by teacher confidence

The paper's CWTM treatment weights each example in the loss by the teacher's largest probability. Take three images whose teacher maximum probabilities are 0.90.9, 0.50.5 and 0.20.2.

  1. Sum of the weights: 0.9+0.5+0.2=1.60.9 + 0.5 + 0.2 = 1.6.
  2. Normalised weights: 0.9/1.6=0.56250.9 / 1.6 = 0.5625, 0.5/1.6=0.31250.5 / 1.6 = 0.3125, and 0.2/1.6=0.1250.2 / 1.6 = 0.125.
  3. Check: 0.5625+0.3125+0.125=1.0000.5625 + 0.3125 + 0.125 = 1.000.
  4. Compare with equal weighting, where each image would count 1/3≈0.3331/3 \approx 0.333.

Interpretation: the image the teacher is confident about counts for about 56% of the batch's weight, while the image the teacher is unsure about counts for 12.5%. The student is therefore trained mostly on the examples the teacher finds clear.

Example
Level 3: a realistic CIFAR-100 result from Table 2

For DenseNet-80-80 on CIFAR-100, the teacher's test error is 17.16%, its first born-again student (BAN) has 16.36%, and the third generation (BAN-3) has 15.5%.

  1. Gain from the first generation: 17.16−16.36=0.8017.16 - 16.36 = 0.80 percentage points.
  2. Relative gain: 0.80/17.16≈0.0470.80 / 17.16 \approx 0.047, so about 4.7% fewer errors.
  3. Gain from three generations: 17.16−15.5=1.6617.16 - 15.5 = 1.66 percentage points.
  4. Relative gain: 1.66/17.16≈0.0971.66 / 17.16 \approx 0.097, so about 9.7% fewer errors.

Interpretation: the first generation gives most of the gain on this architecture, and the later generations add a smaller amount. The paper says that the sequence "saturates" after a few generations, which is what this progression shows. The student has the same size as the teacher, so these gains do not come from compression.

Try it: DenseNet-90-60 goes from a teacher error of 17.69% to a BAN error of 16.69%. What is the relative reduction in errors? Answer: 1.00/17.69≈0.05651.00 / 17.69 \approx 0.0565, so about 5.7%.

Results

The paper reports test error on CIFAR-10 and CIFAR-100 for several architectures, and perplexity on the Penn Tree Bank. The main numbers, copied from its tables:

  • CIFAR-10 (Table 1). DenseNet-90-60 has a teacher error of 3.81%; its BAN has 3.5%. The abstract's 3.5% comes from this row. Across the table, the BAN is lower or equal in most rows, but not all: for Wide-ResNet-28-10 the teacher is 3.77% and the BAN is 3.86%.
  • CIFAR-100 (Table 2). The best single model is BAN-3 on DenseNet-80-80, at 15.5%. Removing the label term (BAN) beats the version that keeps it (BAN+L) in all four DenseNet rows. The largest ensemble in Table 2, three generations on DenseNet-80-120, reaches 14.9%.
  • Different architectures (Table 3). A Wide-ResNet-28-10 teacher with 19.08% error gives a BAN of 18.25%. A DenseNet-90-60 student trained from a Wide-ResNet-28-10 teacher reaches 16.79%.
  • DenseNet teacher, ResNet students (Table 5). A Wide-ResNet-4-0.5 trained from labels has 19.63% error. The same architecture trained from a DenseNet-90-60 teacher reaches 17.13%, which is below that teacher's own 17.69% error (Table 4).
  • Language modelling (Table 6). On the Penn Tree Bank, an LSTM teacher with test Perplexity 71.87 gives a BAN+L student with 68.56 (lower is better). The smaller CNN-LSTM goes from 80.05 to 76.97 (Table 6, test perplexity). The paper found that the LSTM only worked when the label term was kept.

Limits. The tables give one number per cell with no error bars, so differences of a few tenths of a point cannot be judged reliably from the paper alone. The abstract calls the CIFAR error rates "validation error", while the table captions say test error; a reader should check which one a given number refers to. Gains are not uniform: some Wide-ResNet rows get worse, and the sequence costs several full training runs. The paper also does not fully isolate the mechanism. The two ablations, CWTM and DKPP, both improve on the teacher in many rows, so the paper concludes that the gain "cannot be fully attributed" to the classical dark-knowledge story, but it does not say what the gain is attributed to instead.

Reading guide

The paper is short and reads well in order. Each section leans on a different set of prerequisites.

Check yourself

QuestionIn one sentence, how does a born-again student differ from the student in classic knowledge distillation?Show answer

A born-again student has the same architecture as its teacher, so it is not compressed. A classic distillation student is usually smaller than its teacher, and the distillation is used to make that small model accurate.

QuestionFor one example, the teacher's probability for the true class is p∗=0.5p_{*} = 0.5 and the student's is q∗=0.3q_{*} = 0.3. Compute the gradient on the true-class score from the label alone, and from the teacher. Use q∗−1q_{*} - 1 and q∗−p∗q_{*} - p_{*}.Show answer

From the label: q∗−1=0.3−1=−0.7q_{*} - 1 = 0.3 - 1 = -0.7. From the teacher: q∗−p∗=0.3−0.5=−0.2q_{*} - p_{*} = 0.3 - 0.5 = -0.2. The teacher's push on the true class is weaker, because the teacher itself is only half sure of that class.

QuestionThe DKPP treatment permutes the teacher's non-argmax probabilities. Why does the paper care that DKPP still improves on the teacher?Show answer

DKPP keeps the teacher's top class and the overall spread of its probabilities, but it scrambles which wrong class receives which probability, so the pairwise similarities between classes are destroyed. If the student still improves, the gain cannot come only from the information about which wrong classes are close to the right one. That is evidence against the simplest version of the dark-knowledge explanation.

QuestionYou have a teacher with 50 million parameters and a student budget of 1 million parameters. Is this a born-again setup? What would you need to change to make it one, and what would it cost?Show answer

No. Born-again networks use an identical architecture, so a 1-million-parameter student from a 50-million-parameter teacher is classic distillation. To make it a born-again setup you would need a 50-million-parameter student, which removes the compression benefit, and you would need to train the teacher and then every generation at full size. The paper's results show gains at that size, but the cost is several full training runs, not one smaller run.

Sources

Read the full paper

Tommaso Furlanello, Zachary C. Lipton, Michael Tschannen et al., 2018. arXiv:1805.04770