Manuscript Offprint
arXiv:2608.29099Temperature-Adaptive Transformed Teacher Matching
Abstract
Temperature scaling is a core component of knowledge distillation, yet its role and effect are still not fully understood. Transformed Teacher Matching (TTM) clarifies the role of temperature scaling by applying it only to the teacher distribution and interpreting the resulting objective as standard distillation with an implicit Rényi entropy regularization on the student. However, TTM still relies on a fixed temperature and does not specify how the teacher-side temperature should be adapted for individual samples. In this paper, we introduce a sample-wise inverse-temperature update for TTM by locally minimizing the Kullback-Leibler divergence between the temperature-scaled teacher distribution and the student's prediction. We derive closed-form first and second derivatives with respect to the inverse temperature, and show that they can be expressed using variance and covariance statistics of centered teacher and student logits under the transformed teacher weighting. This yields an efficient curvature-aware update that requires one softmax evaluation and a constant number of class-wise weighted sums. Experiments on standard image classification distillation benchmarks show that our temperature adaptation generally improves TTM and WTTM, while remaining competitive with or outperforming prior temperature-adaptive distillation baselines.
1. Introduction
Knowledge distillation (KD) trains a student model by transferring knowledge from a teacher model, improving accuracy without increasing inference cost [☐]. This paradigm is particularly valuable when training resources or high-quality labeled data are limited, since it can deliver strong performance with a smaller model budget. In practice, however, the effectiveness of KD depends on several design choices that can be sensitive to the teacher, student, and dataset, and these choices often require careful tuning.
A core component of standard KD is temperature scaling, which smooths predictive distributions to expose class-to-class relations, often referred to as dark knowledge. In the common formulation , temperature scaling is applied to both teacher and student outputs, and the student is trained to match the resulting softened distributions. This smoothing
© 2026. The copyright of this document resides with its authors. It may be distributed unchanged freely in print or electronic forms.

