Teacher (GPT-4, 175B) โ Student (7B) via Full Distillation
Distillation Flow
๐ง
Teacher
GPT-4 ยท 175B params
produces soft labels ฯ=4
โ
soft labels (ฯ=4)
๐
Student
7B params
VRAM: 16 GB full training
At ฯ=4: probability distribution is softened - the student learns richer inter-class relationships, not just the argmax. Higher ฯ = more information transferred per token.
Loss Curves Over 5 Epochs
Hard labels
Soft labels (distillation)
Epoch - soft labels converge 1.1ร faster
Compression
25ร
Acc Retention
91%
Latency Speedup
2.9ร
VRAM
16 GB
Student Size
Distillation Mode
Student trained end-to-end on teacher soft labels. Best quality.
Temperature (ฯ)4
1 (hard)10 (soft)
Training Epochs5
28
Key Insight
Soft labels carry dark knowledge: the teacher's uncertainty about wrong classes teaches the student richer representations than one-hot targets.
Knowledge distillation compresses large teacher models into smaller, faster student models by training on soft probability distributions rather than hard labels. Soft labels from a teacher encode inter-class relationships - the model's uncertainty - that one-hot labels discard. The result is a student that punches above its size, retaining most of the teacher's accuracy at a fraction of the inference cost.
Soft labels: see how teacher output probabilities contain richer signal than hard class labels
Temperature scaling: higher temperature flattens the distribution, revealing more dark knowledge
Latency tradeoff: student models serve 5-10x faster at the same hardware tier
Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.