Online & Mutual Distillation
Distillation without a pre-trained teacher: deep mutual learning, online knowledge distillation, born-again networks, co-distillation, and ensemble distillation — when and why these outperform standard teacher-student frameworks.
Prerequisites
Table of Contents
- Learning Objectives
- Notation
- Core Intuition
- Deep Mutual Learning (DML)
- Born-Again Networks (BAN)
- Co-Distillation
- Online Knowledge Distillation (ONE)
- Ensemble Distillation
- When Online Beats Offline
- Common Pitfalls
- Summary
- Exercises
Learning Objectives
- Explain how two models can teach each other without a pre-trained teacher.
- Derive the DML objective and its connection to mutual regularization.
- Describe born-again networks and the surprising improvement across generations.
- Analyze when online distillation outperforms standard offline distillation.
- Design ensemble distillation pipelines for deployment.
Notation
- — parameters of two peer networks
- — their respective predictions
- Generation — the -th iteration of born-again training
Core Intuition
Standard distillation requires a large pre-trained teacher — expensive to train and maintain. Online distillation eliminates this requirement: two (or more) models teach each other simultaneously during training. Surprisingly, two identical models training together outperform each individually, because each model's "noise" provides regularization for the other. It's like study buddies who learn better together than alone.
Online / Mutual Distillation
Deep Mutual Learning (DML)
Zhang et al. (2018): Train two networks simultaneously, each teaching the other:
Key insight: Even though neither model is better than the other, the KL term provides:
- Regularization: Each model is pulled toward the other (prevents overconfidence).
- Diversity: Different initializations → different mistakes → complementary knowledge.
- Smoothing: The peer's soft predictions are a form of label smoothing.
Result: Both models outperform training alone by 1-2% on CIFAR/ImageNet.
Extension to peers: Each model is distilled from the average of all others:
Born-Again Networks (BAN)
Furlanello et al. (2018): Iteratively distill a model into itself:
- Generation 0: Train model from scratch.
- Generation 1: Train (same architecture) distilled from .
- Generation 2: Train distilled from .
- Continue...
Surprising result: , (consistent improvement across generations).
Why it works:
- The teacher provides smoothed labels → implicit regularization.
- Different random initialization finds a different (potentially better) local minimum.
- The label smoothing effect prevents the new model from overfitting.
Saturation: Improvements diminish after 2-3 generations. Typical gain: 0.5-1% total.
Ensemble Born-Again: Average predictions from all generations: . Better than any individual generation.
Co-Distillation
Anil et al. (2018, Google): Distill between models training on different shards of data:
- Train models on different data shards simultaneously.
- Periodically: each model generates soft labels on other models' shards.
- Each model trains on: its own hard labels + others' soft labels.
Connection to distributed training: Co-distillation is an alternative to gradient aggregation in data-parallel training. Instead of averaging gradients, average soft predictions.
Advantages over AllReduce:
- Communication-efficient (send soft labels, not gradients).
- Asynchronous (no synchronization barrier).
- Heterogeneous (models can have different architectures/sizes).
Online Knowledge Distillation (ONE)
Zhu et al. (2018): Create a "multi-branch" network with shared backbone and prediction heads:
Training: Each branch is distilled from the ensemble:
Deployment: Remove branches; keep only the shared backbone + one head. The backbone has been improved by the ensemble training signal.
Advantage: Single-model training cost (shared backbone) with ensemble benefit.
Ensemble Distillation
Combine multiple models into a single deployable model:
Why ensemble teachers are powerful:
- Ensembles provide better-calibrated predictions (uncertainty).
- The diversity among ensemble members encodes model uncertainty.
- The student learns both the prediction AND the uncertainty.
Uncertainty distillation: Beyond average predictions, distill the VARIANCE of the ensemble:
When Online Beats Offline
Online (DML, co-distillation) is better when:
- No pre-trained teacher available (fresh training from scratch).
- Training budget allows only one training run.
- Models must be different architectures (heterogeneous DML).
- Data is distributed across shards (federated/distributed settings).
Offline (standard KD) is better when:
- A high-quality teacher already exists.
- Significant capacity gap (teacher much larger than student).
- The teacher provides information the student CANNOT discover on its own.
Common Pitfalls
Pitfall 1. Using DML with very different capacity models. If one model is much larger, it dominates and the smaller model just follows — losing the mutual benefit. Use similar-capacity peers.
Pitfall 2. Too many born-again generations. After 2-3 generations, the model converges to a fixed point. Additional generations waste compute with negligible improvement.
Pitfall 3. Not using temperature in online distillation. Even with peers (not a strong teacher), temperature – on the KL term improves results by revealing inter-class structure.
Summary
- DML: Two peers teach each other via KL; both improve 1-2%.
- Born-Again: Self-distillation across generations; consistent improvement.
- Co-Distillation: Distill across data shards (communication-efficient distributed training).
- ONE: Multi-branch with shared backbone; ensemble signal improves single model.
- Ensemble distillation: Compress models into 1 model.
- Online methods eliminate the need for a pre-trained teacher.
Exercises
Exercise 1. For DML with 2 ResNet-32 models on CIFAR-100: estimate the additional training cost (FLOPs) vs single model training.
Exercise 2. Prove that the DML objective encourages the two models to agree (KL = 0 when identical) while the CE ensures they remain accurate.
Exercise 3. Train born-again networks for 4 generations on MNIST. Plot accuracy vs generation number. Does it converge?
Exercise 4. For co-distillation with 4 models on 4 data shards: compute the communication cost vs AllReduce for a 7B model.
Exercise 5. Design an experiment to determine whether born-again improvement comes from (a) implicit label smoothing, (b) different initialization, or (c) curriculum effect.