Figure 1: Overview of the proposed Temperature-Adaptive Transformed Teacher Matching. Given an input sample, the teacher produces a predictive distribution, which is calibrated by a power transform with an adaptive inverse temperature . The inverse temperature is updated to obtain sample-adaptive soft targets for distillation. The student is trained using cross-entropy and a distillation loss that matches the student prediction to the adapted teacher distribution.
assigns meaningful probability mass and gradients to non-maximum classes, making it easier for the student to learn the teacher's relative class structure. Despite its empirical success, the role of temperature scaling in KD has been less clear, and the design choice of whether to apply temperature to the teacher, the student, or both has historically been ambiguous.
Transformed Teacher Matching (TTM) [6] resolves this ambiguity in the distillation objective by using temperature scaling only on the teacher distribution and matching the transformed teacher distribution to the student's temperature-free prediction. Beyond this objective-level clarification, TTM provides a principled interpretation of temperature in distillation. By reformulating the teacher-side temperature transformation via power transforms, it shows that the resulting objective combines distribution matching with an implicit Rényi entropy regularization on the student.
Temperature scaling is also widely used beyond distillation, including calibration [10], out-of-distribution detection [13], semi- and self-supervised learning [1, 5, 6, 7], and learning with label noise [16]. In these settings, the temperature can substantially affect optimization behavior and final performance. In practice, however, selecting an effective temperature often depends on the particular teacher, student, and dataset, and it is commonly chosen through empirical tuning. While TTM clarifies the objective by applying temperature scaling only on the teacher side, it still relies on a fixed temperature and does not specify how the teacher-side temperature should vary across samples.
In this paper, we address this limitation by introducing a per-sample temperature adaptation method for TTM. Our approach optimizes the teacher-side inverse temperature for each sample by locally minimizing the Kullback-Leibler divergence between the transformed teacher distribution and the student's prediction (Fig. 1). We derive closed-form first and second derivatives with respect to the inverse temperature, and show that they can be written as compact variance-covariance expressions of centered teacher and student logits under the transformed teacher weighting. These derivatives lead to an efficient curvature-aware update that adds negligible overhead and can be directly integrated into TTM and WTTM. As a re-sult, the proposed method preserves the TTM framework while adapting the teacher target, and consequently the implicit Rényi entropy regularization, at the sample level. Experiments on standard image classification distillation benchmarks show that our temperature adaptation generally improves TTM and WTTM, while remaining competitive with or outperforming prior temperature-adaptive distillation baselines.
Temperature scaling is central to KD and is also widely used in related settings such as calibration [1], out-of-distribution detection [2], and semi- or self-supervised learning [3, 4, 5, 6, 7]. Recent KD methods adapt temperature by introducing curriculum temperature schedules [1], logit standardization [2], entropy-based adaptation [3], and pre-computed sample-wise temperatures based on pretrained-teacher difficulty [4]. In contrast to temperature adaptation, Transformed Teacher Matching (TTM) applies temperature scaling only to the teacher distribution and shows that the resulting formulation can be viewed as standard distillation with an implicit Rényi entropy regularization on the student [5]. WTTM further extends TTM with sample-wise weighting to emphasize informative teacher signals [6]. Our work complements TTM and WTTM by adapting the teacher-side inverse temperature at the sample level using a curvature-aware update derived from closed-form first and second derivatives of the teacher-student mismatch, enabling temperature adaptation within the TTM framework.
3 Preliminaries
3.1 Setting and Notation
We consider -class classification under a knowledge distillation setting. Given an input-label pair with , we train a student model using both the ground-truth label and the teacher's predictive distribution produced by a teacher model . The teacher parameters are fixed during distillation, while the student parameters are optimized. Let the teacher and student models produce logits and . The corresponding temperature-free predictive distributions are
where . When the dependence on model parameters is important, we write and ; otherwise, we use and for notational simplicity.
For distillation, we introduce a temperature parameter T > 0 to control the sharpness (or smoothness) of the predictive distributions. Specifically, we define the temperature-scaled teacher and student distributions as
We use for the cross-entropy loss and for the Kullback-Leibler divergence.
3.2 Knowledge Distillation and Transformed Teacher Matching
Knowledge distillation (KD) [1]. KD trains the student by combining supervised learning with distribution matching between temperature-scaled teacher and student predictions. A common formulation is
where balances the supervised and distillation terms.
Transformed teacher matching (TTM) [37]. To clarify the role of temperature on the teacher side, TTM interprets temperature scaling as a power transform. Given the temperature-free teacher prediction p, we define the power-transformed distribution
By setting , we obtain the equivalence and we compute directly from logits as
Building on the power-transform view, TTM makes the connection to the standard KD objective explicit. In particular, with the parameter correspondence and , the TTM loss can be rewritten as
where denotes the Rényi entropy of order [2]. This identity highlights that TTM is not only a distribution-matching objective but also introduces an implicit Rényi entropy regularization on the student prediction.
Weighted TTM (WTTM) [37]. WTTM further extends TTM by assigning a sample-wise weight to the distillation term based on the sharpness of the teacher target. Concretely, WTTM multiplies the distillation coefficient in Eq. (6) by a weight computed for each sample:
where is a power-sum of the teacher distribution that increases when the teacher target is smoother, thereby upweighting samples for which dark knowledge is more informative, while keeping the teacher-side temperature unchanged.
4 Methodology
4.1 Overview: Per-Sample Temperature Adaptation for TTM
We address the remaining question in TTM: how to adapt the teacher temperature. Our goal is to enable sample-adaptive temperature scaling within the TTM framework. To this end, we optimize the inverse temperature for each input under fixed logits. Specifically, we form the teacher distribution and the student prediction , and minimize the per-sample TTM discrepancy .
Local sensitivity and curvature of the KL discrepancy. To understand how the teacher temperature affects TTM, i.e., to quantify how the teacher-side inverse temperature affects TTM at the sample level, we analyze the local behavior of under small perturbations . This discrepancy is the teacher-student matching term in TTM, and its value can vary substantially across samples as the student prediction changes during training. Therefore, its local variation provides a natural signal for how the teacher-side transformation should be adjusted for each sample. Concretely, we approximate the change in the discrepancy by a second-order Taylor expansion around the current :
which characterizes both the local sensitivity (first derivative) and curvature (second derivative) with respect to . This quadratic model provides the local surrogate used below, and its derivatives are derived in Sec. 4.2.
Minimizing the local quadratic approximation. The local quadratic model above turns the sensitivity analysis into a practical update rule for the teacher-side inverse temperature. Standard TTM optimizes the student parameters for a fixed teacher-side temperature. In contrast, our method treats the teacher-side inverse temperature as a sample-wise auxiliary variable and refines it for the current student. Conceptually, this gives a double-minimization view [60, 61, 63] of the TTM objective:
This expression is used only to motivate the update direction; we do not solve the inner problem to convergence. In practice, after warm-up, we keep the current teacher and student logits fixed and update periodically every epochs using one local step based on the quadratic approximation in Eq. (8). Dropping the constant term that does not affect the update, we minimize the quadratic surrogate
Curvature-aware update. Because the surrogate in Eq. (10) is quadratic in , its minimizer has a closed form:
We update the inverse temperature using a step size , add a small constant to the denominator for numerical stability, and clip the result to a valid range:
where is a small constant for numerical stability, , and are the lower and upper bounds that restrict to a valid range. In Sec. 4.2, we show that these derivatives can be written in compact variance-covariance forms, enabling an efficient per-sample update.
Temperature-adaptive extensions of TTM and WTTM. The update in Eq. (12) can be directly incorporated into TTM (Eq. (6)) and WTTM (Eq. (7)) by replacing the fixed inverse temperature with a sample-wise value updated during training. We denote the resulting methods as Temperature-Adaptive TTM (TA-TTM) and Temperature-Adaptive WTTM (TA-WTTM), respectively. In both cases, we keep the original loss definitions and introduce only the additional update computed with stop-gradient logits. We maintain as a per-sample state throughout training and update it for observed samples during scheduled update epochs. For TA-WTTM, one could alternatively update by minimizing the full weighted WTTM term, including the sample weight . However, this couples temperature adaptation with sample weighting, and our ablation in Sec. 5.4 shows that this full-objective variant underperforms the decoupled update in Eq. (12). We therefore use the decoupled update as TA-WTTM in the rest of the paper. As a result, TA-TTM adapts the teacher-side temperature within the TTM objective, and TA-WTTM augments WTTM with the same temperature adaptation while retaining its original sample weighting scheme.
4.2 Closed-Form Derivatives
The curvature-aware update in Sec. 4.1 requires the first and second derivatives of the per-sample discrepancy with respect to the teacher-side inverse temperature . Notably, both derivatives can be written using low-order moments of teacher and student logits under the transformed teacher weighting.
We recall and , and we differentiate with respect to with stop-gradient logits. Let and , where denotes the class-wise expectation. We write centered logits as and (element-wise). With these definitions, the first derivative can be written in a compact variance-covariance form under , while the second derivative yields a curvature expression that also remains a simple class-wise weighted sum. Concretely,
Algorithm 1 Training with per-sample inverse-temperature adaptation
Require: Training data , teacher , student , initial per-sample inverse temperatures , total epochs , warm-up , epoch update interval
1: for epoch = 1, ..., E do
2: for each mini-batch do
3: Compute teacher logits and student logits
4: Compute and
5: if epoch > and then
6: ,
7: ,
8: Compute derivatives using Eq. (13) with detached logits
9:
10: end if
11: Compute the TTM/WTTM distillation loss and update student parameters
12: end for
13: end for
where and are taken with respect to the weighting . We provide the full derivations in the supplementary material.
Interpretation of first derivative. Eq. (13) shows that temperature adaptation is governed by simple statistics of teacher and student logits under the transformed teacher weighting . In the first derivative, the update direction is determined by the balance between teacher dispersion and teacher-student alignment. The term grows when the transformed teacher distribution emphasizes classes with widely spread teacher logits, meaning that changing strongly affects the smoothness of . In contrast, increases when the student logits align with the teacher logits on those emphasized classes, which counteracts the push to change .
Interpretation of second derivative. The second derivative quantifies the local curvature that determines how aggressive the update should be. The base curvature provides the dominant scale, while the student-teacher deviation correlation term adjusts this curvature depending on how the student weights classes where the teacher deviates strongly from its weighted mean. Finally, the teacher skewness term captures asymmetry of teacher logits under .
Connection to implicit Rényi entropy regularization. This sample-wise adaptation also has an interpretation through the implicit Rényi entropy regularization in TTM (Eq. (6)). Since the teacher-side temperature determines the transformed teacher distribution, it also controls how strongly the student is implicitly encouraged to adjust its predictive entropy under the TTM objective. Therefore, updating per sample not only changes the teacher target but also modulates the strength of the implicit Rényi entropy regularization across samples, allowing the regularization effect to adapt to sample difficulty and teacher-student mismatch.
Curriculum learning perspective. Our per-sample temperature adaptation can also be interpreted as an implicit curriculum. The inverse temperature controls the sharpness of the transformed teacher distribution, which affects how difficult the distillation target is for the student to match. By updating to reduce the teacher-student discrepancy, the method can assign softer targets to samples with large mismatch and sharper targets to samples where the student is more aligned with the teacher. In this sense, the teacher signal is adjusted at the sample level according to the current learning state, resembling curriculum or self-paced learning [2, 3, 4, 5]. Through Eq. (6), this view is consistent with sample-wise modulation of the implicit Rényi entropy regularization, since changing simultaneously changes the strength of the regularization effect induced by TTM.
4.3 Algorithm and Implementation
Algorithm 1 summarizes the per-sample inverse-temperature update. Each scheduled update requires one softmax over K classes and a constant number of weighted sums, yielding negligible overhead. We initialize from the temperature used in TTM, keep it fixed during a short warm-up, and then update it every epochs, reusing the stored values between updates. For a training set of N samples, the per-sample state consists of N 32-bit floating-point (FP32) scalars, requiring 4N bytes (0.2 MB for CIFAR100 and 5.1 MB for ImageNet1k). The state is indexed by dataset sample IDs, making it compatible with shuffling and standard data augmentation. The interval trades update frequency against noise and computation. For stability, we add to the curvature denominator and clip to ; these safeguards handle small or negative estimated curvature and keep the stored inverse temperatures within the valid range.
5 Evaluation
5.1 Evaluation Setting
Benchmarks and comparison methods. We evaluate our method on CIFAR100 [☐] and ImageNet1k [☐], which are standard image classification benchmarks for distillation. CIFAR100 contains 100 classes of images, and ImageNet1k contains 1,000 classes of high-resolution natural images. We use widely adopted teacher-student architectures and report top-1 accuracy on the CIFAR100 test split and the ImageNet1k validation split. We compare against TTM [☐], WTTM [☐], strong KD baselines FitNet [☐], AT [☐], VID [☐], RKD [☐], PKT [☐], CRD [☐], DIST [☐], and DKD [☐], temperature-adaptive KD methods LS [☐] and EA-KD [☐], and the curriculum-based KD method CTKD [☐].
Training and evaluation protocol. We follow the training and evaluation protocols of prior distillation work [☐] to ensure consistent comparisons. Since our method extends TTM and WTTM with temperature adaptation, we reproduce TTM and WTTM using the official implementation under the protocol described in the original paper. For our method, all hyperparameters follow the corresponding TTM or WTTM configuration, except for the step size introduced for temperature adaptation. For the reproduced baselines and proposed methods in the main CIFAR100 experiments, we report the mean and standard deviation
Table 1: Performance comparison on CIFAR100 in the same-architecture distillation setting. † indicates results reproduced by us using the official implementation under the protocol described in the paper [57]. Δ and Δ† denote accuracy differences from TTM/WTTM and TTM†/WTTM†, respectively; positive values are highlighted in red and negative values in blue.
| Teacher | WRN-40-2 | WRN-40-2 | ResNet56 | ResNet110 | ResNet110 | ResNet32x4 | VGG13 |
|---|---|---|---|---|---|---|---|
| 75.61 | 75.61 | 72.34 | 74.31 | 74.31 | 79.42 | 74.64 | |
| Student | WRN-16-2 | WRN-40-1 | ResNet20 | ResNet20 | ResNet32 | ResNet8x4 | VGG8 |
| 73.26 | 71.98 | 69.06 | 69.06 | 71.14 | 72.50 | 70.36 | |
| Feature-based Knowledge Distillation | |||||||
| FitNet | |||||||
| AT | |||||||
| VID | |||||||
| RKD | |||||||
| PKT | |||||||
| CRD | |||||||
| Logits-based Knowledge Distillation | |||||||
| KD | |||||||
| DIST | |||||||
| DKD | 76.24 | 74.81 | 71.97 | n/a | 74.11 | 76.32 | 74.68 |
| TTM | |||||||
| Sample-Adaptive Knowledge Distillation | |||||||
| WTTM | |||||||
| Temperature-Adaptive Knowledge Distillation | |||||||
| CTKD | 75.45 | 73.93 | 71.19 | 70.99 | 73.52 | n/a | 73.52 |
| LS | 76.11 | 74.37 | 71.43 | 71.48 | 74.17 | 76.62 | 74.36 |
| EA-KD | n/a | 74.38 | n/a | n/a | n/a | 75.46 | 74.08 |
| Temperature-Adaptive Transformed Teacher Matching | |||||||
| TA-TTM | |||||||
| Δ | +0.19 | -0.09 | +0.02 | +0.00 | -0.01 | +0.16 | +0.29 |
| +0.27 | +0.16 | -0.04 | +0.13 | +0.13 | +0.31 | +0.44 | |
| TA-WTTM | |||||||
| Δ | +0.20 | -0.09 | -0.01 | +0.06 | -0.09 | +0.22 | +0.27 |
| +0.31 | +0.14 | +0.14 | +0.40 | +0.11 | +0.35 | +0.38 | |
over five runs with different random seeds. Full details are provided in the supplementary material.
5.2 Comparison Results
CIFAR100 results. Tables 1 and 2 summarize results on CIFAR100 under same-architecture and cross-architecture distillation, respectively. TA-TTM is generally competitive with or better than the corresponding TTM baseline, while TA-WTTM consistently strengthens
H. AIZAWA AND Y. HAYASHI: TEMPERATURE-ADAPTIVE TTM
Table 2: Performance comparison on CIFAR100 in the cross-architecture distillation setting.
| Teacher | VGG1374.64 | ResNet5079.34 | ResNet5079.34 | ResNet32×479.42 | ResNet32×479.42 | WRN-40-275.61 |
|---|---|---|---|---|---|---|
| Student | MobileNetV264.60 | MobileNetV264.60 | VGG870.36 | ShuffleNetV170.50 | ShuffleNetV271.82 | ShuffleNetV170.50 |
| Feature-based Knowledge Distillation | ||||||
| FitNet | ||||||
| AT | ||||||
| VID | ||||||
| RKD | ||||||
| PKT | ||||||
| CRD | ||||||
| Logits-based Knowledge Distillation | ||||||
| KD | ||||||
| DIST | ||||||
| DKD | 69.71 | 70.35 | n/a | 76.45 | 77.07 | 76.70 |
| TTM | ||||||
| Sample-Adaptive Knowledge Distillation | ||||||
| WTTM | ||||||
| Temperature-Adaptive Knowledge Distillation | ||||||
| CTKD | 68.46 | 68.47 | n/a | 74.48 | 75.31 | 75.78 |
| LS | 68.61 | 69.02 | n/a | n/a | 75.56 | n/a |
| EA-KD | 69.17 | 69.67 | n/a | n/a | 75.91 | n/a |
| Temperature-Adaptive Transformed Teacher Matching | ||||||
| TA-TTM | ||||||
| -0.51 | -0.38 | +0.17 | +0.10 | -0.12 | +0.22 | |
| -0.18 | +1.12 | +0.31 | +0.93 | +0.13 | +0.45 | |
| TA-WTTM | ||||||
| -0.32 | -0.08 | +0.34 | -0.05 | +0.15 | +0.30 | |
| +0.77 | +0.31 | +0.60 | +0.82 | +0.00 | +0.33 | |
WTTM. The trend holds in both architecture settings, indicating that per-sample temperature adaptation is complementary to teacher-side temperature matching and remains useful when the teacher-student gap becomes larger. TTM and WTTM already use carefully tuned and configurations, so the improvements obtained by changing only the teacher-side temperature adaptation should be interpreted as modest refinements over strong baselines.
ImageNet1k results. Table 3 reports results on ImageNet1k for the ResNet-34 teacher and ResNet-18 student pair. TA-TTM improves over the reproduced TTM baseline, and TA-WTTM further improves over WTTM while remaining competitive with the temperature-adaptive KD baseline EA-KD. These results indicate that the proposed sample-wise temperature adaptation remains effective at ImageNet1k scale and that its benefit is preserved when combined with the WTTM sample-weighting scheme.
Table 3: Performance comparison on ImageNet1k. TTM and WTTM results are from our reproduced experiments. These results are obtained from a single run.
| Teacher Student | ResNet-34 (73.31)ResNet-18 (69.76) | |||||
|---|---|---|---|---|---|---|
| Method | KD | TTM | WTTM | EA-KD | TA-TTM | TA-WTTM |
| Top-1 Acc. | 70.66 | 71.74 | 71.81 | 71.79 | 71.92 (+0.18) | 72.11 (+0.30) |
Table 4: Top-1 accuracy (%) on CIFAR100 same-architecture pairs. TTM/WTTM variants omit cross-entropy; KD with cross-entropy is included as a reference. Results are reported over three seeds.
| Teacher Student | WRN-40-2 WRN-16-2 | ResNet56 ResNet20 | VGG13 VGG8 |
|---|---|---|---|
| KD w/ CE | |||
| TTM w/o CE | |||
| WTTM w/o CE | |||
| TA-TTM w/o CE | |||
| TA-WTTM w/o CE |
Table 5: Performance comparison on CIFAR100 in the distillation setting from transformer-based teachers to CNN-based students.
| Teacher Student | ViT-S (92.44)ResNet18 (74.01) | Swin-T (89.26)ResNet18 (74.01) | Mixer-B/16 (87.62)ResNet18 (74.01) |
|---|---|---|---|
| KD | |||
| EA-KD | |||
| TTM | |||
| WTTM | |||
| TA-TTM | |||
| TA-WTTM |
Distillation without cross-entropy. Table 4 evaluates whether the proposed temperature adaptation remains effective when the supervised cross-entropy term is removed from the TTM-style objectives on representative pairs, which reflects recent practical settings where ground-truth labels are not available and learning must rely on teacher-provided supervision. Both TA-TTM and TA-WTTM retain their advantage over the corresponding non-adaptive baselines. These results indicate that the gains are not solely due to interaction with the supervised cross-entropy term; the adaptive teacher-side transform also strengthens the distillation signal itself.
Distillation from transformer-based teachers. Table 5 evaluates distillation performance from transformer-based teachers (ViT-S [8], Swin-T [19], and Mixer-B/16 [28]) to a CNN-based student (ResNet18 [10]). TTM and WTTM are strong baselines in this setting, and our adaptive variants further improve them. This suggests that per-sample temperature adaptation is also useful when transferring knowledge across model families, where the teacher-student gap is pronounced.

