Knowledge Distillation Loss

medium
Unit 22 · Distillation0/2 to milestone

Knowledge distillation trains a small student model to mimic a large teacher. Instead of only learning from hard labels, the student matches the teacher's softened probability distribution, which carries "dark knowledge" about which wrong answers are nearly right.

Pro problem

Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.

Start 7-day free trial
solution.py · Python 3.13
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Knowledge Distillation Loss · TechGradify