Jon Barron: every softmax & cross-entropy implementation (JAX, PyTorch) has two subtle bugs — a simple rewrite fixes both and removes grokking slingshots

chrisemoody · x · 2026-10-25

Jon Barron shared a new result claiming that all existing implementations of softmax and cross-entropy — in JAX, PyTorch, and even textbooks — contain two subtle bugs. A simple rewrite fixes both and eliminates the "slingshot" spikes observed during grokking.

Prof. JB Huang of UT Austin enjoyed the paper enough to write an accessible explainer thread spreading the findings.

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

Original post →

More from Research

Research channel →