(a) Dynamics

(b) Distribution

(c) Difficulty correlation
Figure 2: Temperature diagnostics for TA-TTM on the representative same-architecture pair ResNet110→ResNet20. The panels show the evolution of the mean and standard deviation of the inverse temperature , the stage-wise distribution of , and the correlation between per-sample cross-entropy loss and the optimized , respectively.

(a) Dynamics

(b) Distribution

(c) Difficulty correlation
Figure 3: Temperature diagnostics for TA-WTTM on ResNet110→ResNet20, using the same layout as Fig. 2.
5.3 Analysis of Temperature Dynamics
Adaptation behavior of the average temperature. We analyze the training dynamics of the temperature. Figs. 2(a) and 3(a) show that the mean inverse temperature evolves in a structured manner rather than converging to a constant. For both TA-TTM and TA-WTTM, decreases from its initialization and then stabilizes after mid training, indicating that the effective temperature increases and the teacher targets become softer over time. The red dashed curves plot the mixing coefficient implied by the learned under a fixed , and their evolution suggests that the balance between the distillation term and the supervised cross-entropy term changes adaptively as a consequence of temperature adaptation. In addition, the standard deviation of tends to increase, suggesting that sample-wise temperatures become more diverse as training progresses. Corresponding cross-architecture diagnostics are provided in the supplementary material.
Stage-wise temperature distribution. Figs. 2(b) and 3(b) visualize how the inverse temperature is distributed over training samples at three stages of training. At epoch 100, the distributions are sharply peaked for both methods, indicating that most samples share a similar temperature early in training. By epoch 200, the histograms become noticeably broader and their modes shift to smaller values, which corresponds to using a larger effective temperature and thus softer teacher targets on average. This widening suggests that the proposed update progressively differentiates samples and assigns a wider range of temperatures rather than converging to a single global value. From epoch 200 to epoch 240, the distributions change more mildly, implying that the sample-wise temperatures stabilize.
Table 6: Temperature-design ablations on CIFAR100 for WRN-40-2→WRN-16-2. (a) compares inverse-temperature granularity using a common and reports top-1 best accuracy. (b) fixes sample-wise and compares optimization rules using method-specific settings, reporting five-run top-1 best accuracy (mean std.).
(a) Temperature granularity
| Method | Global γ | Class γ | Sample γ |
|---|---|---|---|
| TA-TTM | 75.77 | 75.29 | 76.66 |
| TA-WTTM | 75.43 | 75.28 | 76.30 |
(b) Sample-wise temperature optimization
| Method | Trainable γ | First-order | Newton |
|---|---|---|---|
| TA-TTM | |||
| TA-WTTM |
Table 7: Ablation study of the TA-WTTM temperature update on CIFAR100. We compare TA-WTTM, which uses the decoupled update, with the full-objective update on representative same- and different-architecture pairs. denotes TA-WTTM minus TA-WTTM-full.
| Teacher Student | WRN-40-2 WRN-16-2 | ResNet110 ResNet32 | VGG13 VGG8 | VGG13 MobileNetV2 | ResNet32×4 ShuffleNetV1 | WRN-40-2 ShuffleNetV1 |
|---|---|---|---|---|---|---|
| TA-WTTM | ||||||
| TA-WTTM-full | ||||||
| Δ | +0.03 | +0.40 | +0.15 | +0.10 | +0.49 | +0.19 |
in the late stage.
Correlation with sample difficulty. Figs. 2(c) and 3(c) examine how the optimized inverse temperature relates to sample difficulty, measured by the per-sample cross-entropy loss, which is widely used as a difficulty proxy in curriculum and self-paced learning [14]. Across both methods and training stages, we observe a clear negative correlation: samples with larger cross-entropy loss tend to be assigned smaller . Since smaller corresponds to a larger effective temperature , the proposed adaptation softens the teacher target for harder samples while keeping it sharper for easier ones. This relationship remains pronounced throughout training, as reflected by the consistent downward trends in the point clouds. Overall, these results support a curriculum-like behavior in which the supervision is adjusted according to the current sample difficulty and teacher-student mismatch.
5.4 Ablation Results
Temperature granularity. Table 6(a) compares global, class-wise, and sample-wise inverse temperatures on CIFAR100 for WRN-40-2→WRN-16-2 using a common . For both methods, the sample-wise variant achieves the highest top-1 best accuracy, outperforming the global and class-wise alternatives. This representative ablation supports adapting the teacher transform at the sample level, where teacher-student mismatch can vary even within the same class.
Temperature optimization rule. Table 6(b) fixes sample-wise and compares trainable, first-order, and Newton updates over five runs using method-specific settings. The Newton update performs best for both TA-TTM and TA-WTTM, improving over directly training and updating it with only the first derivative. On this representative pair, the result supports using the closed-form curvature rather than treating the inverse temperature as a generic trainable state.

