How does knowledge distillation work?
mediumAnswer
- Train a small 'student' network to match the outputs (usually soft probabilities at high temperature T) of a large pretrained 'teacher'.
- .
- The soft targets carry more information than hard labels (they encode inter-class similarities), so the student often achieves 90-95% of the teacher's accuracy at 5-10x smaller size.
- Foundational for model compression, mobile deployment, MLM speedups (DistilBERT).
Check yourself — multiple choice
- Train two teachers
- Small student matches teacher's soft probs at high T → carries inter-class info; used for compression (DistilBERT)
- Same as fine-tuning
- Only for CNNs
KD: student learns from teacher's soft probs at high temperature → strong compression.
#distillation
Practise Deep Learning
214 interview questions in this topic.
Related questions
- What does temperature do in a softmax?
- What is an EMA of weights and why do modern training recipes use it?
- What are the main pruning techniques for neural networks?
- What is LoRA and why is it the standard for parameter-efficient fine-tuning?
- You need to halve inference cost. Do you quantize, prune, or distill?