arXiv Machine Learning

On numerical issues of divergences between nearly equal distributions

Barron et al. (2026) highlighted numerical problems in softmax and soft cross‑entropy loss. This paper demonstrates that similar rounding and cancellation issues arise in standard divergence operations—forward and reverse Kullback‑Leibler (KL) divergence, generalized Jensen‑Shannon divergence (JSD), Monte Carlo KL estimates, and entropy—when the compared categorical distributions are nearly equal. The authors provide numerically stable reformulations and example implementations, validated through property‑based tests, to mitigate these problems in applications such as knowledge distillation, reinforcement learning, and proximal methods.

arXiv AI
Jun 18

Generalized Kullback-Leibler Divergence Loss

arXiv:2503. 08038v2 Announce Type: replace-cross Abstract: In this paper, we delve deeper into the Kullback-Leibler (KL) Divergence loss and mathematically prove that it is equivalent to the Decoupled Kullback-Leibler (DKL) Divergence loss that consists of (1) a weighted Mean Square Error (wMSE) loss and (2) a Cross-Entropy loss incorporating soft labels.

By Jiequan Cui, Beier Zhu, Qingshan Xu, Zhuotao Tian, Xiaojuan Qi, Bei Yu, Hanwang Zhang, Richang Hong
arXiv Machine Learning
Jun 19

Improved Stochastic Optimization of LogSumExp

arXiv:2509. 24894v4 Announce Type: replace-cross Abstract: The LogSumExp function, dual to the Kullback-Leibler (KL) divergence, plays a central role in many important optimization problems, including entropy-regularized optimal transport (OT) and distributionally robust optimization (DRO).

By Egor Gladin, Alexey Kroshnin, Jia-Jie Zhu, Pavel Dvurechensky
arXiv Machine Learning
Oct 23

A Fix for Softmax and Cross-Entropy

The paper identifies two numerical bugs in standard softmax, log‑softmax, and cross‑entropy implementations: Softmax Collapse, where a dominant logit causes its gradient to be rounded to zero, and Softmax Cancellation, where student and teacher logits that are equal still produce non‑zero gradients. The authors provide straightforward implementations that correct both issues. Their fix removes the previously observed "Slingshot" phenomenon, accelerates grokking with weight decay, prevents accuracy collapse without weight decay, keeps student networks aligned with teachers during distillation, and demonstrates that post‑memorization logit growth is bounded by an equilibrium between weight decay and Adam’s epsilon hyperparameter.

By Jonathan T. Barron, Dan Gnanapragasam, Michael Tschannen
arXiv Machine Learning
Oct 2

How Accurate Is Accurate Enough?

The paper investigates how the magnitude of numerical errors in a learning system should be evaluated, arguing that error impact depends on the current learning state, the class affected, and the class weight. By analyzing softmax cross‑entropy, the authors derive exact bounds on loss changes for fixed error sets and use these to provide finite‑error guarantees for losses, probabilities, predictions, and gradients. They then invert these guarantees to certify the maximum allowable primitive error for a given learning‑level requirement, demonstrating through von Mises‑Fisher learning that identical errors can have vastly different effects across states.

By Ningkang Peng, Qianfeng Yu, Jingyang Mao, Xiaoqian Peng, Yanhui Gu
Hugging Face Trending Papers
Sep 30

How Accurate Is Accurate Enough?

How accurate must a numerical approximation be within a learning system? Primitive error alone cannot answer this question: errors of the same magnitude can have very different consequences for losses...