Streaming Attention Approximation with Page-Aligned Memory Management

Jane H. Lee, Neharika Jali, Insu Han, Amir Zandieh, Jieru Mei, Jinoo BaekMLForSys @ NeurIPS 2026

TL;DR

Large language models (LLMs) struggle with long contexts because their attention mechanism scales quadratically with sequence length, eating up GPU memory. While recent streaming algorithms can compress this memory with strong theoretical guarantees, they operate on individual tokens—ignoring how real inference systems like vLLM actually manage memory in contiguous pages (blocks). This paper bridges that gap by introducing a page-aligned eviction algorithm with provable error bounds, showing that it preserves downstream accuracy at a 25% memory budget and delivers up to a 3× decode-step speedup at 64K tokens.

What Problem Does This Paper Address?

In Transformer-based LLMs, causal self-attention requires storing a growing Key-Value (KV) cache as new tokens arrive. To keep memory in check, streaming attention approximation algorithms selectively evict past tokens while guaranteeing that future queries will still get accurate attention outputs.

The catch? These theoretical algorithms treat individual tokens as the unit of memory. In practice, serving systems like vLLM allocate physical GPU memory in fixed-size contiguous blocks (pages) of $L$ tokens. Freeing a single token here and there doesn't actually reclaim any physical memory; you only get real memory savings when an entire page is evicted. The authors tackle this mismatch: how do we design a streaming attention approximation that evicts whole pages at once, without losing theoretical guarantees or downstream model quality?

Methods

The authors build on prior streaming attention work that uses an exponential kernel feature map and a "self-balancing walk" to decide what to keep. They introduce two main algorithmic improvements:

  • Page-Level Pruning with Synchronized Caches: Prior work estimated the attention numerator (keys weighted by values) and denominator (keys alone) independently, meaning the kept tokens for one might not match the other. The authors fix this by lifting each block of tokens into a single joint vector that combines both the numerator and a $\lambda$-scaled denominator, then applying the self-balancing walk to whole blocks.
  • Data-Dependent Page Coherence: Naively, grouping $L$ tokens into a page could make the worst-case approximation error $L$ times worse. To show why this doesn't happen in practice, the authors define a "block factor" $\rho_b$—the ratio of a page's joint norm to the largest individual token norm inside it. When $\rho_b$ is small (meaning tokens within a page don't all point in the exact same worst-case direction), page-level balancing matches the error bounds of token-level balancing.

They wrap this page-level halving routine in a streaming framework and integrate it into vLLM.

Datasets

The authors evaluate two models—Qwen3-14B and Llama-3.1-8B-Instruct—across three standard benchmarks, measuring Answer F1 score:

  • HotPotQA (multi-hop question answering)
  • Longbench Long Code Completion (LCC) (long-context coding)
  • Grade School Math (GSM8K) (math reasoning)

No new datasets were introduced.

Key Insights and Ideas

  • Worst-case page penalties don't happen in real KV caches: While theory allows a page of size $L$ to be $L$ times harder to balance than a single token, real LLM KV caches exhibit low page coherence. In an audit of Qwen3-14B on HotPotQA, even at block size $L=64$, the median block factor $\rho_b$ was just 1.40, and the maximum observed across over 1.2 million page instances was 4.23—far below the worst-case 64.
Figure 1: Observed joint page factor ver- sus the token quantity and worst-case L factor. Both axes use a logarithmic scale.
  • Jointly balancing numerator and denominator works: Synchronizing the numerator and denominator into a single balancing step avoids the mismatch of prior independent-cache approaches, keeping theoretical guarantees intact while remaining practical to implement.

Key Results

  • Downstream Quality: At a 25% physical KV-cache budget, the authors' Joint balance and Denominator balance variants consistently match or outperform existing block-eviction baselines (Uniform block sampling, ChunkKV, and PagedEviction). On Qwen3-14B, Joint balance achieves the highest F1 across all three tasks (57.98 on HotPotQA, 46.41 on LCC, 74.55 on GSM8K). On Llama-3.1-8B-Instruct, it reaches 53.04 on GSM8K, notably ahead of the next-best baseline (ChunkKV at 49.81).
  • Latency & Memory Scaling: In a controlled decode-step benchmark (including KV reconstruction, Triton-based page selection, write-back, and attention), eviction-step latency stays roughly constant as sequence length grows at batch size $B=16$, crossing FullKV latency between 32K and 64K tokens. At $N=64\text{K}$ tokens and $B=64$, the method achieves an approximately 3× decode-step speedup. In vLLM, it also reduces peak GPU memory and prevents preemption thrashing under memory pressure.
Figure 2: Decode latency under sequence- length and batch-size ablations.

Limitations and Future Work

The authors note that their vLLM integration is an initial stress test: the current vLLM scheduler isn't aware that their method bounds each request's retained KV state, so they had to disable full-input-length sequence reservation to expose the memory-saving behavior.

Looking ahead, they plan to improve the vLLM scheduler integration, run broader ablations across more model sizes and tasks (especially agentic settings), compare against token-level pruning methods that use memory repacking, and make compression more adaptive by using query information to decide when to compress.

Summary updated

BibTeX
@inproceedings{lee2026streaming,
  author = {Jane H. Lee and Neharika Jali and Insu Han and Amir Zandieh and Jieru Mei and Jinoo Baek},
  title = {{Streaming Attention Approximation with Page-Aligned Memory Management}},
  booktitle = {MLForSys @ NeurIPS},
  year = {2026},
  url = {https://openreview.net/forum?id=IQONQuTJxT},
}
Figure