Manuscript Offprint

arXiv:2608.29099

Temperature-Adaptive Transformed Teacher Matching

Hiroaki Aizawa, Yoshikazu Hayashi

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 [1][1], 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

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 γ\gamma. The inverse temperature γ\gamma 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.

References (34)

  • Variational information distillation for knowledge transfer
  • Flatness-aware curriculum learning via adversarial difficulty
  • Curriculum learning
  • Mixmatch: A holistic approach to semi-supervised learning
  • Emerging properties in self-supervised vision transformers
  • A simple framework for contrastive learning of visual representations
  • Imagenet: A large-scale hierarchical image database
  • Transformers for image recognition at scale
  • Born again neural networks
  • On calibration of modern neural networks
  • Deep residual learning for image recognition
  • Distilling the Knowledge in a Neural Network
  • Knowledge distillation from a stronger teacher
  • Self-paced curriculum learning
  • Dividemix: Learning with noisy labels as semi-supervised learning
  • Curriculum temperature for knowledge distillation
  • Enhancing the reliability of out-of-distribution image detection in neural networks
  • Swin transformer: Hierarchical vision transformer using shifted windows
  • Relational knowledge distillation
  • Learning deep representations with probabilistic knowledge transfer
  • Fitnets: Hints for thin deep nets
  • Ea-kd: Entropy-based adaptive knowledge distillation
  • Logit standardization in knowledge distillation
  • Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results
  • Contrastive representation distillation
  • An all-mlp architecture for vision
  • Similarity-preserving knowledge distillation
  • Markov knowledge distillation: Make nasty teachers trained by self-undermining knowledge distillation fully distillable
  • Conditional mutual information constrained deep learning for classification
  • Adaptive temperature distillation method for mining hard samples' knowledge
  • TMLR, 2025
  • Paying more attention to attention: Improving the performance of convolutional neural networks via attention transfer
  • Decoupled knowledge distillation
  • Symmetric self-paced learning for domain generalization