Home Knowledge Base Knowledge Distillation

Knowledge Distillation is the model compression technique where a smaller "student" network is trained to mimic the behavior of a larger, more capable "teacher" network — transferring the teacher's learned knowledge through soft probability distributions (soft labels) rather than hard ground-truth labels, enabling the student to achieve accuracy approaching the teacher's while being 3-10x smaller and faster at inference.

Why Soft Labels Carry More Information

A hard label for a cat image is simply [1, 0, 0, ...]. The teacher's soft output might be [0.85, 0.10, 0.03, 0.02, ...] — revealing that this cat slightly resembles a dog, less so a fox, even less a rabbit. These inter-class relationships (dark knowledge) provide richer training signal than hard labels alone. The student learns the teacher's similarity structure over the entire output space, not just the correct class.

Distillation Loss

The standard distillation objective combines soft-label and hard-label losses:

L = α × KL(σ(z_t/T), σ(z_s/T)) × T² + (1-α) × CE(y, σ(z_s))

Where z_t and z_s are teacher and student logits, T is the temperature (typically 3-20) that softens probability distributions, σ is softmax, KL is Kullback-Leibler divergence, CE is cross-entropy with ground truth y, and α balances the two terms. Higher temperature reveals more of the teacher's inter-class knowledge.

Distillation Approaches

LLM Distillation

Distillation is critical for deploying large language models:

Knowledge Distillation is the bridge between model capability and deployment practicality — extracting the essential learned knowledge from computationally expensive models into efficient ones that can run on mobile devices, edge hardware, and latency-constrained production environments.

model distillation knowledgeteacher student networkknowledge transfer distillationsoft label distillationdistillation training

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.