vAttention: Verified Sparse Attention

Aditya Desai, Kumar Krishna Agrawal, Shuo Yang, Alejandro Cuadron, Luis Gaspar Schroeder, Matei Zaharia, Joseph E. Gonzalez, Ion StoicaarXiv 2025 · DOI

Introduction

As Large Language Models (LLMs) scale to massive context windows (32K to 1M+ tokens), the "KV cache"—the memory used to store keys and values of previous tokens—becomes a critical performance bottleneck. During the decoding phase, the model must read the entire cache for every new token generated, making inference extremely memory-bound and slow.

Sparse attention is a common strategy to mitigate this by attending to only a subset of tokens. However, existing methods like top-$k$ or top-$p$ are largely heuristic. They often fail when attention is distributed uniformly across tokens and, crucially, lack formal guarantees that the approximation remains close to the full attention result. This paper introduces vAttention (Verified Attention), the first sparse attention mechanism to provide rigorous statistical $(\epsilon, \delta)$ guarantees on approximation accuracy.

The vAttention Framework

vAttention unifies deterministic and stochastic selection strategies to provide a robust approximation of the attention mechanism. The framework operates on three primary components:

  1. Deterministic Selection: The model always includes "heavy hitter" tokens, such as initial "sink" tokens, a local sliding window of recent tokens, and predicted top-$k$ tokens.
  2. Stochastic Selection: Uniform random sampling is employed to approximate the "long tail" of the remaining residual tokens.
  3. Adaptive Budgeting: The core innovation is the "Verified" budget. Given a user-specified error tolerance ($\epsilon$) and a failure probability ($\delta$), vAttention uses the Central Limit Theorem (CLT) to adaptively calculate the exact number of random samples required for each specific query and head to meet the error bound.
vAttention architecture illustrating the flow from user-defined error tolerance to adaptive budget computation and KV cache retrieval across GPU/CPU memory.

By adjusting the sampling budget on-the-fly, vAttention ensures that the relative error in the attention output is strictly controlled, prioritizing the accuracy of the Softmax denominator to maintain long-term generation stability.

Experimental Evaluation

The researchers evaluated vAttention across several demanding long-context benchmarks, including RULER (retrieval and reasoning over 32K contexts), LongBench, Loogle, and AIME2024 (high-school math reasoning). Evaluations were performed on state-of-the-art models such as Llama-3.1-8B-Instruct, Mistral-7B-Instruct-v0.3, and DeepSeek-R1-Distill-Llama-8B.

Key Results

vAttention demonstrates a superior Pareto frontier compared to existing sparse attention methods. Key findings include:

  • Extreme Sparsity: The method matches full-model quality while reading only 5-10% of the KV cache (10x-20x sparsity) across various datasets.
  • Bridging the Heuristic Gap: On the RULER-HARD benchmark, where standard top-$k$ methods typically struggle due to "flat" attention distributions, vAttention improved accuracy by approximately 4.5 percentage points for Llama-3.1-8B.
  • Reasoning Stability: In complex reasoning tasks (AIME2024), vAttention maintained full model quality at 10x sparsity even during long generations of up to 32K tokens.
  • System Efficiency: When the KV cache is offloaded to system DRAM, vAttention provides near-linear speedups by significantly reducing the data transfer volume over the PCIe bus.
Performance-Efficiency trade-off demonstrating that vAttention maintains higher average quality at greater levels of KV cache reduction compared to HashAttention and Oracle baselines.

Conclusion and Future Work

vAttention proves that statistical verification is a practical and effective tool for controlling model quality in sparse attention. While the current implementation demonstrates significant theoretical and empirical gains, future work involves developing custom CUDA kernels to further optimize index computation overhead on GPUs and addressing the prefill phase bottleneck for extremely long input prompts.

Summary updated

BibTeX
@misc{desai2025vattention,
  author = {Aditya Desai and Kumar Krishna Agrawal and Shuo Yang and Alejandro Cuadron and Luis Gaspar Schroeder and Matei Zaharia and Joseph E. Gonzalez and Ion Stoica},
  title = {{vAttention: Verified Sparse Attention}},
  year = {2025},
  eprint = {2510.05688},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.05688},
}
Figure