(a) Update rate
(b) Warm-up length
(c) Update interval
Figure 4: Hyperparameter sensitivity of the proposed temperature adaptation. We evaluate the update rate , warm-up length, and update interval for the sample-wise inverse temperature update.
Full-objective temperature update. Table 7 compares two ways of updating the sample-wise inverse temperature in TA-WTTM on representative pairs. The decoupled variant, used as our default, updates by minimizing the teacher-student discrepancy , while retaining the WTTM sample weight only in the training loss. The full-objective variant instead updates using the weighted WTTM objective, thereby coupling the temperature update with the sample-weighting term . TA-WTTM outperforms the full-objective variant in both same- and cross-architecture settings, indicating that separating temperature adaptation from sample weighting provides a more stable update for .
Sensitivity to hyperparameters. Fig. 4 summarizes the sensitivity to the update rate , warm-up length, and update interval. The results are relatively stable across warm-up lengths and update intervals, indicating that the method does not rely on a specific start epoch or very frequent temperature updates. The update rate has a clearer effect: overly conservative updates can under-adapt the temperature, while a moderate rate gives better accuracy. Overall, the proposed update is robust to scheduling choices, with being the main hyperparameter to tune.
6 Conclusion
We addressed how to adapt the teacher temperature in Transformed Teacher Matching (TTM) and proposed a per-sample update of the teacher-side inverse temperature within the TTM framework. Using closed-form first and second derivatives, expressed through variance-covariance statistics of centered teacher and student logits under the transformed teacher weighting, we derived an efficient curvature-aware update with negligible overhead. Experiments on standard image classification distillation benchmarks show that TA-TTM and TA-WTTM generally improve the reproduced TTM and WTTM baselines across multiple CIFAR100 settings, and also outperform the compared temperature-adaptive baseline in the ImageNet1k setting. Our analysis further reveals structured temperature dynamics and a negative correlation between and per-sample difficulty, suggesting softer teacher targets for harder samples and a curriculum-like modulation of the implicit Rényi entropy regularization in TTM.
References
[1] Sungsoo Ahn, Shell Xu Hu, Andreas Damianou, Neil D Lawrence, and Zhenwen Dai. Variational information distillation for knowledge transfer. In CVPR, pages 9163–9171, 2019.
[2] Hiroaki Aizawa and Yoshikazu Hayashi. Flatness-aware curriculum learning via adversarial difficulty. In BMVC, pages 1–12, 2025.
[3] Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In ICML, pages 41–48, 2009.
[4] David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin A Raffel. Mixmatch: A holistic approach to semi-supervised learning. NeurIPS, 32, 2019.
[5] Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. In ICCV, pages 9650–9660, 2021.
[6] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In ICML, pages 1597–1607, 2020.
[7] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, pages 248–255. Ieee, 2009.
[8] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth words: Transformers for image recognition at scale. In ICLR, 2021.
[9] Tommaso Furlanello, Zachary Lipton, Michael Tschannen, Laurent Itti, and Anima Anandkumar. Born again neural networks. In ICML, pages 1607–1616. PMLR, 2018.
[10] Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. In ICML, pages 1321–1330. PMLR, 2017.
[11] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770–778, 2016.
[12] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
[13] Tao Huang, Shan You, Fei Wang, Chen Qian, and Chang Xu. Knowledge distillation from a stronger teacher. NeurIPS, 35:33716–33727, 2022.
[14] Lu Jiang, Deyu Meng, Qian Zhao, Shiguang Shan, and Alexander Hauptmann. Self-paced curriculum learning. In AAAI, volume 29, 2015.
[15] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
[16] Junnan Li, Richard Socher, and Steven CH Hoi. Dividemix: Learning with noisy labels as semi-supervised learning. In ICLR, 2020.
[17] Zheng Li, Xiang Li, Lingfeng Yang, Borui Zhao, Renjie Song, Lei Luo, Jun Li, and Jian Yang. Curriculum temperature for knowledge distillation. In AAAI, volume 37, pages 1504–1512, 2023.
[18] Shiyu Liang, Yixuan Li, and R Srikant. Enhancing the reliability of out-of-distribution image detection in neural networks. In ICLR, 2018.
[19] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In ICCV, pages 10012–10022, 2021.
[20] Wonpyo Park, Dongju Kim, Yan Lu, and Minsu Cho. Relational knowledge distillation. In CVPR, pages 3967–3976, 2019.
[21] Nikolaos Passalis and Anastasios Tefas. Learning deep representations with probabilistic knowledge transfer. In ECCV, pages 268–284, 2018.
[22] Alfréd Rényi. On measures of entropy and information. In Proceedings of the fourth Berkeley symposium on mathematical statistics and probability, volume 1: contributions to the theory of statistics, volume 4, pages 547–562. University of California Press, 1961.
[23] Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. In ICLR, 2015.
[24] Chi-Ping Su, Ching-Hsun Tseng, Bin Pu, Lei Zhao, Jiewen Yang, Zhuangzhuang Chen, and Shin-Jye Lee. Ea-kd: Entropy-based adaptive knowledge distillation. In ICCV, pages 731–740, 2025.
[25] Shangquan Sun, Wenqi Ren, Jingzhi Li, Rui Wang, and Xiaochun Cao. Logit standardization in knowledge distillation. In CVPR, pages 15731–15740, 2024.
[26] Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. NeurIPS, 30, 2017.
[27] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive representation distillation. In ICLR, 2019.
[28] Ilya O Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Andreas Steiner, Daniel Keysers, Jakob Uszkoreit, et al. Mlp-mixer: An all-mlp architecture for vision. NeurIPS, 34:24261–24272, 2021.
[29] Frederick Tung and Greg Mori. Similarity-preserving knowledge distillation. In ICCV, pages 1365–1374, 2019.
[30] En-hui Yang and Linfeng Ye. Markov knowledge distillation: Make nasty teachers trained by self-undermining knowledge distillation fully distillable. In ECCV, pages 154–171, 2024.
[31] En-Hui Yang, Shayan Mohajer Hamidi, Linfeng Ye, Renhao Tan, and Beverly Yang. Conditional mutual information constrained deep learning for classification. IEEE Transactions on Neural Networks and Learning Systems, 2025.
[32] Shunzhi Yang, Xiong Yang, Jin Ren, Liuchi Xu, Jinfeng Yang, Zhenhua Huang, Zheng Gong, and Wenguang Wang. Adaptive temperature distillation method for mining hard samples' knowledge. Neurocomputing, 636:129745, 2025.
[33] Linfeng Ye, Shayan Mohajer Hamidi, and EN-HUI YANG. Towards undistillable models by minimizing conditional mutual information. TMLR, 2025.
[34] Sergey Zagoruyko and Nikos Komodakis. Paying more attention to attention: Improving the performance of convolutional neural networks via attention transfer. In ICLR, 2017.
[35] Borui Zhao, Quan Cui, Renjie Song, Yiyu Qiu, and Jiajun Liang. Decoupled knowledge distillation. In CVPR, pages 11953–11962, 2022.
[36] Di Zhao, Yun Sing Koh, Gillian Dobbie, Hongsheng Hu, and Philippe Fournier-Viger. Symmetric self-paced learning for domain generalization. In AAAI, volume 38, pages 16961–16969, 2024.
[37] Kaixiang Zheng and EN-HUI YANG. Knowledge distillation based on transformed teacher matching. In ICLR, 2024.
H. AIZAWA AND Y. HAYASHI: TEMPERATURE-ADAPTIVE TTM
A Derivations for Per-Sample Temperature Adaptation
A.1 Sample-wise optimization of the teacher temperature
We interpret the teacher temperature in TTM via and optimize per sample. Let the teacher-side transformed distribution and the student prediction be
For a fixed pair , we minimize the TTM discrepancy
Remark (stop-gradient). In the following derivations, and (hence ) are treated as constants when differentiating with respect to . In implementation, this corresponds to computing the -update with stop-gradient on logits.
A.2 Log-sum-exp identities and an expectation derivative lemma
We start from the log-sum-exp form of the softmax:
and
Differentiating with respect to yields
Define the -weighted mean of teacher logits
Then Eq. (18) becomes
If the teacher logit are normalized as centered teacher logit , then Eq. (18) is
For the derivative , we obtain it by the chain rule and log-sum-exp form:
(22)
Lemma 1. For any vector independent of , define the class-wise expectation . Then
where products are element-wise and is the covariance under the weighting .
Proof. Using Eq. (22),
(24)
Then we have
(25)
Corollary 1. Taking in Eq. (23) gives
A.3 Expanding the KL discrepancy
From Eq. (15),
(27)
where we use .
A.4 First derivative
Differentiate Eq. (27) with respect to :
(28)
By the lemma and corollary, we obtain
(29)
Next, note that student log-probabilities satisfy . Since the second term is class-independent constant , it does not affect covariance with , hence
(30)
Therefore, we obtain
A.5 Second derivative
Before differentiating Eq. (31), we rearrange it using the centered logits . In addition to and defined above, let and element-wise. By the definitions of variance and covariance,
(32)
Substituting these results into first derivative yeilds the following expression:
For calculating the second derivative, let
Then and
Although depend on through , the derivatives can be computed by expanding into these terms.
First, we expand :
(36)
since . Differentiating this equation gives
Because is -independent, we can apply the lemma
Similarly, applying the lemma with yields
Substituting these results into gives
(40)
where we used .
Next, we derive the derivative of . we expand
(41)
since and . Differentiating this equation yields
Because is -independent (logits are treated as fixed w.r.t. ), we apply the lemma with :
Moreover, applying the lemma with gives
H. AIZAWA AND Y. HAYASHI: TEMPERATURE-ADAPTIVE TTM
23
Table 8: Comparison with ATD on CIFAR100 for WRN-40-2→WRN-16-2. Results are Best Acc@1.
| Method | ATD | TTM | WTTM | TA-TTM | TA-WTTM |
|---|---|---|---|---|---|
| Acc. |
and we already have . Substituting these results into , we obtain
since . Finally, write :
Finally, we obtain
B Comparison with Adaptive Temperature Distillation
Adaptive Temperature Distillation (ATD) [62] precomputes sample-wise temperatures from the difficulty estimated by a pretrained teacher. For a fair comparison of temperature-adaptation strategies, we use the CNN-RIS-AT setting from ATD on CIFAR100 with WRN-40-2→WRN-16-2 and apply only its temperature regulation strategy, without Mixup.
TA-TTM and TA-WTTM outperform ATD by 0.59 and 0.74 percentage points, respectively, while also improving over TTM and WTTM. The methods differ in when and how the sample-wise temperatures are determined: ATD computes them from pretrained-teacher difficulty before distillation, whereas our method maintains and repeatedly updates each sample's during training from the current teacher-student mismatch within the TTM objective.
C Additional Diagnostics of Temperature Adaptation
C.1 Cross-architecture temperature diagnostics
Figure 5 complements the same-architecture diagnostics in the main paper with the cross-architecture pair WRN-40-2→ShuffleNetV1. TA-TTM and TA-WTTM show the same qualitative pattern: the inverse-temperature distributions broaden during training, and larger per-sample cross-entropy losses tend to be associated with smaller .

