Google DeepMind Softmax Bug Fix Explained: Two Rounding Bugs Hiding in Every AI Training Run (World Tech)

google deepmind softmax bug fix explained — official paper figure showing Softmax Collapse precision cliffs

Image: Jonathan T. Barron, Dan Gnanapragasam and Michael Tschannen (Google DeepMind) — Figure 1a from "A Fix for Softmax and Cross-Entropy", showing Softmax Collapse (official paper figure, via the authors' project page).

TL;DR: Google DeepMind softmax bug fix explained: three Google DeepMind researchers found two rounding bugs in the standard softmax and cross-entropy code used by JAX, PyTorch and TensorFlow, and published a simple rewrite that fixes both.

📌 KEY HIGHLIGHTS

  • The paper: "A Fix for Softmax and Cross-Entropy" by Jonathan T. Barron, Dan Gnanapragasam and Michael Tschannen, posted to arXiv on 22 October 2026.
  • Bug one, Softmax Collapse: when a model gets very confident, the learning signal for the right answer rounds to zero — while the signals for wrong answers do not.
  • Bug two, Softmax Cancellation: when a student model nearly matches its teacher, the learning signal should be zero but plateaus at a noise floor instead.
  • The fix: rewrite the three functions in log space using softplus, expm1 and log1p — no higher-precision casting, and the authors say no meaningful slowdown.
  • The headline result: on the paper's small grokking benchmark, the fixed code hit 100.0% test accuracy in bf16, against 93.3% for the standard code.

What happened?

Almost every AI model is trained with two pieces of maths: softmax, which turns a model's raw scores (called logits) into probabilities, and cross-entropy, which measures how wrong those probabilities are. They sit at the heart of training in every major framework — JAX, PyTorch, TensorFlow — and in textbook code. On 22 October 2026, three Google DeepMind researchers posted a paper arguing that the standard implementations of both contain two numerical bugs, and that a simple rewrite fixes them. Lead author Jonathan Barron announced it on 23 October, writing that "all existing implementations of softmax and cross-entropy (that's JAX, PyTorch, textbooks, etc) have a subtle bug — two bugs, actually."

The problem is not in the maths but in how computers round numbers. Standard implementations shift logits by subtracting their maximum value to avoid overflow — a trick used everywhere. That shift is where both bugs hide. The paper also explains a mystery from earlier research: the "Slingshot" loss spikes seen when small networks learn simple rules late (a phenomenon called grokking). The authors say those spikes are "a direct consequence of Softmax Collapse" — the first bug.

Google DeepMind softmax bug fix explained: the two bugs

Softmax Collapse. As a model becomes more confident in the correct answer, the gap between the winning logit and the rest — the logit margin, m — grows. The true learning signal (gradient) on the right answer shrinks exponentially, but standard code rounds it to exactly zero once m crosses a "precision cliff" that depends on the number format. The gradients for wrong answers keep shrinking normally, so the gradients no longer sum to zero — and with adaptive optimisers like Adam, which normalise each gradient by its recent size, that asymmetry produces the recurring Slingshot loss spikes.

Softmax Cancellation. In knowledge distillation, a smaller student model is trained to copy a larger teacher. As the student's scores approach the teacher's, the true gradient should shrink toward zero. Instead, standard code computes the two models' probabilities separately and subtracts them, losing precision — so even when student and teacher scores are identical, the gradient is not zero. The student keeps drifting away from a teacher it has already matched. In the paper's distillation test, the fixed code stayed at zero divergence and 100% accuracy across precisions, while the standard code drifted in bf16 and showed a persistent error floor in fp32.

Number formatPrecision cliff (logit margin)What happens past it
bf16 (most AI training)≈ 5.5Target gradient rounds to zero; others do not
fp32≈ 16.6Same collapse, at a larger margin
fp64≈ 36.7Same collapse, at a much larger margin

The fix never adds 1 to a tiny number directly. It rewrites log-softmax, softmax and cross-entropy in log space, using the numerically stable softplus function, so the tiny signal survives down to exponent underflow (a margin of about 88). The paper prints the replacement code in JAX and calls it an easy drop-in replacement. On the small grokking benchmark (modular addition, a+b mod 31, mean of 5 seeds), the numbers tell the story:

