atlas

Research map / Architectures and efficiency / Attention and transformers

RetrievalAttention: Accelerating Long-Context LLM Inference via Vector Retrieval

NeurIPS 2025 · Architectures and efficiency › Attention and transformers · approach: KV cache eviction and compression · 3 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes RetrievalAttention, a training-free method that offloads most KV vectors to CPU-side ANNS indexes built with query-aware (attention-aware) edges to handle query-key out-of-distribution, enabling 128K-token decoding of 8B LLMs on a single RTX4090.

Problem

Long-context LLM decoding is slow and KV cache GPU memory grows linearly with context, while off-the-shelf ANNS indexes perform poorly for attention retrieval due to out-of-distribution query-key vectors.

Approach

Build the ANNS index over key vectors using query-to-key KNN connections from prefill (projected onto keys, RoarGraph-style), so decoding queries can traverse to critical keys while scanning only 1-3% of keys; combine CPU-retrieved partial attention with a static GPU-resident window via exact log-sum-exp rescaling.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
use RetrievalAttention instead of Flat exact KNN retrievalLlama-3-8B decoding at 128K context · Needle-in-a-haystackper-token generation latency (s): 0.922 -> 0.188Helped
use RetrievalAttention instead of IVF retrievalLlama-3-8B decoding at 128K context · Needle-in-a-haystackper-token generation latency (s): 0.373 -> 0.188Helped
use RetrievalAttention rather than full attentionLlama-3-8B · ∞-Benchaverage accuracy: 50.4 -> 48.9Hurt
use RetrievalAttention rather than full attentionLlama-3-8B · RULERaverage accuracy: 86.54 -> 84.70Hurt
use PyramidKV dynamic retrieval-budget allocation (ablation)RetrievalAttention on Llama-3-8B · ∞-Bench, 128K contextaverage accuracy: 49.9 -> 50.1Helped
use PyramidKV dynamic retrieval-budget allocation (ablation)RetrievalAttention on Llama-3-8B · ∞-Bench, 128K contextRetr.KV accuracy: 14.5 -> 16.0Helped
use PyramidKV dynamic retrieval-budget allocation (ablation)RetrievalAttention on Llama-3-8B · ∞-Bench, 128K contextEn.QA accuracy: 8.7 -> 8.5Hurt
select critical tokens dynamically for each query rather than reuse the first query's top-1000 tokens (ablation)Llama-3-8B attention · 100,000-token promptaverage recovery ratio: 71% -> 89%Helped

Surprising findings

Limitations

Experimental setup

Datasets: ∞-Bench RULER Needle-in-a-haystack

Benchmarks: ∞-Bench RULER Needle-in-a-haystack

Metrics: accuracy recall@100 per-token decoding latency scanned key fraction

Baselines: Full attention vLLM StreamingLLM SnapKV InfLLM Quest InfiniGen Flat IVF

Builds on: RoarGraph StreamingLLM FlashAttention Faiss

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy