PyTorch and JAX are both named! Softmax exposed a hidden bug, Gemini takes credit
PyTorch、JAX都被点名!Softmax曝出隐藏Bug,Gemini立功
Jonathan T. Barron, Principal Research Scientist at Google DeepMind, and his team point out that the standard implementations of Softmax and cross-entropy commonly used by frameworks such as PyTorch, JAX, and TensorFlow have two numerical precision bugs, and they provide fixes that preserve the original mathematical definition and do not require increasing floating-point precision. Softmax Collapse occurs when the logit of the correct class leads other classes by more than a critical value (about 16.6 in fp32): the gradient of the correct class is erroneously zeroed and gradients of other classes remain; Softmax Cancellation occurs in knowledge distillation when the student and teacher outputs are nearly identical, where a gradient that should be zero retains a nonzero value due to floating-point rounding. In the paper, on a modulo-31 addition task, standard cross-entropy averaged 94.3%±5.4% test accuracy over 5 experiments, while the fixed version reached 100% in all; on a modulo-97 sum-of-squares task, the standard implementation's test accuracy dropped from 61% to 23% at about 1250 training steps.