Dynamic Temperature Scheduler for Knowledge Distillation

Sibgat Ul Islam, Jawad Ibn Ahad, Fuad Rahman, Mohammad Ruhul Amin, Nabeel Mohammed, Shafin Rahman

✅ Accepted at IEEE International Conference on Big Data 2025

📄 Paper: arXiv:2511.13767 · IEEE Xplore


Abstract

We introduce the Dynamic Temperature Scheduler (DTS) for knowledge distillation (KD), a method that adaptively adjusts the softening temperature during training based on the cross-entropy loss gap between teacher and student models. Fixed-temperature KD is suboptimal: early training benefits from high T (softer distributions for broad learning) while later training requires low T (sharper distributions for precise mimicry). DTS eliminates manual temperature tuning and integrates seamlessly as a drop-in replacement for any existing KD method. Validated across vision (CIFAR-100, Tiny-ImageNet) and NLP tasks (GLUE, Dolly, SelfInst), DTS consistently improves performance over AKD and CTKD baselines and provides additive gains on top of DKD, MLKD, CRD, and other state-of-the-art KD methods.


Introduction

Knowledge distillation trains a student model to match the teacher’s soft probability distributions. The temperature T controls distribution softness:

  • High T → soft distributions → student learns broad inter-class relationships early in training
  • Low T → sharp distributions → student learns precise discrimination in later stages

Problem: No single fixed T is optimal across all training steps. Grid search for T is expensive, and heuristic schedules (AKD, CTKD) are not responsive to actual learning dynamics.

DTS Solution: Monitor the teacher-student loss divergence at each batch and adapt T accordingly — no hyperparameter search required.


🎯 Key Contributions

  • Loss-Adaptive Temperature — T updated each batch based on divergence d_loss = L_t − L_s between teacher and student cross-entropy losses.
  • Cosine + Momentum Schedule — Cosine decay provides smooth base annealing; momentum averaging prevents abrupt changes.
  • Plug-and-Play — Works with any existing KD method (KD, DKD, MLKD, CRD, FitNet, AT) without architectural changes.
  • No Grid Search — Removes costly T hyperparameter sweep entirely.
  • Cross-Domain Validation — Vision (CNN, ViT) + NLP (GPT-2, OPT, BERT) tasks validated.

Methodology

DTS Overview

Figure: DTS update mechanism. At each training step: (1) compute loss divergence between teacher and student; (2) scale via adaptive α; (3) apply cosine decay; (4) clamp to [T_min, T_max]; (5) apply momentum smoothing for stable temperature update.

DTS Formula

Step 1 — Cosine Scheduling:

p = e_c / e_t                        (progress ∈ [0,1])
S(p) = 0.5 · (1 + cos(π · p))       (ranges 1.0 → 0.0)

Step 2 — Loss Divergence Adaptive Scaling:

d_loss = L_teacher − L_student

If L_s > L_t (student worse than teacher):
    α = d_loss / (d_loss + 1 + β)       (β prevents ÷0)

If L_s < L_t (student better):
    α = −d_loss / (−d_loss + 1 + β)    (still > 0)

Step 3 — Clamped Temperature:

x = T_init · S(p) · α
T_clamped = clamp(x, T_min, T_max)

Step 4 — Momentum Smoothing:

T_current = μ · T_prev + (1 − μ) · T_clamped      (μ = 0.9)

📊 Table II — CIFAR-100 Cross-Architecture (Acc %)

TeacherStudentAKDCTKDKD+DTS
VGG13 (74.64)VGG8 (70.36)67.8172.0272.77
ResNet50 (79.34)MN-V2 (64.60)53.8663.1763.24
ResNet56 (72.34)ResNet20 (69.06)68.1369.5170.98
ResNet110 (74.31)ResNet32 (71.14)70.3472.0572.20
VGG13 (74.64)MN-V2 (64.60)52.5362.2862.44
ResNet110 (74.31)ResNet20 (69.06)68.2369.4969.58

📊 Table III — CIFAR-100 Same-Architecture, Multiple KD Methods (Acc %)

