Jon Barron: every softmax/cross-entropy implementation in JAX, PyTorch has two subtle bugs

khademinori · x · 2026-10-24

Jon Barron shared a new finding: all existing implementations of softmax and cross-entropy — including JAX, PyTorch, and textbooks — contain two subtle bugs. A simple rewrite fixes both and eliminates "slingshots" during grokking. Researchers including BlackHC amplified the result, noting how surprising it is that "basic" ML operations still have room for improvement.

Related event: Google's Barron Reveals Two Numeric Bugs in All Softmax/Cross-Entropy Implementations(21 posts)→

Original post →

More from Research

Research channel →