Abstract
Knowledge distillation transfers knowledge from a large model to a small one via task and distillation losses. In this paper, we observe a trade-off between task and distillation losses, i.e., introducing distillation loss limits the convergence of task loss. We believe that the trade-off results from the insufficient optimization of distillation loss. The reason is: The teacher has a lower task loss than the student, and a lower distillation loss drives the student more similar to the teacher, then a better-converged task loss could be obtained. To break the trade-off, we propose the Distillation-Oriented Trainer (DOT). DOT separately considers gradients of task and distillation losses, then applies a larger momentum to distillation loss to accelerate its optimization. We empirically prove that DOT breaks the trade-off, i.e., both losses are sufficiently optimized. Extensive experiments validate the superiority of DOT. Notably, DOT achieves a +2.59% accuracy improvement on ImageNet-1k for the ResNet50-MobileNetV1 pair. Conclusively, DOT greatly benefits the student's optimization properties in terms of loss convergence and model generalization. Code will be made publicly available.
Introduction: The Flatness-Convergence Paradox
Knowledge Distillation (KD) is a cornerstone technique in model compression, where a compact "student" model is trained to mimic the behavior of a high-capacity "teacher." Traditionally, this involves optimizing two objectives: a standard task loss (such as cross-entropy) and a distillation loss (which aligns the student’s outputs or features with the teacher’s).
While KD is known to improve generalization by guiding the student toward "flatter" regions of the loss landscape, this paper identifies a significant drawback: a hidden trade-off between task and distillation losses. In standard KD practices, the introduction of a distillation objective often prevents the student from reaching the same level of training convergence it would achieve through independent task-based training. This is paradoxical; since the teacher model typically possesses a much lower task loss than the student, a student that successfully mimics the teacher should, in theory, achieve superior convergence. The authors argue that this failure stems from the insufficient optimization of the distillation loss relative to the task loss.
Methodology: The Distillation-Oriented Trainer (DOT)
To resolve this trade-off, the authors propose the Distillation-Oriented Trainer (DOT). Unlike standard optimizers (e.g., SGD) that apply a single momentum buffer to the combined gradient of all losses, DOT decouples the optimization dynamics of the task and distillation objectives.
Independent Momentum Buffers
DOT maintains two separate momentum buffers: $v_{ce}$ for the task loss ($L_{CE}$) and $v_{kd}$ for the distillation loss ($L_{KD}$). This separation allows the trainer to apply different update dynamics to each objective.
Momentum Weighting and KD Dominance
The core of DOT lies in its use of a hyperparameter, $\Delta$, to adjust the momentum coefficients:
- Task Loss Momentum: The coefficient is reduced to $\mu - \Delta$.
- Distillation Loss Momentum: The coefficient is increased to $\mu + \Delta$.
By assigning a larger momentum to the distillation loss, DOT ensures that the teacher's guidance becomes the dominant signal in the optimization process. This "persistent" gradient direction allows the student to move more decisively toward the teacher’s superior local minima. Rather than simply adjusting the static weights of the losses, DOT alters the temporal dynamics of the training process, effectively "steering" the student through the parameter space more efficiently.
Experimental Results
The authors evaluated DOT across three major image classification benchmarks: CIFAR-100, Tiny-ImageNet, and ImageNet-1k. The results demonstrate that DOT consistently breaks the Pareto front of standard KD, achieving both lower task loss and lower distillation loss.
- ImageNet-1k: Using a ResNet50 teacher and a MobileNetV1 student, DOT achieved a +2.59% top-1 accuracy improvement over the baseline.
- Tiny-ImageNet: On the ResNet18 to MobileNetV2 pair, DOT improved accuracy from 58.35% (standard KD) to 64.01%, a gain of over 5.6%.
- Universality: DOT proved effective across different distillation paradigms, including logit-based methods (mimicking final predictions) and feature-based methods (mimicking internal representations).
Visualizations of the loss landscapes further confirmed the method's efficacy. 3D plots of the loss surface revealed that DOT produces significantly deeper and flatter minima compared to standard KD or baseline training, confirming that the student benefits from both better convergence and improved generalization.
Discussion and Limitations
DOT represents a shift from weighting losses to weighting optimization dynamics. By treating momentum as a priority signal, it resolves gradient interference between the task and distillation objectives. However, some considerations remain for practical deployment:
- Hyperparameter Tuning: While the authors found $\Delta$ to be relatively stable (typically between 0.05 and 0.09), it remains an additional parameter that requires tuning based on the specific dataset and architecture.
- Implementation Complexity: For feature-based distillation, developers must ensure that the independent momentums are correctly applied to the relevant parameters, which may require more complex code structures than standard SGD.
- Scope: The current study focuses on image classification. While the results are promising, further research is needed to determine if these optimization dynamics translate to other domains such as Natural Language Processing (NLP) or Object Detection.
Conclusion
The Distillation-Oriented Trainer (DOT) successfully addresses the convergence-generalization trade-off in Knowledge Distillation. By prioritizing the distillation signal through independent momentum buffers, DOT enables student models to achieve superior optimization properties. The significant performance gains on large-scale benchmarks like ImageNet-1k suggest that DOT is a powerful tool for developing high-performance compact models.
Summary updated