mlsanityData to 14 Oct 2026

Broken Symmetry in BF16 Attention: Why FlashAttention Gradients Blow Up Late in Training

arXiv 2609.34272 ↗First posted 28 Sep 2026cs.LG cs.DC cs.NAcited by 0

Not on the map. Why?

Abstract (arXiv)

BF16 is now standard in large-scale pretraining, including in fused attention kernels such as FlashAttention, and these kernels are widely trusted. When we used FlashAttention-3 to pretrain a 450M-parameter transformer on 50B tokens, however, we ran into a problem: training was healthy for 25B tokens, then the gradient norm grew a thousandfold and the loss ended 0.2 nats above FP32 attention, without a single NaN. Recomputing the attention backward of just two layers in FP32 removes almost all of the excess gradient. Part of the cause is known: a fused multiply-add in the forward softmax, so far treated as an extreme-input NaN case and never fixed in FlashAttention-3. Repairing it stops the blow-up, but the query gradient is still wrong by more than its own size, and training still drives attention logits to thousands of times their size under accurate gradients. The remaining error comes from a broken conservation law. The softmax score gradient sums to zero along every row, which makes the query gradient blind to where the keys sit as a group; rounding it to BF16 leaves a small nonzero sum that leaks the mean key into the gradient, and the leak grows exactly as late training makes keys large and attention sharp. We introduce GProj (gauge projection), which restores the zero sum after the cast with two rank-one corrections per row. It cuts the remaining median query/key gradient errors from 219%/13% to 0.34%/0.37%, on par with FP32 attention, for 4.7% more time per training step. In matched from-scratch runs it trains to the same loss as FP32 attention, while FlashAttention-3 and key smoothing both destabilize.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 22 of its 31 references that are in the map. First posted on arXiv 28 Sep 2026.

Builds on

22 of 31 references.

References · 22

  1. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
  2. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
  3. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
  4. 2017Mixed Precision Trainingcited by 1,156
  5. 2023Scaling Vision Transformers to 22 Billion Parameterscited by 694
  6. 2024FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precisioncited by 519
  7. 2025Muon is Scalable for LLM Trainingcited by 428
  8. 2015Deep Learning with Limited Numerical Precisioncited by 376
  9. 2024Massive Activations in Large Language Modelscited by 294
  10. 2020Query-Key Normalization for Transformerscited by 280
  11. 2019A Study of BFLOAT16 for Deep Learning Trainingcited by 232
  12. 2024When Attention Sink Emerges in Language Models: An Empirical Viewcited by 208
10 more
  1. 2023Small-scale proxies for large-scale Transformer training instabilitiescited by 183
  2. 2023Stabilizing Transformer Training by Preventing Attention Entropy Collapsecited by 161
  3. 2024SageAttention2: Efficient Attention with Thorough Outlier Smoothing and Per-thread INT4 Quantizationcited by 114
  4. 2024Scaling FP8 training to trillion-token LLMscited by 65
  5. 2020Revisiting BFloat16 Trainingcited by 17
  6. 2025Why Low-Precision Transformer Training Fails: An Analysis on Flash Attentioncited by 12
  7. 2024Is Flash Attention Stable?cited by 10
  8. 2026MXAttention: Data-Free Optimal Scaling and Pre-Normalization Quantization for MXFP4 Attentioncited by 2
  9. 2026Hardware-Aware FP4 FlashAttention-4cited by 2
  10. 2025Online Pseudo-average Shifting Attention(PASA) for Robust Low-precision LLM Inference: Algorithms and Numerical Analysiscited by 1

Built on by

Not cited yet.