On real handwritten digits, a small student trained on a teacher's soft predictions over all data nearly matches the teacher and beats one trained on only a few hard labels.
Trained from scratch in Ropedia Academy — an interactive, bilingual course on embodied & spatial AI. Educational model: small and quick to train; the value is the method and a reproducible pipeline, not a leaderboard score. Try it live in the Ropedia demos Space.
Teacher: Adam (lr 2e-3), 800 steps. Student: Adam (lr 3e-3), 1500 steps; KL distillation at T=4 (loss ×16).
| metric | value | meaning |
|---|---|---|
teacher | 0.9704 | teacher test accuracy on held-out digits |
student_plain (final) | 0.9056 | |
student_distill (final) | 0.9685 |

Single-run numbers above are one seed; this is the distribution over independent re-trains (honest variance — no cherry-picking).
| metric | mean ± std |
|---|---|
teacher | 0.9707 ± 0.0018 |
student_plain | 0.9 ± 0.0026 |
student_distill | 0.9681 ± 0.003 |

import torch, torch.nn as nn
teacher = nn.Sequential(nn.Linear(64,256), nn.ReLU(), nn.Linear(256,256), nn.ReLU(), nn.Linear(256,10))
teacher.load_state_dict(torch.load("teacher.pt", map_location="cpu")); teacher.eval()
# x: flattened 8x8 digit /16.0, shape (N,64) -> logits = teacher(x); pred = logits.argmax(-1)
Educational scale. Trained quickly on CPU on small or synthetic data, so absolute numbers are not competitive with production systems — the value is the method and a reproducible pipeline. No large-scale data, no hyperparameter sweep, and no multi-seed variance is reported. Not for production use.
On 8×8 digits; the gain shrinks if the task is easy or the student is large; sensitive to temperature.
No benefit if the task is too easy or the student is already big enough; a wrong temperature washes out or over-sharpens the soft targets.
One click: open the notebook in Colab → Runtime → GPU → Run all, then run its Publish to the Hugging Face Hub cell.
From a shell:
git clone https://github.com/ChaoYue0307/ropedia-academy.git && cd ropedia-academy
pip install torch numpy matplotlib scikit-learn scikit-image gymnasium
jupyter nbconvert --to notebook --execute notebooks/training/LM_distillation.ipynb --output run.ipynb
# optional: override training length, e.g. STEPS=2000 (or EPISODES=600) before running
figure.pngmetrics.jsonseeds.pngteacher.ptCode & weights: MIT (this repository) — educational use encouraged.
Handwritten-digits data: UCI ML Repository via scikit-learn — CC BY 4.0.
If you use this model or the course materials, please cite:
@misc{ropedia_academy,
title = {Ropedia Academy: an interactive course on embodied & spatial AI},
author = {Ropedia Academy},
year = {2026},
howpublished = {\url{https://chaoyue0307.github.io/ropedia-academy/}}
}
Method / original work: Hinton, Vinyals & Dean, Distilling the Knowledge in a Neural Network, NeurIPS-W 2015.
Part of the Ropedia Academy trained-model collection. Contributions & issues welcome on GitHub.
6 commits
On real handwritten digits, a small student trained on a teacher's soft predictions over all data nearly matches the teacher and beats one trained on only a few hard labels.
Trained from scratch in Ropedia Academy — an interactive, bilingual course on embodied & spatial AI. Educational model: small and quick to train; the value is the method and a reproducible pipeline, not a leaderboard score. Try it live in the Ropedia demos Space.
Teacher: Adam (lr 2e-3), 800 steps. Student: Adam (lr 3e-3), 1500 steps; KL distillation at T=4 (loss ×16).
| metric | value | meaning |
|---|---|---|
teacher | 0.9704 | teacher test accuracy on held-out digits |
student_plain (final) | 0.9056 | |
student_distill (final) | 0.9685 |

Single-run numbers above are one seed; this is the distribution over independent re-trains (honest variance — no cherry-picking).
| metric | mean ± std |
|---|---|
teacher | 0.9707 ± 0.0018 |
student_plain | 0.9 ± 0.0026 |
student_distill | 0.9681 ± 0.003 |

import torch, torch.nn as nn
teacher = nn.Sequential(nn.Linear(64,256), nn.ReLU(), nn.Linear(256,256), nn.ReLU(), nn.Linear(256,10))
teacher.load_state_dict(torch.load("teacher.pt", map_location="cpu")); teacher.eval()
# x: flattened 8x8 digit /16.0, shape (N,64) -> logits = teacher(x); pred = logits.argmax(-1)
Educational scale. Trained quickly on CPU on small or synthetic data, so absolute numbers are not competitive with production systems — the value is the method and a reproducible pipeline. No large-scale data, no hyperparameter sweep, and no multi-seed variance is reported. Not for production use.
On 8×8 digits; the gain shrinks if the task is easy or the student is large; sensitive to temperature.
No benefit if the task is too easy or the student is already big enough; a wrong temperature washes out or over-sharpens the soft targets.
One click: open the notebook in Colab → Runtime → GPU → Run all, then run its Publish to the Hugging Face Hub cell.
From a shell:
git clone https://github.com/ChaoYue0307/ropedia-academy.git && cd ropedia-academy
pip install torch numpy matplotlib scikit-learn scikit-image gymnasium
jupyter nbconvert --to notebook --execute notebooks/training/LM_distillation.ipynb --output run.ipynb
# optional: override training length, e.g. STEPS=2000 (or EPISODES=600) before running
figure.pngmetrics.jsonseeds.pngteacher.ptCode & weights: MIT (this repository) — educational use encouraged.
Handwritten-digits data: UCI ML Repository via scikit-learn — CC BY 4.0.
If you use this model or the course materials, please cite:
@misc{ropedia_academy,
title = {Ropedia Academy: an interactive course on embodied & spatial AI},
author = {Ropedia Academy},
year = {2026},
howpublished = {\url{https://chaoyue0307.github.io/ropedia-academy/}}
}
Method / original work: Hinton, Vinyals & Dean, Distilling the Knowledge in a Neural Network, NeurIPS-W 2015.
Part of the Ropedia Academy trained-model collection. Contributions & issues welcome on GitHub.
6 commits