Asymmetric Temperature Scaling Makes Larger Networks Teach Well Again

Xin-Chun Li, Wen-Shu Fan, Shaoming Song, Yinchuan Li, Bingshuai Li, Yunfeng Shao, De-Chuan Zhan

TL;DR

In knowledge distillation, bigger and more accurate "teacher" networks paradoxically make worse mentors for smaller "student" networks due to extreme overconfidence. This paper introduces Asymmetric Temperature Scaling (ATS), a simple yet elegant tweak that applies different temperatures to correct versus incorrect classes during logit scaling. By restoring the distinctness of "wrong" class probabilities, ATS allows massive models to successfully pass on their "dark knowledge" to lightweight students.

What Problem Does This Paper Address?

Knowledge Distillation (KD) is a popular technique for compressing large, cumbersome neural networks (teachers) into compact, deployable ones (students) by forcing the student to mimic the teacher's output probabilities. Intuitively, you would think that a more accurate teacher would yield a better student. However, recent research has revealed a frustrating phenomenon: larger, state-of-the-art teachers often perform worse at teaching than smaller, less accurate ones.

Traditional KD attempts to fix mismatched capacities using uniform temperature scaling—dividing all logit outputs by a constant temperature ($\tau$) before passing them through a softmax layer to soften the distribution. Unfortunately, for very large and overconfident models, uniform scaling fails. The authors set out to discover exactly why large teachers fail and how to fix it without resorting to complex, multi-stage training pipelines.

Methods

To diagnose the issue, the authors decompose the standard KD loss into three distinct functional components:

  1. Correct Guidance: The probability assigned to the correct class.
  2. Smooth Regularization: The average probability assigned to all wrong classes (similar to label smoothing).
  3. Class Discriminability: The variance among the wrong class probabilities (how well the network distinguishes between different incorrect options).
Figure 1: Left: Decomposition of a teacher’s label. The first class is the target. As temperature increases, correct guidance is weaker, smooth regularization is stronger, while class discriminability (measured by the variance of wrong class probabilities) will first increase and then decrease. Right: Larger/Smaller teachers’ logits are consistent in relative class affinities, i.e., logit values of the four wrong classes are in the same order of magnitude. However, larger teachers are over-confident and give a larger target logit or smaller inherent variance, leading to a smaller derived variance under traditional temperature scaling, i.e., less distinct wrong class probabilities after softmax.

They discover that large teachers suffer from poor Class Discriminability. Because these models are highly overconfident, they output massive logits for the correct class or tightly clustered logits for the wrong classes. When scaled uniformly, the resulting softmax squashes the variance of the wrong classes, erasing the subtle, relative relationships between them (e.g., recognizing that a picture of a cat looks more like a dog than a car).

To solve this, the authors propose Asymmetric Temperature Scaling (ATS). Instead of using a single temperature, ATS applies a higher temperature ($\tau_1$) to the correct class logit and a lower temperature ($\tau_2$) to the incorrect class logits ($\tau_1 > \tau_2 > 0$). This dual-temperature approach dampens the teacher's overconfidence on the correct class while amplifying and preserving the distinct boundaries and affinities among the wrong classes.

Datasets

The authors evaluated their method across a diverse set of benchmarks spanning multiple domains:

  • Image Classification: CIFAR-10, CIFAR-100, and TinyImageNet.
  • Fine-Grained Recognition: Caltech-UCSD Birds-200-2011 (CUB) and Stanford Dogs.
  • Keyword Spotting: Google Speech Commands (GSC).

They tested various architectural pairings, using large models like ResNet110, WideResNet28-8, and ResNeXt29-64-4d as teachers, and lightweight models like VGG8, ShuffleNetV1/V2, and MobileNetV2 as students.

Key Insights and Ideas

  • The "Dark Knowledge" is in the Mistakes: The true value of a teacher network isn't just telling the student what the right answer is, but showing how classes relate to one another through incorrect predictions.
  • Overconfidence Flattens the Landscape: Large teachers actually do understand the relative relationships between wrong classes (they maintain a high rank correlation with smaller teachers). However, standard uniform temperature scaling hides this information by flattening the absolute probability differences.
  • Asymmetric Scaling as a Magnifying Glass: By separating the correct class from the incorrect ones, ATS provides the necessary "wiggle room" to lower the target class's dominance while magnifying the hidden, valuable relationships among the remaining classes.

Key Results

ATS consistently rescues large teachers from poor teaching performance, outperforming standard KD and several advanced state-of-the-art (SOTA) distillation variants:

  • Reversing the Performance Drop: On CIFAR-100, a standard ResNet110 teacher yields a VGG8 student accuracy of 71.35%. A smaller ResNet14 teacher actually does better (72.30%). By applying ATS to the large ResNet110 teacher, student accuracy bounces back up to 72.31%.
  • Outperforming SOTA: Across CIFAR-100, TinyImageNet, CUB, and Stanford Dogs, ATS beats specialized methods like Early-Stopped KD (ESKD), Teacher Assistant KD (TAKD), and Student Customized KD (SCKD) on average student accuracy.
  • Ensemble Gains: When combined with ensemble methods (KD+ATS+Ens), the approach achieves the highest overall accuracy, outperforming the strong ResKD baseline by roughly 1% on average across multiple student architectures.

Limitations and Future Work

  • Hyperparameter Tuning: ATS introduces one additional hyperparameter ($\tau_2$). While the authors provide a solid heuristic—recommending that $\tau_2 \in [\tau_1 - 2, \tau_1 - 1]$—it still requires empirical tuning depending on the dataset and model architecture.
  • Diminishing Returns on Equal Capacity: The authors note that ATS is less effective when the teacher and student have similar capacities (e.g., distilling from a WRN40-2 to a WRN16-2). In these scenarios, the performance gain behaves more like standard hyperparameter tuning, meaning ATS is strictly optimized for bridging large capacity gaps.

Summary updated

Abstract

Knowledge Distillation (KD) aims at transferring the knowledge of a well-performed neural network (the {\it teacher}) to a weaker one (the {\it student}). A peculiar phenomenon is that a more accurate model doesn't necessarily teach better, and temperature adjustment can neither alleviate the mismatched capacity. To explain this, we decompose the efficacy of KD into three parts: {\it correct guidance}, {\it smooth regularization}, and {\it class discriminability}. The last term describes the distinctness of {\it wrong class probabilities} that the teacher provides in KD. Complex teachers tend to be over-confident and traditional temperature scaling limits the efficacy of {\it class discriminability}, resulting in less discriminative wrong class probabilities. Therefore, we propose {\it Asymmetric Temperature Scaling (ATS)}, which separately applies a higher/lower temperature to the correct/wrong class. ATS enlarges the variance of wrong class probabilities in the teacher's label and makes the students grasp the absolute affinities of wrong classes to the target class as discriminative as possible. Both theoretical analysis and extensive experimental results demonstrate the effectiveness of ATS. The demo developed in Mindspore is available at https://gitee.com/lxcnju/ats-mindspore and will be available at https://gitee.com/mindspore/models/tree/master/research/cv/ats.
BibTeX
@inproceedings{li2022asymmetric,
  author = {Xin-Chun Li and Wen-Shu Fan and Shaoming Song and Yinchuan Li and Bingshuai Li and Yunfeng Shao and De-Chuan Zhan},
  title = {{Asymmetric Temperature Scaling Makes Larger Networks Teach Well Again}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
}
Figure