Is Flash Attention Stable?
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
- 2017Attention Is All You Needcited by 60,361
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
- 2020Understanding the Difficulty of Training Transformerscited by 210
- 2018Statistical Aspects of Wasserstein Distancescited by 203
- 2023A Theory on Adam Instability in Large-Scale Machine Learningcited by 56
- 2021A Loss Curvature Perspective on Training Instability in Deep Learningcited by 40
- 2022Improving Deep Neural Network Random Initialization Through Neuronal Rewiringcited by 7
- 2022Accuracy Booster: Enabling 4-bit Fixed-point Arithmetic for DNN Trainingcited by 3
- 2022A PDE-based Explanation of Extreme Numerical Sensitivities and Edge of Stability in Training Neural Networkscited by 1
Built on by
Citing papers per year: 2024: 4; 2025: 1; 2026: 5.
10 papers.
- 2024FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precisioncited by 519
- 2024The Open Source Advantage in Large Language Models (LLMs)cited by 18
- 2025Gated KalmaNet: A Fading Memory Layer Through Test-Time Ridge Regressioncited by 11
- 2024Characterizing and Efficiently Accelerating Multimodal Generation Model Inferencecited by 1
- 2026Fingerprinting Inference Systems of Large Language Modelscited by 1
- 2024UniForm: A Reuse Attention Mechanism Optimized for Efficient Vision Transformers on Edge Devicescited by 0
- 2026An Efficient vLLM-Based Inference Pipeline for Unified Audio Understanding and Generationcited by 0
- 2026FastTPS: An Optimized Method for LLM Token Phase for AI acceleratorscited by 0
- 2026Broken Symmetry in BF16 Attention: Why FlashAttention Gradients Blow Up Late in Trainingcited by 0
- 2026Backward-State Policy Is Part of the Learning Algorithmcited by 0
- 2026Backward-State Policy Is Part of the Learning Algorithm30 Sep 2026
- 2026Broken Symmetry in BF16 Attention: Why FlashAttention Gradients Blow Up Late in Training28 Sep 2026
- 2026FastTPS: An Optimized Method for LLM Token Phase for AI accelerators13 Jul 2026
- 2026An Efficient vLLM-Based Inference Pipeline for Unified Audio Understanding and Generation2 Jul 2026
- 2026Fingerprinting Inference Systems of Large Language Models28 May 2026
- 2025Gated KalmaNet: A Fading Memory Layer Through Test-Time Ridge Regression26 Nov 2025
- 2024The Open Source Advantage in Large Language Models (LLMs)16 Dec 2024
- 2024UniForm: A Reuse Attention Mechanism Optimized for Efficient Vision Transformers on Edge Devices3 Dec 2024
- 2024Characterizing and Efficiently Accelerating Multimodal Generation Model Inference30 Sep 2024
- 2024FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision11 Jul 2024