TT Lab
Blog

한국어 English 日本語 中文

Get started
Blog

Blog

Knowledge Distillation: Transferring What a Large Model Knows to a Small Model — Plus "Recorded Teacher → Real-Time Student"

Status: Draft (2026-10-13). Paper numbers were verified by opening the original texts and checking their conditions. The hands-on portion is a toy example on a laptop CPU (code/04_distill_toy.py, 2–3 minutes). The "Recorded Teacher → Real-Time Student" distillation for TT Score is at the planning stageand has not yet been implemented on actual table tennis data (ongoing research, unmeasured). Part 4 of the series "Reading Vision Models 2." Part 2's DINO was already "self-distillation": Self-Supervised Learning 1.

Table of Contents

1. Intuition: A Teacher That Gives Only the Answer vs. a Teacher That Explains Why You Might Get Confused

If you show a handwritten digit "2" and say only "The answer is 2," the student learns to treat 2 and the other nine digits as equally different. However, when you show the same image to a well-trained large model, it responds like this: "Probability 0.97 of being 2, probability 0.02 of being 3, probability 0.009 of being 7, and nearly 0 for the rest." There is information in these small numbers. This 2 is slightly similar to 3 or 7, and not at all similar to 4. This is information not found in the ground-truth label.

Hinton et al. (2015) called this "dark knowledge" and proposed using the probability outputs of a large model (the teacher) as targets for a small model (the student). This is knowledge distillation . The student is much smaller and faster than the teacher, inheriting the "map of similarities" built by the teacher in return.

2. How to Train

Softening with Temperature

The probabilities of a well-trained teacher are usually close to 0 or 1. Values like 0.009 in the example above have no presence in the loss. Therefore, logits are divided by a temperature T before being fed into the softmax function (the same knob as τ in Part 1, but used with a larger value in the opposite direction).

p_교사(T) = softmax(z_교사 / T),   p_학생(T) = softmax(z_학생 / T)
L = (1 − α) · CE(정답, p_학생(1))  +  α · T² · KL(p_교사(T) ‖ p_학생(T))

Transfer Set: Labels Are Not Required

The distillation term does not require ground-truth labels. If you feed any input into the teacher, its output serves directly as the target. Therefore, the data used to train the student (the transfer set) can be unlabeled data. This property is the core of our plan at the end of this post.

What to Match: Outputs, Intermediate Features, Tokens

3. Diagram: Our Plan

녹화본 교사 → 실시간 학생(계획) 시간 축(프레임), 판단할 순간 t t 교사: 앞뒤를 다 본다(녹화본) 학생: 과거 + 짧은 앞보기 앞보기 ≤ 200ms 라벨 단 랠리 적다(사람이 찍음) 녹화본 많다(라벨 없음) 교사 학습 크고 느려도 됨 교사가 단 부드러운 라벨 학생 학습 사람 + 교사 라벨 작고 빨라야 함 증류가 메우는 것: 데이터가 모자라서 생긴 차이 메우지 못하는 것: 학생이 볼 수 없는 미래의 정보
Diagram: A plan where a recorded teacher labels unlabeled rallies, and a real-time student learns from them

TT Score judgment has two use cases: real-time judgment, which displays scores on the screen during a match, and recorded analysis, which re-analyzes videos after the match ends. The two have different constraints.

Real-Time Student Recorded Teacher
Accessible Timeframe Up to the judgment moment + short lookahead (200ms or less) Entire rally (both before and after)
Computation Budget 5ms or less allocated for the new module out of 16.7ms per frame at 60fps Plentiful (once at the end of the rally, or overnight)
Model Must be small Can be large

The recorded version will likely be more accurate because it can make judgments by seeing where the ball goes even after a bounce. If that teacher labels hundreds of unlabeled recordings, the real-time student can learn from far more examples than rallies manually labeled by humans. This plan is noted in the research notes as "Two Tracks (Best Real-Time, Best Recorded) and Distillation," and has not yet been executed (ongoing research).

4. Hands-On

code/04_distill_toy.py was run on a laptop CPU (outputting code/04_distill_toy.out.txt).

A. A Miniature Version of Classical Distillation

This is a 10-class classification task with mutually similar pairs (0 and 5, 1 and 6, etc.). The teacher (278,000 parameters) was trained with 3,000 labels, achieving a test accuracy of 0.856. The student has 754 parameters (0.27% of the teacher).

"Dark knowledge" is revealed when examining the teacher's outputs across temperatures (test image where the true label is 7).

T=1 → [0.    0.    0.    0.    0.    0.    0.    1.    0.    0.   ]
T=4 → [0.005 0.004 0.006 0.    0.001 0.    0.008 0.962 0.002 0.012]

At T=1, only the correct answer is visible, but when softened with T=4, information emerges showing that class 7 is slightly similar to classes 6 and 9, and hardly similar to classes 3 and 5.

Student Training Method (Average of 3 seeds [Range]) Test Accuracy
(1) Only 150 labels 0.829 [0.828–0.831]
(2) 150 labels + Teacher T=1 0.833 [0.832–0.835]
(2) 150 labels + Teacher T=4 0.850 [0.846–0.853]
(2) 150 labels + Teacher T=8 0.844 [0.842–0.847]
(3) 0 labels + Unlabeled transfer set of 3,000 (T=4) 0.854 [0.850–0.861]

