Softmax bug found in all implementations; FlashAttention FP4 fix in CroissAttn

jon_barron · x · 2026-10-25

Jon Barron reports that all existing softmax and cross-entropy implementations — JAX, PyTorch, textbooks — harbor two subtle bugs; a simple rewrite fixes both and eliminates "slingshots" during grokking.

Follow-up: FlashAttention's backward pass has the same zero-sum bug. With FP4 stochastic rounding it's wrong on every draw; the ICLR'27 submission CroissAttn fixes it, unlocking end-to-end FP4 training.

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

Original post →

More from Infra

Infra channel →