mlsanityData to 14 Oct 2026

Is Flash Attention Stable?

arXiv 2405.02803 ↗First posted 5 May 2024cs.LG cs.DCcited by 10

Not on the map. Why?

Abstract (arXiv)

Training large-scale machine learning models poses distinct system challenges, given both the size and complexity of today's workloads. Recently, many organizations training state-of-the-art Generative AI models have reported cases of instability during training, often taking the form of loss spikes. Numeric deviation has emerged as a potential cause of this training instability, although quantifying this is especially challenging given the costly nature of training runs. In this work, we develop a principled approach to understanding the effects of numeric deviation, and construct proxies to put observations into context when downstream effects are difficult to quantify. As a case study, we apply this framework to analyze the widely-adopted Flash Attention optimization. We find that Flash Attention sees roughly an order of magnitude more numeric deviation as compared to Baseline Attention at BF16 when measured during an isolated forward pass. We then use a data-driven analysis based on the Wasserstein Distance to provide upper bounds on how this numeric deviation impacts model weights during training, finding that the numerical deviation present in Flash Attention is 2-5 times less significant than low-precision training.

Key facts. Cited by 10 papers in the map (data through 14 Oct 2026). Builds on 11 of its 11 references that are in the map. First posted on arXiv 5 May 2024.

Builds on

11 of 11 references.

References · 11

  1. 2017Attention Is All You Needcited by 60,361
  2. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
  3. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
  4. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
  5. 2020Understanding the Difficulty of Training Transformerscited by 210
  6. 2018Statistical Aspects of Wasserstein Distancescited by 203
  7. 2023A Theory on Adam Instability in Large-Scale Machine Learningcited by 56
  8. 2021A Loss Curvature Perspective on Training Instability in Deep Learningcited by 40
  9. 2022Improving Deep Neural Network Random Initialization Through Neuronal Rewiringcited by 7
  10. 2022Accuracy Booster: Enabling 4-bit Fixed-point Arithmetic for DNN Trainingcited by 3
  11. 2022A PDE-based Explanation of Extreme Numerical Sensitivities and Edge of Stability in Training Neural Networkscited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 4; 2025: 1; 2026: 5.

10 papers.