# How can we reduce the quadratic attention cost and memory usage of large language models for long contexts while preserving performance?

Category: [Efficient Generative Modeling](../qcat/4.md) › [Large Language Model Efficiency](../qgroup/7.md) · 41 papers · Partly verified

[Open on the map](../questions.html#q4)

*41 papers; abstracts only, so this reports what papers claim.*

## Bottom line
Adaptive sparse computation, token pruning, KV cache compression, and conversion to linear/hybrid attention each claim near-parity quality with speedups or memory savings. The sharpest tension is how much sparsity is actually free: some papers report extreme decode-sparsity tolerance in pretrained models, while deployed sparse kernels deliver only modest end-to-end speedups with small accuracy drops, and it remains disputed whether stable extreme sparsity requires native sparse training. Evidence is thin where it matters most: accuracy is mostly measured on retrieval-style benchmarks, sparse, KV-compression, and linearization approaches are never compared under one protocol, and end-to-end results come mostly from 7-9B models.

## Convergence
### 1. Adaptive, input-dependent allocation of sparse computation tends to beat static or uniform allocation across tasks.
**4 papers** (1 self-reported results)
- [p153474](../p/153474.md) Prism Attention: Proposal-Refined Index Sharing Mechanism fo [method; not stated]: static cross-layer index reuse drifts from layer optima; coarse-to-fine refinement is state of the art
- [p155964](../p/155964.md) AdaCal: Adaptive Calibration for Robust Sparse Attention in  [method; not stated]: adaptive calibration improves robustness over strong static and dynamic baselines, clearest beyond 32K tokens
- [p154703](../p/154703.md) Flux Attention: Context-Aware Hybrid Attention for Efficient [method; not stated]: static full/sparse allocation ratios fail variable retrieval demands; layer routing gives up to 2.8x prefill speedup
- [p152092](../p/152092.md) BMAttn: Block-Aligned Mixed-Precision Attention Quantization [method; not stated]: uniform precision allocation misses non-uniform importance; block-aligned mixed precision gives 3.3x speedup with negligible loss

### 2. Sparse attention and token-pruning methods tend to preserve near-dense long-context accuracy while delivering prefill or decoding speedups. **[strength disputed]**
**3 papers**
- [p149510](../p/149510.md) FFTSparse: Relative-Position Correlation Guided Sparse Atten [method; not stated]: competitive downstream performance with up to 7.4x prefilling speedup at 128K and only 0.02% mask overhead
- [p154739](../p/154739.md) CommunityKV: Efficient Long-Context Decoding via Graph Parti [method; not stated]: up to 1.86x higher decoding throughput than FlashAttention-2 with negligible accuracy degradation
- [p150897](../p/150897.md) SparDA: Sparse Decoupled Attention for Efficient Long-Contex [method; not stated]: matches or slightly improves accuracy and delivers up to 1.25$\times$ prefill speedup and 1.7$\times$ decode speedup
- (qualifies) [p153990](../p/153990.md) CompactAttention: Accelerating Chunked Prefill with Block-Un [method; not stated] **[partial]**: Partial support: Shows a block‑sparse method preserving near‑dense accuracy with speedup, supporting part of the general claim.
- (qualifies) [p154875](../p/154875.md) Accelerating Long-Context LLM Prefill via Layer-wise Progres [method; not stated] **[partial]**: Partial support: Abstract shows a token‑pruning method maintains quality and speeds up TTFT, supporting part of the claim but not sparse attention.
- (qualifies) [p153990](../p/153990.md) CompactAttention: Accelerating Chunked Prefill with Block-Un [method; not stated] **[partial]**: Partial support: Shows a block‑sparse method preserving near‑dense accuracy with speedup, supporting part of the general claim.
- (qualifies) [p154875](../p/154875.md) Accelerating Long-Context LLM Prefill via Layer-wise Progres [method; not stated] **[partial]**: Partial support: Abstract shows a token‑pruning method maintains quality and speeds up TTFT, supporting part of the claim but not sparse attention.
- (qualifies) [p150897](../p/150897.md) SparDA: Sparse Decoupled Attention for Efficient Long-Contex [method; not stated] **[partial]**: speedups of 1.25x prefill and 1.7x decode are against a sparse-attention offload baseline, not dense attention
- (qualifies) [p152106](../p/152106.md) UniPrefill: Universal Long-Context Prefill Acceleration via  [method; not stated] **[partial]**: reports up to 2.1x TTFT speedup across architectures but the abstract gives no accuracy evaluation

### 3. Full-attention LLMs not natively trained for sparsity tolerate extreme sparsification with little quality loss.
**3 papers**
- [p140121](../p/140121.md) Long-Context Language Models Require Extreme Sparsity in Con [theory/correlational; not stated]: Qwen3.5-27B tolerates 100x decode sparsity on RULER-HARD, LOFT and AIME2025 without quality loss
- [p151309](../p/151309.md) Full Attention Strikes Back: Transferring Full Attention int [method; not stated]: full-attention models are intrinsically sparse; near-lossless sparsification needs only a few hundred training steps
- [p152659](../p/152659.md) Intrinsically Interpretable Attention via Sparse Post-Traini [method/probing; up to 7B parameters]: retains original pretraining loss while reducing attention connectivity to about 0.4% of edges on models up to 7B
- (qualifies) [p152659](../p/152659.md) Intrinsically Interpretable Attention via Sparse Post-Traini [method/probing; up to 7B parameters]: sparsity there serves an interpretability goal rather than inference efficiency

### 4. Pretrained softmax transformers can be converted to linear or hybrid efficient attention with modest training while approaching or exceeding original quality. **[strength disputed]**
**3 papers** (2 self-reported results)
- [p152654](../p/152654.md) GPA: General Principled Framework for Linearizing Softmax At [theory/method; not stated]: GPA inherits pretrained weights and outperforms MVA and GSA across benchmarks with less fine-tuning
- [p154501](../p/154501.md) Flexformer: Flexible Linear Transformer with Learnable Atten [method; not stated]: Flexformer distilled from pretrained transformers recovers softmax attention with strong long-sequence performance
- [p154037](../p/154037.md) Orthros: Phase-Aware Heterogeneous Attention for Efficient T [method/theory; not stated]: data-efficient Transformer-to-Orthros conversion yields performance that even surpasses the original Transformer
- (qualifies) [p151267](../p/151267.md) The Key to Going Linear: Analysis-Driven Transformer Lineari [method/causal; LLaMA and Qwen up to 32B]: frozen-backbone post-hoc linearization up to 32B matches long-context retrieval, but a quality gap remains

## Contested
### Does preserving quality at high sparsity require native sparse training? (scope difference)
- A: Training-free sparsification of pretrained full-attention models preserves accuracy. (p148257)
- B: Stable behaviour at extreme sparsity needs a natively trainable sparse attention framework. (p148158)
- Why: Training-free papers report moderate speedups at moderate sparsity; the trainable paper targets 97.3% sparsity, where it argues coarse block selection loses critical information.

### How much sparsity is actually free? (evidence gap) **[label disputed]**
- A: Current LLMs tolerate up to 100x decode sparsity without quality loss. (p140121)
- B: Deployed sparse kernels report roughly 1-2x end-to-end speedups with about 1% accuracy drops. (p155122)
- Why: p140121 measures task quality under sparsification without system integration; the other measures wall-clock speed on an implemented kernel.

### Is KV cache compression reliably safe? (scope difference)
- A: KV compression delivers memory savings at near-parity or better quality on long-context benchmarks. (p153808)
- B: Accurate compression is impossible in the worst case and requires characterizing intrinsic compressibility. (p153754)
- Why: p153754 gives worst-case theory; the other reports results on benchmarks that presumably lie in compressible regimes.

## Isolated claims (1 to 2 papers)
- Periodic sleep-like consolidation into SSM fast weights can clear the KV cache, with performance improving as sleep duration grows.
  - [p154950](../p/154950.md) Language Models Need Sleep [method/synthetic; not stated]: sleep phase converts recent context into SSM fast weights before clearing the KV cache; longer sleep improves performance
- New theory and implementations bring attention close to I/O-optimality, with almost-linear I/O cost and improved causal approximation guarantees.
  - [p154340](../p/154340.md) Approaching I/O-optimality for Approximate Attention [theory; not stated] **[partial]**: attention computed with almost-linear I/O cost, with lower bounds proving closeness to I/O-optimal
  - [p149745](../p/149745.md) Express Language Modeling [method/theory; not stated] **[disputed]**: converts non-causal approximations to causal with matching guarantees, speeding prefill and decoding over FlashAttention 2
- Buffering recent keys and values enables chunkwise linear-attention decoding, cutting decode latency by up to 45%.
  - [p154931](../p/154931.md) KVBuffer: IO-aware Serving for Linear Attention [method; not stated] **[partial]**: buffering recent keys and values enables chunkwise computation, reducing linear attention decoding latency by up to 45.17%
- Mask-aware distributed attention with zero-communication mask localization speeds context-parallel long-context training.
  - [p148370](../p/148370.md) FlashMask-3: Efficient and Expressive Mask-Aware Distributed [method; not stated]: zero-communication mask localization with mask-aware Hopper kernels improves throughput over Megatron-Core CP by up to 5.11x
- Learnable attention kernels and polynomial sketches improve linear attention over fixed-kernel baselines.
  - [p149962](../p/149962.md) Learnable Low-Rank Polynomial Sketch for Effective Linear At [method/theory; not stated] **[partial]**: learned low-rank polynomial sketch provably achieves strictly smaller approximation error and highest benchmark performance
- A token-level dynamic sparsification framework accelerates long-context prefill across full, hybrid, and sliding-window architectures while integrating with continuous batching in vLLM.
  - [p152106](../p/152106.md) UniPrefill: Universal Long-Context Prefill Acceleration via  [method; not stated] **[partial]**: applicable to virtually any model architecture, which directly accelerates the model's computation at the token level
- KV caches and context representations can be compressed via quantization, learned compression, or head reduction with near-parity quality. **[demoted: only 2 paper(s) verified]**
  - [p148693](../p/148693.md) SnapMLA: Efficient Long-Context MLA Decoding via Hardware-Aw [method; DeepSeek MLA models]: RoPE-aware per-token FP8 KV quantization keeps near-parity benchmark quality with up to 1.91x decoding throughput
  - [p155905](../p/155905.md) More Value per Key: Asymmetric Sparse Attention for Faster L [method/theory; not stated]: reducing key heads while keeping value heads gives over 2x decoding speedup, nearly matching GQA quality
  - [p155297](../p/155297.md) Virtual Head Attention [method; not stated] **[disputed]**: surpasses GQA at every scale while cutting KV cache 4x and lowering prefill FLOPs
  - [p156755](../p/156755.md) ARC-Encoder: learning compressed text representations for la [method; not stated] **[partial]**: encoder outputs 4-8x fewer continuous representations than tokens with strong performance across usage scenarios
  - [p150342](../p/150342.md) Distilling Sequential Computation in Transformer Language Mo [method; not stated] **[disputed]**: surrogate embeddings replace multi-token KV entries, cutting effective sequence length up to 40% with minimal degradation
  - [p150342](../p/150342.md) Distilling Sequential Computation in Transformer Language Mo [method; not stated] **[disputed]**: reduce effective sequence length by up to 40\% with minimal accuracy degradation across language-modeling evaluations
  - [p155297](../p/155297.md) Virtual Head Attention [method; not stated] **[disputed]**: reducing KV cache by $4\times$ vs.\ GQA-8 at dense scales
  - [p156755](../p/156755.md) ARC-Encoder: learning compressed text representations for la [method; not stated] **[partial]**: outputs $x$ times fewer continuous representations (typically $x\!\in\!\{4,8\}$) than text tokens

## Gaps
- Nearly all accuracy claims rest on retrieval-style benchmarks (RULER, LongBench, NIAH); open-ended generation quality at long contexts is rarely reported.
- No paper compares sparse attention, KV compression, and linearization under one protocol, so cross-approach trade-offs remain unclear.
- End-to-end speedups are mostly measured on 7-9B models; behaviour at much larger scale is largely untested.

## Off topic or tangential
- [p151159](../p/151159.md) ASAP: Attention Sink Anchored Pruning [method; not stated]: prunes vision transformer tokens at high resolution; LLM long-context cost is not addressed
- [p155131](../p/155131.md) ViT-AdaLA: Adapting Vision Transformers with Linear Attentio [method; not stated]: linearizes vision transformers for classification and segmentation, not language long-context inference
- [p154372](../p/154372.md) GeneZip: Region-Aware Compression for Long Context DNA Model [method; GeneZip 70M DNA models]: compresses DNA sequences for genomics pretraining; language long-context inference is out of scope
- [p154941](../p/154941.md) Basis-Mediated Bilinear Attention: A New Method for Greatly  [method; not stated]: reduces query-key parameter count, evaluated on ViT and GPT-2 small; not a long-context cost method
- [p150679](../p/150679.md) Mixture-of-Top-$k$ Attention: Efficient Attention as Scalabl [method/theory; not stated]: efficient attention framework but its experiments are on vision tasks only
- [p155577](../p/155577.md) Universal and Efficient Computation with 2D Attention [theory; not stated]: computability theory for 2D attention; no LLM long-context performance or efficiency measurements
- [p152166](../p/152166.md) TriSpec: Ternary Speculative Decoding via Lightweight Proxy  [method; not stated]: reduces speculative-decoding verification cost; attention's quadratic scaling is untouched
- [p154466](../p/154466.md) GRINQH: Graded Input-based Quantization Hierarchy for Effici [method; Llama3 and Qwen3]: weight-only quantization of model weights; attention compute and KV cache are not addressed

## Verification report
- revision: 40 findings sent back to the generator; the revised answer was checked again
- placement: 7 papers were in no claim; 6 added to an existing claim, 1 given a new claim, 0 marked off topic
- bottom line: 3 sentences written, 0 dropped and 1 narrowed where both judges agreed, 0 kept although the judges split, 0 not checked
- 37 paper-to-statement attributions checked by two judges; agreement: 28 both agree, 6 supports vs partial, 3 split
- changes: 3 claim disputed, 1 demoted, 5 disputed, 10 partial
- judge A (command-a-plus-05-2026): planted wrong statements caught 60 of 60; positive controls passed 60 of 60; claim-level overstatements caught 1 of 1; bottom-line overstatements caught 1 of 1
- judge B (deepseek/deepseek-v4-pro-0813): planted wrong statements caught 60 of 60; positive controls passed 60 of 60; claim-level overstatements caught 1 of 1; bottom-line overstatements caught 1 of 1

### Removed, changed or disputed by verification
- disputed: [p155297](../p/155297.md) KV caches and context representations can be compressed via quantization, learned compression, or head reducti -- disputed: judge A: Abstract discusses head reduction but not quantization or learned compression.; judge B: It reports head reduction compressing KV cache while improving quality, supporting the head-reduction
- disputed: [p150342](../p/150342.md) KV caches and context representations can be compressed via quantization, learned compression, or head reducti -- disputed: judge A: Abstract shows KV cache compression but not via quantization, learned compression, or head reduction.; judge B: It reports learned compression of KV cache and context with near-parity quality
- disputed: [p150342](../p/150342.md) KV caches and context representations can be compressed via quantization, learned compression, or head reducti -- disputed: judge A: Abstract shows KV cache compression but not via quantization, learned compression, or head reduction.; judge B: It reports learned compression of KV cache and context with near-parity quality
- disputed: [p155297](../p/155297.md) KV caches and context representations can be compressed via quantization, learned compression, or head reducti -- disputed: judge A: Abstract discusses head reduction but not quantization or learned compression.; judge B: It reports head reduction compressing KV cache while improving quality, supporting the head-reduction
- demoted: KV caches and context representations can be compressed via quantization, learned compression, or head reducti
- disputed: [p149745](../p/149745.md) New theory and implementations bring attention close to I/O-optimality, with almost-linear I/O cost and improv -- disputed: judge A: Abstract mentions I/O-aware implementation but not near I/O-optimality or almost-linear cost.; judge B: Abstract states improved causal guarantees and I/O-aware speedups, but not I/O-optimali
- claim_disputed: Sparse attention and token-pruning methods tend to preserve near-dense long-context accuracy while delivering  -- disputed: judge A said entailed: Sparse attention/token‑pruning methods maintain near‑dense long‑context accuracy while providing prefill and decoding speedups as shown.; judge B said overstated: Quotes support
- claim_disputed: Pretrained softmax transformers can be converted to linear or hybrid efficient attention with modest training  -- disputed: judge A said entailed: Quotes show conversion of pretrained transformers to efficient attention with modest training and performance at or above original.; judge B said overstated: Quotes support conv
- claim_disputed: How much sparsity is actually free? -- disputed: judge A said evidence gap: Position A reports up to 100× sparsity with no quality loss; Position B reports only 1‑2× speedups with ~1% accuracy drops. Evidence strength differs significantly.; judge B

## The 41 papers that ask this question

- [Full Attention Strikes Back: Transferring Full Attention into Sparse within Hundred Training Steps](../p/151309.md)
- [Block Sparse Flash Attention](../p/155122.md)
- [SnapMLA: Efficient Long-Context MLA Decoding via Hardware-Aware FP8 Quantized Pipelining](../p/148693.md)
- [CutAttn: Discovering Cognitive Transition Layers for Efficient Long-Context Prefilling](../p/148257.md)
- [Long-Context Language Models Require Extreme Sparsity in Context Dimension](../p/140121.md)
- [Prism Attention: Proposal-Refined Index Sharing Mechanism for Efficient LLMs Inference](../p/153474.md)
- [Language Models Need Sleep](../p/154950.md)
- [Express Language Modeling](../p/149745.md)
- [Flexformer: Flexible Linear Transformer with Learnable Attention Kernel](../p/154501.md)
- [CommunityKV: Efficient Long-Context Decoding via Graph Partitioning](../p/154739.md)
- [Orthros: Phase-Aware Heterogeneous Attention for Efficient Transformers](../p/154037.md)
- [FFTSparse: Relative-Position Correlation Guided Sparse Attention for Long-Context Language Models](../p/149510.md)
- [The Key to Going Linear: Analysis-Driven Transformer Linearization](../p/151267.md)
- [AdaCal: Adaptive Calibration for Robust Sparse Attention in Long-Context LLMs](../p/155964.md)
- [Flux Attention: Context-Aware Hybrid Attention for Efficient LLMs Inference](../p/154703.md)
- [BMAttn: Block-Aligned Mixed-Precision Attention Quantization for LLM Inference](../p/152092.md)
- [Universal and Efficient Computation with 2D Attention](../p/155577.md)
- [More Value per Key: Asymmetric Sparse Attention for Faster LLM Decoding](../p/155905.md)
- [Mixture-of-Top-k Attention: Efficient Attention as Scalable Fast Weights](../p/150679.md)
- [ARC-Encoder: learning compressed text representations for large language models](../p/156755.md)
- [Distilling Sequential Computation in Transformer Language Models](../p/150342.md)
- [KVBuffer: IO-aware Serving for Linear Attention](../p/154931.md)
- [GPA: General Principled Framework for Linearizing Softmax Attention via KV Cache Approximation](../p/152654.md)
- [Approaching I/O-optimality for Approximate Attention](../p/154340.md)
- [SparDA: Sparse Decoupled Attention for Efficient Long-Context LLM Inference](../p/150897.md)
- [GeneZip: Region-Aware Compression for Long Context DNA Modeling](../p/154372.md)
- [Basis-Mediated Bilinear Attention: A New Method for Greatly Reducing Query--Key Pathway Parameters](../p/154941.md)
- [Punctuation-aware Hybrid Trainable Sparse Attention for Large Language Models](../p/148158.md)
- [ViT-AdaLA: Adapting Vision Transformers with Linear Attention](../p/155131.md)
- [Learnable Low-Rank Polynomial Sketch for Effective Linear Attention](../p/149962.md)
- [The risk of KV cache compression](../p/153754.md)
- [KV Cache Compression via Attention Output Distortion Minimization](../p/153808.md)
- [Intrinsically Interpretable Attention via Sparse Post-Training](../p/152659.md)
- [CompactAttention: Accelerating Chunked Prefill with Block-Union KV Selection](../p/153990.md)
- [Accelerating Long-Context LLM Prefill via Layer-wise Progressive Token Pruning in Local Deployment](../p/154875.md)
- [FlashMask-3: Efficient and Expressive Mask-Aware Distributed Attention](../p/148370.md)
- [TriSpec: Ternary Speculative Decoding via Lightweight Proxy Verification](../p/152166.md)
- [Virtual Head Attention](../p/155297.md)
- [ASAP: Attention Sink Anchored Pruning](../p/151159.md)
- [GRINQH: Graded Input-based Quantization Hierarchy for Efficient LLM Generation](../p/154466.md)
- [UniPrefill: Universal Long-Context Prefill Acceleration via Block-wise Dynamic Sparsification](../p/152106.md)

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=q/4)
