What is the difference between exact efficient attention like FlashAttention and approximate attention like sparse or linear attention?

Last updated 22 November 2026

  • Exact methods like FlashAttention compute the same output (up to rounding) as a drop-in replacement. FLOPs stay O(N²d) and gains come from less memory traffic.

  • Approximate methods change the function: sparse attention (Longformer, BigBird) scores only selected pairs, and linear or low-rank attention (Performer, Linformer) reaches O(N), at some cost in quality and recall.

  • Approximate methods usually need training with the approximation and are often not faster at moderate N due to irregular memory access. The ideas can combine, e.g. sliding-window inside FlashAttention kernels.

  • https://medium.com/@izzetcansorna/flashattention-and-io-aware-algorithms-exact-attention-without-the-memory-traffic-b1cbc88442ee
  • https://medium.com/@thekzgroupllc/a-visual-guide-to-flash-attention-linear-attention-and-efficient-transformers-32e4f900d084
  • https://attention-survey.github.io/
All Transformers interview questions