# FlashAttention

> FlashAttention is an exact attention algorithm for transformers that computes attention in tiles held in fast on-chip GPU memory, reducing reads and writes to slower high-bandwidth memory so that attention runs faster and uses memory linear rather than quadratic in sequence length.

- Identifier: PTL-0252
- Category: Foundations
- Canonical URL: https://protologue.com/t/flashattention/
- Also known as: Flash Attention, IO-aware attention
- Introduced: 2022

## Description

Dao et al. argued that attention on GPUs is limited by memory traffic more than by arithmetic, and that earlier approximate attention methods often gave no real wall-clock speedup. FlashAttention computes the same result as standard attention. They reported faster end-to-end training of BERT-large and GPT-2, and that the memory savings allowed much longer contexts. It changes how attention is computed, not what the model computes, so it is usually adopted in training and inference libraries rather than chosen by prompt authors.

## Related terms

- [KV Cache](https://protologue.com/t/kv-cache/)
- [PagedAttention](https://protologue.com/t/pagedattention/)
- [Context Window](https://protologue.com/t/context-window/)

## Comparisons

- [FlashAttention vs PagedAttention](https://protologue.com/compare/flashattention-vs-pagedattention/)

## Sources

- Dao et al. (2022). FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness. https://arxiv.org/abs/2205.14135

## Cite this entry

Protologue. (2026). FlashAttention. In Protologue: A Taxonomy of Prompting and LLM Techniques (v1.7.0, PTL-0252). https://protologue.com/t/flashattention/

License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
