Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Retrospective Sparse Attention for Efficient Long-Context Generation

About

Large Language Models (LLMs) are increasingly deployed in long-context tasks such as reasoning, code generation, and multi-turn dialogue. However, inference over extended contexts is bottlenecked by the Key-Value (KV) cache, whose memory footprint grows linearly with sequence length and dominates latency at each decoding step. While recent KV cache compression methods identify and load important few tokens, they focus predominantly on input contexts and fail to address the cumulative attention errors that arise during long decoding. In this paper, we introduce RetroAttention, a novel KV cache update technique that retrospectively revises past attention outputs using newly arrived KV entries from subsequent decoding steps. By maintaining a lightweight output cache, RetroAttention enables past queries to be efficiently supplemented with more contexts, while incurring minimal latency overhead. This breaks the fixed-attention-output paradigm and allows continual correction of prior approximations. Extensive experiments on long-generation benchmarks show that RetroAttention consistently outperforms state-of-the-art (SOTA) KV compression methods, increasing effective KV exposure by up to 1.6$\times$ and accuracy by up to 21.9\%.

Seonghwan Choi, Beomseok Kang, Dongwon Jo, Jae-Joon Kim• 2025

Related benchmarks

TaskDatasetResultRank
Long-context language modelingLongBench
Average Score46.99
328
Expert-Level ReasoningGPQA Diamond
Pass@1 Score33.6
14
Mathematical ReasoningGSM8K LONGGENBENCH
Accuracy (n=15)89.8
11
Language UnderstandingMMLU LONGGENBENCH
Accuracy (n=15)80.9
11
Commonsense ReasoningCSQA LongGenBench (test)
Accuracy (n=15)85.3
6
Code ReasoningLiveCodeBench v5
Pass@134.1
5
Long-context Question AnsweringLONGGENBENCH n=30
CSQA72.2
5
Commonsense Question AnsweringCSQA LONGGENBENCH
Accuracy (n=15)68.8
5
Showing 8 of 8 rows

Other info

Follow for update