Why Low-Precision Transformer Training Fails: An Analysis on Flash Attention
Haiquan Qiu (Tsinghua University), Quanming Yao
International Conference on Learning Representations 2026 · Oral
Overview
Modern large language model training relies heavily on hardware acceleration enabled by low-precision data formats like BF16 (Brain Floating Point 16) and optimized memory-efficient attention kernels such as FlashAttention. While these technologies dramatically reduce memory footprints and accelerate throughput, their combination frequently introduces catastrophic training instabilities. In this talk presented at ICLR, Haiquan Qiu from Tsinghua University investigates why low-precision transformer training fails when paired with FlashAttention, demonstrating that the failure stems from a subtle interaction between the two rather than either technique in isolation.

Key moments
- 0:00 Introduction and background on low-precision transformer training failures
- 2:00 Narrowing the search space and identifying the backward pass
- 4:00 Key results on structured and biased gradient errors
- 6:00 Locating the error source in matrix multiplication and accumulation
- 8:00 Proposed simple fix using dynamic maximum for balanced rounding
- 9:36 Conclusion and key insights on breaking error accumulation mechanisms
Why Low-Precision Transformer Training Fails: An Analysis on Flash Attention
Speakers: Haiquan Qiu (Tsinghua University); Quanming Yao
Conference: ICLR
YouTube: https://slideslive.com/39062232
Overview
Modern large language model training relies heavily on hardware acceleration enabled by low-precision data formats like BF16 (Brain Floating Point 16) and optimized memory-efficient attention kernels such as FlashAttention. While these technologies dramatically reduce memory footprints and accelerate throughput, their combination frequently introduces catastrophic training instabilities. In this talk presented at ICLR, Haiquan Qiu from Tsinghua University investigates why low-precision transformer training fails when paired with FlashAttention, demonstrating that the failure stems from a subtle interaction between the two rather than either technique in isolation.
The implications of this work are significant for infrastructure teams and model builders. When large-scale training runs diverge due to numerical instability, the wasted compute translates directly into millions of dollars and thousands of GPU hours. By dissecting the backward pass of FlashAttention down to individual floating-point operations, the researchers uncover a structured, biased rounding error rather than random numerical noise. They introduce a diagnostic tool called spectral alignment to detect these failures early and propose a simple, dynamic adjustment fix that stabilizes training across multiple model architectures and optimizers.
Background
▶ Watch: Introduction and background on low-precision transformer training failures (0:00)
The pursuit of faster training schedules and larger context lengths has driven the machine learning community to adopt lower-precision numerical formats. Compared to traditional FP32 (32-bit floating point), BF16 provides an identical dynamic range with a smaller mantissa, allowing practitioners to scale up batch sizes, sequence lengths, and parameter counts on identical hardware. Concurrently, FlashAttention has become the industry standard for computing exact attention with reduced memory access overhead by leveraging SRAM tiling and recomputation during the backward pass.
However, practitioners frequently observe that coupling BF16 with FlashAttention leads to sudden training divergence—a phenomenon where validation loss abruptly spikes and model weights become Nan or Inf. Interestingly, this instability does not occur when using BF16 with classical attention, nor does it occur when using FP32 with FlashAttention. This points to a complex systemic interaction. Prior mitigation strategies such as QK normalization, logit soft-capping, gated attention, and QK clipping offer empirical relief but fail to explain the underlying mathematical mechanism causing the divergence.
Key Findings
▶ Watch: Key results on structured and biased gradient errors (4:00)
The primary discovery of this work is that low-precision gradient error in FlashAttention-based training is not random Gaussian noise; instead, it possesses distinct structure, low-rank properties, and directional bias.
- Tiling is not the root cause: By systematically disabling tiling in FlashAttention, the researchers proved that training still fails in a simplified, non-tiled setting, allowing them to isolate the instability to the second FlashAttention layer and specifically the backward pass.
- Head-specific sensitivity: Instability is often driven by localized phenomena; using high precision exclusively on critical attention heads (such as head 8 in their diagnostic analysis) restores training stability.
- Structured gradient error: Rather than varying randomly across tokens and training steps, the gradient error exhibits a repeated, low-rank pattern that aligns with a dominant subspace, causing parameter updates to move in a deleterious direction.
- Systematic positive bias: The low-precision delta term in the backward pass is systematically biased toward positive values, accumulating over time until spectral norms grow abnormally.
Technical Deep Dive
▶ Watch: Locating the error source in matrix multiplication and accumulation (6:00)
To isolate the precise origin of the gradient error, the authors traced the computation of the attention output $O$ (and its intermediate representations $\bar{O}$ and $\bar{P}$) through its three primary steps: computing exponential scores, multiplying by values $V$, and normalizing. By selectively elevating parts of this pipeline to high precision, they pinned the introduction of the error to the matrix multiplication and accumulation step: $\bar{O} = \bar{P} \times V$.
In both standard BF16 FlashAttention and high-precision variants, individual products use BF16 values while accumulations are executed in FP32. The divergence occurs at the final conversion step: low precision converts the accumulated result back to BF16, whereas high precision retains FP32.
The authors discovered that large errors spike during specific conditions involving the second occurrence of $\bar{P} = 1$:
- Two positions exhibit $\bar{P} = 1$ while alternative $\bar{P}$ values remain negligible.
- The corresponding $V$ values are exceptionally close to one another.
Under these conditions, the higher bits of the last 16 bits evaluate to zero due to $\bar{P} = 1$ and closely matched BF16 values of $V$, while the lower bits become non-zero due to small $\bar{P}$ values. This triggers an unbalanced rounding error where rounding-up occurs more aggressively than rounding-down. Because this numerical error possesses a directional bias rather than balancing around zero, it perpetually accumulates into the gradients across training steps.
To detect this pathology without running full-scale training to failure, the authors developed spectral alignment. By analyzing training trajectories for approximately 50 steps, spectral alignment identifies abnormal growth in spectral norms, signaling that parameter updates are locking onto a biased subspace.
Experimental Setup & Results
▶ Watch: Proposed simple fix using dynamic maximum for balanced rounding (8:00)
The empirical evaluation validates both the failure mechanism and the proposed mitigation strategy across multiple configurations:
- Architectures and Optimizers: Experiments were conducted on GPT-2 Small trained with AdamW, GPT-2 Small trained with Muon, and GPT-2 Medium trained with AdamW.
- Baseline Comparison: Standard BF16 FlashAttention runs consistently experienced sudden validation loss explosions across these configurations.
- The Stabilized Fix: The authors resolved the unbalanced rounding error by introducing a dynamic maximum adjustment based on the input, ensuring that higher bits in the last 16 bits maintain an even distribution between zeros and ones. This effectively neutralizes the systematic rounding bias without introducing fixed-maximum distortions.
- Outcome: Across all tested model scales and optimizers, the stabilized FlashAttention implementation maintained smooth, continuous loss reduction without divergence.
Practical Implications
▶ Watch: Conclusion and key insights on breaking error accumulation mechanisms (9:36)
For infrastructure teams and model deployers, these findings challenge the assumption that low-precision training errors behave as benign, zero-mean stochastic noise. When utilizing memory-efficient attention kernels, seemingly minor floating-point conversion mechanics can introduce systematic macroscopic biases that invalidate multi-million dollar training runs.
Practitioners should note that architecture design plays a defensive role: certain transformer configurations naturally suppress error accumulation, while others exacerbate it. Implementing diagnostic checks like spectral alignment allows teams to catch training pathologies within the first 50 steps rather than discovering divergence halfway through a long training schedule. Furthermore, adopting balanced rounding strategies or dynamic maximum adjustments provides a robust pathway to harness the speed of low-precision flash attention without sacrificing numerical integrity.
Key Takeaways
- Interaction Effect: Low-precision training failures with FlashAttention are caused by the interaction of BF16 and attention kernel mechanics, rather than either technology failing independently.
- Structured Error: Gradient errors in the backward pass are not random noise; they exhibit low-rank structure, temporal repetition, and directional bias.
- The Root Cause: Unbalanced rounding errors occur during accumulation steps when specific attention weight configurations ($\bar{P}=1$ with close $V$ values) force systematic rounding-up.
- Early Detection: Spectral alignment enables engineers to detect training instability and abnormal subspace alignment within approximately 50 retraining steps.
- Simple Remediation: Using a dynamic maximum adjustment balances bit distributions during floating-point conversion, successfully stabilizing transformer training across various optimizers (AdamW, Muon) and model scales (GPT-2 Small/Medium).
About the Speaker(s)
Haiquan Qiu of Tsinghua University presented the work, co-authored with Quanming Yao.
Reviews
→ Top-rated talks at International Conference on Learning Representations 2026
All talks from International Conference on Learning Representations 2026