Analytical Softmax Temperature Setting from Feature Dimensions for Model- and Domain-Robust Classification

Tatsuhito Hasegawa, Shunsuke Sakai
4/22/2025
cs.LGcs.CV

No confident code implementation found for this paper.

Abstract

In deep learning-based classification tasks, the softmax function's temperature parameter $T$ critically influences the output distribution and overall performance. This study presents a novel theoretical insight that the optimal temperature $T^*$ is uniquely determined by the dimensionality of the feature representations, thereby enabling training-free determination of $T^*$.

Show full abstract

Despite this theoretical grounding, empirical evidence reveals that $T^*$ fluctuates under practical conditions owing to variations in models, datasets, and other confounding factors. To address these influences, we propose and optimize a set of temperature determination coefficients that specify how $T^*$ should be adjusted based on the theoretical relationship to feature dimensionality. Additionally, we insert a batch normalization layer immediately before the output layer, effectively stabilizing the feature space. Building on these coefficients and a suite of large-scale experiments, we develop an empirical formula to estimate $T^*$ without additional training while also introducing a corrective scheme to refine $T^*$ based on the number of classes and task complexity. Our findings confirm that the derived temperature not only aligns with the proposed theoretical perspective but also generalizes effectively across diverse tasks, consistently enhancing classification performance and offering a practical, training-free solution for determining $T^*$.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{hasegawa2025analytical,
  title  = {Analytical Softmax Temperature Setting from Feature Dimensions for Model- and Domain-Robust Classification},
  author = {Tatsuhito Hasegawa and Shunsuke Sakai},
  year   = {2025},
  eprint = {2504.15594},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.15594v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2504.15594.svg)](https://codeofpaper.com/paper/2504.15594)

Discussion