Format, Adam epsilon 10^-8Standard cross-entropyFixed cross-entropy
bf1693.3%100.0%
fp3294.3%100.0%
fp64100.0%100.0%

google deepmind softmax bug fix explained — official paper figure showing Softmax Cancellation noise floor in distillation

Image: Barron, Gnanapragasam and Tschannen (Google DeepMind) — Figure 1b from "A Fix for Softmax and Cross-Entropy", showing Softmax Cancellation (official paper figure, via the authors' project page).

Why it matters for World Tech readers

For most people using AI, nothing changes tomorrow — and the authors are honest about that. They write that the extreme margins and near-zero student-teacher gaps in their experiments "are uncommon in standard large-scale training", and the tests are small: a one-layer Transformer on modular addition, plus a few other grokking tasks and a distillation test. This is a preprint, not yet peer-reviewed, and at the time of coverage the frameworks had not adopted the fix. Nobody should claim it makes ChatGPT or any big model suddenly better.

Where it does matter is for the people who build and train models — including India's huge developer community, one of the world's largest pools of AI engineers. If you train models in bf16, the format most AI training uses, the cliff arrives early: a margin of just 5.5. High-confidence predictions and distillation from a close teacher are exactly the situations where the bugs bite, and both are routine in fine-tuning and in compressing big models into smaller ones for phones and edge devices. A drop-in fix with no meaningful slowdown is the kind of change framework maintainers adopt quietly — and the kind of thing that, months later, shows up as slightly more stable training runs and fewer mysterious loss spikes. It is also a useful reminder that AI progress is not only new models: sometimes it is finding a rounding error in code everyone trusted. The same week brought related developer news: Node.js 26 becoming LTS on 28 October, Claude Mythos 5 designing quantum circuits, and OpenAI training frontier models with no internet access — the tooling and safety around AI are moving as fast as the models themselves.

Should you care?

✅ Yes — if you train or fine-tune models: check whether your framework adopts the fixed functions, and watch for them in distillation pipelines, where the cancellation bug directly costs accuracy. ⏳ Wait — if you only use AI tools: this changes nothing in your apps today; it is plumbing, not a product. 🔍 Honest caveat: the evidence is small-scale and unreviewed so far — treat the 100% benchmark as a proof of concept, not a promise for large models.

FAQs

What is softmax?
Softmax turns a model's raw scores for each possible answer into probabilities that add up to one. Cross-entropy then measures how far those probabilities are from the right answer, and training adjusts the model to reduce that error.

What are the two bugs in softmax and cross-entropy?
Softmax Collapse rounds the correct answer's learning signal to zero once the model is very confident, past a precision cliff of about 5.5 in bf16. Softmax Cancellation leaves a non-zero learning signal in distillation even when the student exactly matches the teacher, because subtracting two nearly equal probabilities loses precision.

Does this bug affect large models like ChatGPT?
Not proven. The paper's tests are small grokking and distillation tasks, and the authors say the extreme conditions they probe are uncommon in standard large-scale training. The fix is a plausible improvement for high-confidence and distillation settings, not a demonstrated upgrade for frontier models.

Should developers change their code now?
The paper prints drop-in JAX replacements and says they cost no meaningful slowdown, so experimenting is cheap. For production systems, the sensible move is to wait for your framework — JAX, PyTorch or TensorFlow — to adopt the fix, rather than patching core loss functions by hand.

Takeaway: Two rounding bugs hid in the most-used code in AI training; a short rewrite fixes both, and the real test now is whether the frameworks adopt it.

Follow World Tech on TechByCountry for tomorrow's update.

📸 Get tech in the last 24 hours on Instagram — follow @_techinlast24hrs for daily posts (9 AM–9 PM) and reels at 12:30 PM & 8:30 PM.

Sources

Barron, Gnanapragasam and Tschannen (Google DeepMind), "A Fix for Softmax and Cross-Entropy", arXiv:2610.31642, 22 October 2026 (primary source)
Authors' project page with figures and JAX code (primary source)
FourWeekMBA, "DeepMind Paper Finds Two Bugs in Standard Softmax Code", 24 October 2026
The Agent Times, "Google DeepMind Paper Identifies Two Numerical Bugs", 24 October 2026
TipRanks, "AI Training Stability Research Underscores Advancing Deep-Learning Practices", 24 October 2026

Comments