(a) TA-TTM dynamics

(b) TA-TTM distribution

(c) TA-TTM correlation

(d) TA-WTTM dynamics

(e) TA-WTTM distribution

(f) TA-WTTM correlation
Figure 5: Cross-architecture temperature diagnostics for WRN-40-2→ShuffleNetV1. The first and second rows show TA-TTM and TA-WTTM, respectively; the columns show temperature dynamics, stage-wise inverse-temperature distributions, and correlations with per-sample cross-entropy loss.
C.2 Curvature and clipping
We examine the curvature used by the temperature update for WRN-40-2→WRN-16-2. Table 9 reports statistics of the estimated curvature reconstructed over all 50,000 training samples at three update epochs. Negative curvature occurs primarily at epoch 100, but only for of samples for either method. It disappears for TA-TTM at epochs 200 and 240, and falls to and then for TA-WTTM. We observe no samples with , the threshold associated with the denominator guard, and only with in one setting. Consistent with these curvature statistics, clipping is almost never activated. Thus, damping and clipping act mainly as numerical safeguards in this experiment rather than routinely determining the temperature update.
Table 9: Curvature diagnostics for WRN-40-2→WRN-16-2, evaluated over all 50,000 training samples. The last three columns report the percentage of samples satisfying each condition.
| Method | Epoch | Mean | Min. | |||
|---|---|---|---|---|---|---|
| TA-TTM | 100 | 22.46 | -35.14 | 0.164% | 0% | 0% |
| TA-TTM | 200 | 16.79 | 1.47 | 0% | 0% | 0% |
| TA-TTM | 240 | 16.77 | 1.83 | 0% | 0% | 0% |
| TA-WTTM | 100 | 22.02 | -32.06 | 0.164% | 0% | 0.002% |
| TA-WTTM | 200 | 17.03 | -2.88 | 0.004% | 0% | 0% |
| TA-WTTM | 240 | 17.08 | 1.02 | 0% | 0% | 0% |
C.3 Correlation between inverse temperature and sample difficulty
We quantify the relationship visualized in the main-paper diagnostic figures using the same protocol of 1,000 samples per epoch. Table 10 reports both Pearson and Spearman correlations between the learned inverse temperature and the per-sample cross-entropy loss for WRN-40-2→WRN-16-2. All coefficients are negative at epochs 100, 200, and 240 for both methods, with Pearson correlations ranging from to and Spearman correlations from to . Across all 13 settings used for the paper figures, the mean Pearson correlation is for TA-TTM and for TA-WTTM. These quantitative results corroborate the negative trend shown in the main-paper diagnostic figures and summarized in its conclusion: samples with higher cross-entropy loss tend to receive smaller , corresponding to softer teacher targets.
Table 10: Correlation between the learned inverse temperature and per-sample cross-entropy loss for WRN-40-2→WRN-16-2, using 1,000 samples per epoch.
| Method | Statistic | Epoch 100 | Epoch 200 | Epoch 240 |
|---|---|---|---|---|
| TA-TTM | Pearson | -0.673 | -0.687 | -0.713 |
| Spearman | -0.710 | -0.722 | -0.744 | |
| TA-WTTM | Pearson | -0.673 | -0.645 | -0.683 |
| Spearman | -0.720 | -0.681 | -0.709 |
D Hyperparameters
For CIFAR100, Table 11 summarizes the hyperparameters of our proposed method. We use the original TTM and WTTM configurations for the initial inverse temperature and , and grid-search the additional step size over . For ImageNet1k, we use the TTM configuration and grid-search over the same range.
Table 11: Hyperparameters used for each teacher–student pair.
| Pair | Method | β | η | |
|---|---|---|---|---|
| vgg13_MobileNetV2 | TA-TTM | 0.2 | 16 | 0.005 |
| vgg13_MobileNetV2 | TA-WTTM | 0.2 | 3 | 0.004 |
| ResNet50_MobileNetV2 | TA-TTM | 0.2 | 20 | 0.004 |
| ResNet50_MobileNetV2 | TA-WTTM | 0.2 | 5 | 0.001 |
| ResNet50_vgg8 | TA-TTM | 0.1 | 70 | 0.005 |
| ResNet50_vgg8 | TA-WTTM | 0.1 | 2 | 0.005 |
| resnet32x4_ShuffleNetV1 | TA-TTM | 0.2 | 12 | 0.005 |
| resnet32x4_ShuffleNetV1 | TA-WTTM | 0.2 | 1.4 | 0.005 |
| resnet32x4_ShuffleNetV2 | TA-TTM | 0.4 | 40 | 0.004 |
| resnet32x4_ShuffleNetV2 | TA-WTTM | 0.4 | 16 | 0.001 |
| WRN-40-2_ShuffleNetV1 | TA-TTM | 0.3 | 8 | 0.004 |
| WRN-40-2_ShuffleNetV1 | TA-WTTM | 0.3 | 3 | 0.003 |
| WRN-40-2_WRN-16-2 | TA-TTM | 0.1 | 101 | 0.004 |
| WRN-40-2_WRN-16-2 | TA-WTTM | 0.1 | 4 | 0.003 |
| WRN-40-2_WRN-40-1 | TA-TTM | 0.1 | 76 | 0.003 |
| WRN-40-2_WRN-40-1 | TA-WTTM | 0.1 | 3 | 0.005 |
| resnet56_resnet20 | TA-TTM | 0.3 | 7 | 0.002 |
| resnet56_resnet20 | TA-WTTM | 0.3 | 1.5 | 0.003 |
| resnet110_resnet20 | TA-TTM | 0.2 | 8 | 0.001 |
| resnet110_resnet20 | TA-WTTM | 0.2 | 2 | 0.001 |
| resnet110_resnet32 | TA-TTM | 0.1 | 33 | 0.002 |
| resnet110_resnet32 | TA-WTTM | 0.1 | 1.5 | 0.002 |
| resnet32x4_resnet8x4 | TA-TTM | 0.1 | 100 | 0.002 |
| resnet32x4_resnet8x4 | TA-WTTM | 0.1 | 3 | 0.005 |
| vgg13_vgg8 | TA-TTM | 0.1 | 45 | 0.005 |
| vgg13_vgg8 | TA-WTTM | 0.1 | 2.25 | 0.002 |