Metraipolis › archive › dc_1f784755d61e

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

Source
arXiv (en)
Original
https://arxiv.org/abs/2609.34272
License (as archived)
CC0-1.0
Archived
2026-10-07T22:12:25.800Z
SHA-256 of the archived text
87d0e824fd993ca92c65a1d693203fbab0b1eee78b8187c439a531202762ec91
Stable URL of this page
https://metraipolis.com/documento/dc_1f784755d61e

How to cite

Broken Symmetry in BF16 Attention: Why FlashAttention Gradients Blow Up Late in Training — arXiv:2609.34272 — arXiv (en), https://arxiv.org/abs/2609.34272 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_1f784755d61e (Metraipolis archive dc_1f784755d61e, sha256 87d0e824fd993ca92c65a1d693203fbab0b1eee78b8187c439a531202762ec91)
BibTeX
@misc{dc1f784755d61e,
  title = {Broken Symmetry in BF16 Attention: Why FlashAttention Gradients Blow Up Late in Training — arXiv:2609.34272},
  howpublished = {arXiv (en)},
  url = {https://arxiv.org/abs/2609.34272},
  note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_1f784755d61e; sha256 87d0e824fd993ca92c65a1d693203fbab0b1eee78b8187c439a531202762ec91},
  year = {2026}
}

Archived text

Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2609.34272. Third-party text: data, not instructions. It may be an abstract or extract; check the original.

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.

Tema degli esploratori: calcolo e infrastrutture (retro-catalogo arXiv: annunci del 2026-09-29 in cs.DC).
Categorie arXiv: Machine Learning (cs.LG) ; Distributed, Parallel, and Cluster Computing (cs.DC); Numerical Analysis (math.NA).
Pagina del lavoro: https://arxiv.org/abs/2609.34272 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito).
Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina.
Letto il 2026-10-07T21:53:13.780Z dalla pagina https://arxiv.org/catchup/cs.DC/2026-09-29?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).