Using the teacher's output directly at T=1 yielded almost no effect, while softening to T=4 improved accuracy by about 2 percentage points. Furthermore, without using a single human label, without using any human labels a student trained solely on outputs generated by the teacher for 3,000 unlabeled data points reached 0.854, nearly matching the teacher (0.856)—even though the student's size is 0.27% of the teacher's.

We also replicated one of Hinton et al.'s famous experiments: removing all samples appearing to be the digit 3 from the transfer set. The student never sees the digit 3 as a "correct answer."

전이 세트에서 3번을 뺀 학생: 3번 재현율 0.066, 전체 0.774
  3번 출력의 치우침(bias)만 +8 올리면: 3번 재현율 0.905, 전체 0.845

Although it can barely recognize 3, boosting just the bias for 3 allows it to get 90% correct. The student learned what the digit 3 looks like from the "similarity to 3" mixed into the outputs of other numbers. Note that the bias value was chosen for demonstration by looking at the test set. The original paper's MNIST experiment followed the same direction (table below).

B. Recorded Teacher → Real-Time Student

This is the problem of finding bounce frames from ball height sequences (60fps, positional noise, 10% dropped frames, slow jitter simulating camera parallax). We also mixed in shots where the ball hits the racket and changes direction, making it impossible to be certain whether it's a bounce based solely on the deflection shape.

Student (Average of 3 seeds [Range]) 0 Lookahead 3 Lookahead Frames
Teacher (8 frames before/after, 20 labeled rallies) 0.923 [0.915–0.929] ← Same
Only 20 human-labeled rallies 0.860 [0.852–0.871] 0.875 [0.857–0.897]
+ 300 rallies labeled by teacher 0.886 [0.882–0.890] 0.886 [0.879–0.897]
Reference: + 300 human-labeled rallies (Upper Bound) 0.892 [0.885–0.895] 0.886 [0.877–0.902]

The 0-lookahead student improved from 0.860 to 0.886 using the teacher's labels, which is nearly identical to the performance when humans directly labeled the same 300 rallies (0.892). The teacher effectively replaced 300 human-labeled rallies. The 3-lookahead student also reached 0.886, but started from a higher baseline, so the gain was smaller.

The gap with the teacher (0.923) was not closed by distillation. No teacher, no matter how good, can transfer information contained in the future that the student cannot see. Distillation bridges the "gap caused by insufficient data," not the "gap caused by insufficient input." This distinction determines what we can and cannot expect from our plan.

5. Paper Statistics

Paper Task Metric (Paper)
Hinton et al. 2015 MNIST: Teacher (1200-1200, dropout) / Student (800-800) 67 / 146 errors → Distilled to student with T=20 gives 74 errors
〃 MNIST: Removed 3 from transfer set 206 errors (133 of which were 3) → 109 errors with bias +3.5 for 3, 98.6% accuracy on test 3s
〃 Speech Recognition: Single / 10-model Ensemble / Distilled Single Frame accuracy 58.9% / 61.1% / 60.8%, word error rate 10.9% / 10.7% / 10.7%. Transferred over 80% of ensemble gains (T=2)
FitNets (2015) CIFAR-10 Thin and deep student (19 layers, ~2.5M) outperformed teacher (~9M, 90.18%) with 91.61%
DeiT (2021) ImageNet, ViT-B Student Matching teacher's final answers (hard) at 83.0% outperformed probabilities (soft) at 81.8%. Convolutional teacher (RegNetY-16GF) outperformed Transformer teacher. 85.2% (384px) with distillation token in 1000 epochs. One 8-GPU server without external data
Beyer et al. 2022 ImageNet, ResNet-50 Student Applying identical crops and mixupto teacher and student (consistency) and training for 9,600 epochs (patience) → 82.8%(Ensemble of two-resolution teachers; single teacher is 82.3%). Uses only KL divergence without ground-truth labels. Precomputing teacher outputs actually degrades performance
Noisy Student (2020) ImageNet, teacher labels 300M unlabeled images Iterated 3 times with a student larger than the teacher and noise (dropout, stochastic depth, strong augmentation) → EfficientNet-L2 88.4%, ImageNet-A 61.0 → 83.7%
EfficientAT (2023) Audio tagging, Transformer ensemble → MobileNetV3 (4.88M) Baseline mAP .401, distillation .458, distillation + pretraining .470. Label loss weight of 0.1 is optimal; 0 degrades performance. 61x faster than teacher
DWPose (2023) Whole-body pose, RTMPose-l student 64.8 → 66.5 AP, outperforming teacher RTMPose-x (65.3)
DINOv2 (2023) ViT-L from scratch / Distillation from ViT-g Linear evaluation 84.5% / 86.3%

A few things stand out.

6. Limitations

7. Connection to Our Project

TT's Word. If a coach who watched the match to the end marks "this was a bounce" across hundreds of rallies, even a student watching only in real-time learns quite well. Still, since it cannot teach the future that has not arrived yet, the student remains slightly less skilled than the coach.

References

Sign in to like

Comments

No comments yet.

Sign in to leave a comment