Temperature check: theory and practice for training models with softmax-cross-entropy losses
arXiv:2010.07344
Abstract
The softmax function combined with a cross-entropy loss is a principled approach to modeling probability distributions that has become ubiquitous in deep learning. The softmax function is defined by a lone hyperparameter, the temperature, that is commonly set to one or regarded as a way to tune model confidence after training; however, less is known about how the temperature impacts training dynamics or generalization performance. In this work we develop a theory of early learning for models trained with softmax-cross-entropy loss and show that the learning dynamics depend crucially on the inverse-temperature as well as the magnitude of the logits at initialization, . We follow up these analytic results with a large-scale empirical study of a variety of model architectures trained on CIFAR10, ImageNet, and IMDB sentiment analysis. We find that generalization performance depends strongly on the temperature, but only weakly on the initial logit magnitude. We provide evidence that the dependence of generalization on is not due to changes in model confidence, but is a dynamical phenomenon. It follows that the addition of as a tunable hyperparameter is key to maximizing model performance. Although we find the optimal to be sensitive to the architecture, our results suggest that tuning over the range to improves performance over all architectures studied. We find that smaller may lead to better peak performance at the cost of learning stability.
References in corpus (14)
- Distilling the Knowledge in a Neural Network
- Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling
- Wide Residual Networks
- On Calibration of Modern Neural Networks
- Neural Tangent Kernel: Convergence and Generalization in Neural Networks
- DropBlock: A regularization method for convolutional networks
- Regularizing Neural Networks by Penalizing Confident Output Distributions
- On Lazy Training in Differentiable Programming
- Bayesian Deep Convolutional Networks with Many Channels are Gaussian Processes
- The large learning rate phase of deep learning: the catapult mechanism
- Neural Tangents: Fast and Easy Infinite Neural Networks in Python
- Classification is a Strong Baseline for Deep Metric Learning
- Improving Generalization via Scalable Neighborhood Component Analysis
- Why bigger is not always better: on finite and infinite neural networks