Exploring the Impact of Temperature Scaling in Softmax for Classification and Adversarial Robustness
Not on the map. Why?
Abstract (arXiv)
The softmax function is a fundamental component in deep learning. This study delves into the often-overlooked parameter within the softmax function, known as "temperature," providing novel insights into the practical and theoretical aspects of temperature scaling for image classification. Our empirical studies, adopting convolutional neural networks and transformers on multiple benchmark datasets, reveal that moderate temperatures generally introduce better overall performance. Through extensive experiments and rigorous theoretical analysis, we explore the role of temperature scaling in model training and unveil that temperature not only influences learning step size but also shapes the model's optimization direction. Moreover, for the first time, we discover a surprising benefit of elevated temperatures: enhanced model robustness against common corruption, natural perturbation, and non-targeted adversarial attacks like Projected Gradient Descent. We extend our discoveries to adversarial training, demonstrating that, compared to the standard softmax function with the default temperature value, higher temperatures have the potential to enhance adversarial training. The insights of this work open new avenues for improving model performance and security in deep learning applications.
Key facts. Cited by 9 papers in the map (data through 7 Oct 2026). Builds on 22 of its 27 references that are in the map. First posted on arXiv 28 Feb 2025.
Builds on
22 of 27 references.
References · 22
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2015Distilling the Knowledge in a Neural Networkcited by 10,076
- 2018Representation Learning with Contrastive Predictive Codingcited by 7,662
- 2017Towards Deep Learning Models Resistant to Adversarial Attackscited by 6,326
- 2017On Calibration of Modern Neural Networkscited by 4,860
- 2016Simple and Scalable Predictive Uncertainty Estimation using Deep Ensemblescited by 3,888
- 2016Towards Evaluating the Robustness of Neural Networkscited by 2,976
- 2018Unsupervised Feature Learning via Non-Parametric Instance-level Discriminationcited by 1,838
- 2020Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attackscited by 1,442
- 2020Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hyperspherecited by 1,393
- 2017Regularizing Neural Networks by Penalizing Confident Output Distributionscited by 461
- 2020Understanding the Behaviour of Contrastive Losscited by 397
10 more
- 2021Revisiting the Calibration of Modern Neural Networkscited by 387
- 2019Beyond temperature scaling: Obtaining well-calibrated multiclass probabilities with Dirichlet calibrationcited by 359
- 2019Minimally distorted Adversarial Examples with a Fast Adaptive Boundary Attackcited by 333
- 2017ICNet for Real-Time Semantic Segmentation on High-Resolution Imagescited by 261
- 2022Almost-Orthogonal Layers for Efficient General-Purpose Lipschitz Networkscited by 39
- 2018Evaluating and Understanding the Robustness of Adversarial Logit Pairingcited by 34
- 2020Temperature check: theory and practice for training models with softmax-cross-entropy lossescited by 31
- 2019Label Smoothing and Logit Squeezing: A Replacement for Adversarial Training?cited by 18
- 2022Improving Adversarial Robustness with Self-Paced Hard-Class Pair Reweightingcited by 6
- 2020Constraining Logits by Bounded Function for Adversarial Robustnesscited by 3
Built on by
Citing papers per year: 2025: 5; 2026: 4.
9 papers.
- 2025Subquadratic Algorithms and Hardness for Attention with Any Temperaturecited by 4
- 2025When Flatness Does (Not) Guarantee Adversarial Robustnesscited by 3
- 2025GenoArmory: A Unified Evaluation Framework for Adversarial Attacks on Genomic Foundation Modelscited by 2
- 2025Composable Score-based Graph Diffusion Model for Multi-Conditional Molecular Generationcited by 2
- 2026Demystifying When Pruning Works via Representation Hierarchiescited by 2
- 2026Sinkhorn doubly stochastic attention rank decay analysiscited by 2
- 2025Analytical Softmax Temperature Setting from Feature Dimensions for Model- and Domain-Robust Classificationcited by 0
- 2026Deep Learning-based Binary Analysis for Vulnerability Detection in x86-64 Machine Codecited by 0
- 2026Toward Epistemic Stability: Engineering Consistent Procedures for Industrial LLM Hallucination Reductioncited by 0
- 2026Sinkhorn doubly stochastic attention rank decay analysis9 Apr 2026
- 2026Demystifying When Pruning Works via Representation Hierarchies25 Mar 2026
- 2026Toward Epistemic Stability: Engineering Consistent Procedures for Industrial LLM Hallucination Reduction8 Mar 2026
- 2026Deep Learning-based Binary Analysis for Vulnerability Detection in x86-64 Machine Code14 Jan 2026
- 2025When Flatness Does (Not) Guarantee Adversarial Robustness16 Oct 2025
- 2025Composable Score-based Graph Diffusion Model for Multi-Conditional Molecular Generation11 Sep 2025
- 2025Subquadratic Algorithms and Hardness for Attention with Any Temperature20 May 2025
- 2025GenoArmory: A Unified Evaluation Framework for Adversarial Attacks on Genomic Foundation Models16 May 2025
- 2025Analytical Softmax Temperature Setting from Feature Dimensions for Model- and Domain-Robust Classification22 Apr 2025