{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/box-constrained-softmax-function-and-its","title":"Box-Constrained Softmax Function and Its Application for Post-Hoc Calibration","arxiv_id":"2506.10572","date":"2025-06-12","proceeding":null,"authors":["Kyohei Atarashi","Satoshi Oyama","Hiromi Arai","Hisashi Kashima"],"abstract":"Controlling the output probabilities of softmax-based models is a common problem in modern machine learning. Although the $\\mathrm{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 ($\\mathrm{BCSoftmax}$) function, a novel generalization of the $\\mathrm{Softmax}$ function that explicitly enforces lower and upper bounds on output probabilities. While $\\mathrm{BCSoftmax}$ is formulated as the solution to a box-constrained optimization problem, we develop an exact and efficient computation algorithm for $\\mathrm{BCSoftmax}$. As a key application, we introduce two post-hoc calibration methods based on $\\mathrm{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.","url_abs":"https://arxiv.org/abs/2506.10572v1","url_pdf":"https://arxiv.org/pdf/2506.10572v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"box-constrained-softmax-function-and-its","repo_url":"https://github.com/neonnnnn/torchbcsoftmax","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"decision-making","task_name":"Decision Making"}],"methods":[{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2506.10572","mcp":null,"developers":"https://syntology.ai/developers"},"arxiv_metadata":null,"syntology_extracted_results":null}