Papers › Box-Constrained Softmax Function and Its Application for Post-Hoc Calibration

Box-Constrained Softmax Function and Its Application for Post-Hoc Calibration

12 Jun 2025arXiv:2506.10572archive 2025-07-28

Kyohei Atarashi, Satoshi Oyama, Hiromi Arai, Hisashi Kashima

Controlling the output probabilities of softmax-based models is a common problem in modern machine learning. Although the Softmax function provides soft control via its temperature parameter, it lacks the ability to enforce hard constraints, such as box constraints, on output probabilities, which can be critical in certain applications requiring reliable and trustworthy models. In this work, we propose the box-constrained softmax (BCSoftmax) function, a novel generalization of the Softmax function that explicitly enforces lower and upper bounds on output probabilities. While BCSoftmax is formulated as the solution to a box-constrained optimization problem, we develop an exact and efficient computation algorithm for BCSoftmax. As a key application, we introduce two post-hoc calibration methods based on BCSoftmax. The proposed methods mitigate underconfidence and overconfidence in predictive models by learning the lower and upper bounds of the output probabilities or logits after model training, thereby enhancing reliability in downstream decision-making tasks. We demonstrate the effectiveness of our methods experimentally using the TinyImageNet, CIFAR-100, and 20NewsGroups datasets, achieving improvements in calibration metrics.

PaperPDFCode

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

Code

neonnnnn/torchbcsoftmax officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

Not run by Syntology. Nothing on this page verifies that the listed code works.

Tasks

Decision Making

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Softmax

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections