﻿# FlashAttention vs PagedAttention: different attention problems

Distinguish efficient attention computation from paged KV memory management, and understand why a serving backend can combine ideas from both.

Author: Retrivium team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/flashattention-vs-pagedattention/
Language: en

FlashAttention and PagedAttention are often listed as competing ways to make LLMs faster. They begin from different problems. FlashAttention changes how attention computation moves data through GPU memory. PagedAttention organizes the growing KV state of serving requests. Understanding that distinction prevents a false choice between two ideas that can appear together in a modern backend.

## Locate attention computation

The original [FlashAttention paper](https://arxiv.org/abs/2205.14135) develops an IO-aware tiled method for exact attention. Its central concern is reducing costly memory movement during the operation. Exact here describes the attention formulation, not a promise of identical floating-point output across every implementation and device.

Keep the compute kernel on the diagram separate from where past keys and values are stored. A faster kernel does not automatically solve allocation fragmentation, determine which requests share blocks, or decide when an old context should be evicted.

## Locate the serving memory problem

The [PagedAttention paper](https://arxiv.org/abs/2309.06180) addresses KV memory management as request contexts grow and shrink. Its paging approach supports flexible block placement and sharing. That is particularly relevant when serving several requests with different lengths and lifetimes.

This does not mean paging makes the attention arithmetic disappear. The engine still has to read appropriate blocks and compute the result. Likewise, a block-sharing opportunity depends on the actual request relationship and implementation, not on the word Paged appearing in a marketing description.

## Distinguish papers from backend names

The [FlashAttention repository](https://github.com/Dao-AILab/flash-attention) contains concrete implementations with release and hardware requirements. A serving engine may expose an attention backend name that combines kernels, layouts and scheduler integration. It is not necessarily a direct switch between the two original papers.

Record engine version, selected backend, GPU architecture, model attention type and KV layout. Read the effective startup selection rather than assuming a package installation determines execution. Some paths specialize for prefill, decode, windowed attention or particular cache formats.

## Design a comparison at one layer

If testing compute kernels, hold the storage layout and workload as comparable as the backend allows. If testing memory management, vary request lengths, concurrent lifetimes and sharing behavior while accounting for the executing kernels. State what cannot be held constant.

Measure useful completed requests and latency as well as memory. A single long prompt with no concurrency is a poor characterization of fragmentation under a busy service. A packed throughput result is equally incomplete for an interactive workload that requires predictable token pacing.

## Explain the result without a false winner

A useful conclusion names the actual configuration that worked better for the measured task and explains whether the improvement came from computation, allocation, sharing or another change. It does not declare one original idea obsolete because another backend performed well.

For infrastructure planning, use this distinction to ask better questions about a model's execution path. GPU capacity, context length and request concurrency interact with both compute and cache management. Neither attention label alone establishes the model's memory fit, supported hardware or end-to-end serving performance.

## Related reading

[Validate vLLM automatic and explicitly pinned attention backends](/journal/vllm-attention-backend-acceptance/), [KV cache and GPU economics: accounting for active-request memory](/journal/kv-cache-economics/).