MethodResNet32x4 → ResNet8x4ResNet56 → ResNet20ResNet110 → ResNet20WRN-40-2 → WRN-16-2VGG13 → VGG8ResNet110 → ResNet32
Feature Distillation      
FitNet73.5069.2168.9973.5871.0271.06
AT73.4470.5570.6574.0871.4372.31
RKD71.9069.6169.2573.3571.4871.82
CRD75.5171.1671.4675.4873.9473.48
OFD74.9570.9871.2975.2473.9573.23
ReviewKD75.6371.8971.3476.1274.8473.89
SimKD78.0871.0571.0675.5374.8973.92
CAT-KD76.9171.6271.3775.6074.6573.62
Logit Distillation      
KD72.5969.5669.2873.1270.3371.75
KD + DTS72.7070.3169.5873.6372.7172.20
Δ (KD→DTS)+0.11+0.75+0.30+0.51+2.38+0.45
DKD74.7269.5569.3174.5373.9769.89
DKD + DTS74.7369.9869.4374.6074.0370.27
Δ (DKD→DTS)+0.01+0.43+0.12+0.07+0.06+0.38
MLKD75.0370.8570.3275.1870.5270.32
MLKD + DTS75.2570.9870.5875.5871.0770.54
Δ (MLKD→DTS)+0.22+0.13+0.26+0.40+0.55+0.22

📊 Table IV — CIFAR-100 Cross-Architecture, DTS on Top of KD Methods (Acc %)

TeacherStudentMethodAcc %Δ
ResNet32x4 (79.42)SHN-V2 (71.82)KD71.48
  KD + DTS71.76+0.28
  DKD + DTS73.33–0.30
ResNet50 (79.34)MN-V2 (64.60)KD62.68
  KD + DTS63.24+0.56
  DKD + DTS66.18+0.03
ResNet32x4 (79.42)VGG8 (70.36)KD69.95
  KD + DTS71.45+1.50
  MLKD + DTS73.35+0.62
WRN-40-2 (75.61)SHN-V2 (71.82)KD69.93
  KD + DTS71.35+1.42
  MLKD + DTS74.24+0.10
VGG13 (74.64)MN-V2 (64.60)KD60.83
  KD + DTS62.44+1.61
  MLKD + DTS66.74+0.09

📊 Table V — Tiny-ImageNet Results (Acc %)

(a) CNN-based Student Models:

TeacherStudentKDKD + DTST_max → T_min
ResNet34 (65.47)ResNet18 (60.34)57.8260.754→2
ResNet50 (67.06)MN-V1 (59.50)56.8461.184→2

(b) ViT-based Student Models (Teacher: ResNet50):

StudentKDKD + DTST_max → T_min
DeiT-Ti68.4268.584→2
T2T-ViT-764.0364.604→2
PvT-Ti72.0172.693→1
PiT-Ti74.0474.183→1

📊 Table VI — NLP Tasks: ROUGE-L Scores

TeacherStudent (Params)MethodDollySelfInstS-NIUnNIVicuna
GPT-2 (1.5B)Teacher27.614.327.631.816.3
 GPT-2 (120M)SFT w/o KD23.310.014.718.516.3
  KD21.889.7414.8818.4613.92
  KD + DTS21.489.8216.1619.6613.95
  SeqKD22.279.4714.8317.3714.90
  SeqKD + DTS21.3010.8915.5418.7714.15
OPT (1.3B)Teacher26.011.423.128.415.6
 OPT (125M)KD19.418.0615.3017.5213.65
  KD + DTS19.918.4615.6419.6614.05
  SeqKD20.148.2415.5217.9814.64
  SeqKD + DTS20.338.9516.7418.2513.58

📊 Table VII — GLUE Tasks: TinyBERT-4L-312D from BERT_base_uncased

MethodCoLA (MCC)MRPC (Acc)RTE (Acc)
SFT0.5287.0072.00
TinyBERT0.3583.5767.14
with OP0.3684.3167.87
OE + OP0.3984.3366.06

📚 Citation

@inproceedings{islam2025dts,
  title={Dynamic Temperature Scheduler for Knowledge Distillation},
  author={Islam, Sibgat Ul and Ahad, Jawad Ibn and Rahman, Fuad and Amin, Mohammad Ruhul and Mohammed, Nabeel and Rahman, Shafin},
  booktitle={IEEE International Conference on Big Data (BigData)},
  year={2025}
}