FULL STORY
Softmax and Cross-Entropy Numerical Bugs: From Reveal to Paper
Google DeepMind researchers revealed two numerical bugs in softmax and cross-entropy implementations, sparking discussion, then published an arXiv paper detailing the fixes.
2026-10-24 ~ 2026-10-28 · 2 episodes · 24 posts
Episode 1 · Google's Barron Reveals Two Numeric Bugs in All Softmax/Cross-Entropy Implementations (2026-10-24, 21 posts)
On October 24, Google/DeepMind researchers Jonathan T. Barron, Dan Gnanapragasam and Michael Tschannen released an arXiv paper, "A Fix for Softmax and Cross-Entropy," showing that every existing softmax, log-softmax and cross-entropy implementation — including JAX, PyTorch and textbook formulations — contains two subtle numeric bugs fixable by one simple rewrite. The fix was validated on grokking training dynamics, and FlashAttention's backward pass is also affected. Barron announced the results himself across multiple posts, with the news spread by reposts and retellings from ZeYanjie, codestar, IgorCarron, burkov, lmoroney and others.
Confirmed
- The first bug, termed "Softmax Collapse" per lmoroney's retelling, triggers when one logit is far larger than the rest; burkov notes it zeroes out gradients for high-confidence correct predictions while other classes retain small gradients. Barron's training curves show standard cross-entropy loss oscillating during grokking while the fixed version converges smoothly, eliminating slingshot spikes and accelerating grokking.
- The second bug, "Softmax Cancellation": when model logits are very close to soft-target logits (e.g., a distilled student initialized from its teacher), existing implementations produce non-zero gradients even when student equals teacher.
- Barron notes that Adam's default eps=1e-8 happens to hit the bug-related threshold — a notable coincidence.
- Per reposted information, FlashAttention's backward pass is also affected, broadening the blast radius beyond direct softmax/cross-entropy calls.
- Barron also disclosed his AI-assisted workflow: the bug was first found and fixed by Gemini Flash 3.7, most experiments were run by Flash 3.8, and Gemini 4 Argon wrote the initial draft after being fed his old papers for style, before Barron rewrote it by hand.
Why it matters
- Softmax and cross-entropy are among the most fundamental, widely used operators in deep learning; a pervasive implementation-level numeric flaw affects virtually all training and distillation pipelines, and FlashAttention's involvement extends it further.
- The fix may reshape how the community interprets grokking and slingshot phenomena — these "mysterious" dynamics may partly stem from numeric error rather than algorithmic essence, directly affecting the credibility of related research conclusions.
- Jon Barron: every softmax/cross-entropy implementation has two subtle numerical bugs — jon_barron · 2026-10-24
- All existing softmax/cross-entropy implementations have a subtle bug, says Google's Jon Barron — jon_barron · 2026-10-24
- Fixing cross-entropy removes grokking spikes; Adam's default eps=1e-8 sits right past the bug — jon_barron · 2026-10-24
- Softmax bug #2: distillation gradients are non-zero even when student equals teacher — jon_barron · 2026-10-24
- Google researchers find two numerical bugs in softmax/cross-entropy, fixing Slingshot and grokking issues — jon_barron · 2026-10-24
- Jon Barron details his workflow: Gemini runs experiments, drafts the paper, then rewrites in his style — jon_barron · 2026-10-24
- Google researchers fix two numerical bugs in softmax and cross-entropy, eliminating 'Slingshot' — ZeYanjie · 2026-10-24
- Jon Barron: every softmax/cross-entropy implementation in JAX, PyTorch has two subtle bugs — khademinori · 2026-10-24
- Subtle numerical bugs in softmax/cross-entropy may cause mysterious training loss spikes — lmoroney · 2026-10-24
- Jon Barron: every softmax & cross-entropy implementation (JAX, PyTorch) has two subtle bugs — code_star · 2026-10-24
- Jon Barron: every softmax and cross-entropy implementation (JAX, PyTorch) has two subtle bugs — IgorCarron · 2026-10-24
- DeepMind paper finds numerical bugs in softmax and cross-entropy; fix lifts grokking accuracy to 100% — JFPuget · 2026-10-24
- Jon Barron: all softmax and cross-entropy implementations (JAX, PyTorch, textbooks) harbor two subtle bugs — agarwl_ · 2026-10-24
- Jon Barron: every softmax & cross-entropy implementation (JAX, PyTorch) has two subtle bugs — jon_barron · 2026-10-25
- Google DeepMind finds two numerical errors in standard softmax and cross-entropy — burkov · 2026-10-25
- Google DeepMind Paper Finds Two Numerical Errors in Standard Softmax and Cross-Entropy — burkov · 2026-10-25
- Jon Barron: every softmax & cross-entropy implementation (JAX, PyTorch) has two subtle bugs — a simple rewrite fixes both and removes grokking slingshots — chrisemoody · 2026-10-25
- Softmax bug found in all implementations; FlashAttention FP4 fix in CroissAttn — jon_barron · 2026-10-25
- Jon Barron: All Existing Softmax & Cross-Entropy Implementations Harbor Two Subtle Bugs — jon_barron · 2026-10-25
- DeepMind paper exposes two numerical bugs in standard softmax and cross-entropy — kalyan_kpl · 2026-10-25
Episode 2 · Google Paper Reveals Two Numerical Bugs in All Softmax Implementations (2026-10-27, 3 posts)
Google DeepMind researchers show that all existing softmax and cross-entropy implementations, including JAX, PyTorch and textbooks, contain two numerical bugs. A follow-up discussion notes the same issue also affects KL-divergence uses such as KL regularization in reinforcement learning.
- Jon Barron: every softmax and cross-entropy implementation has two subtle numerical bugs — jon_barron · 2026-10-27
- Softmax's standard implementations hide two numerical bugs, Google paper shows — srush_nlp · 2026-10-28
- Same softmax numerical bug also affects KL regularizers in RL, researcher notes — heghbalz · 2026-10-28