RefreshKV: Updating Small KV Cache During Long-form Generation

Generating long sequences of tokens given a long-context input is a very compute-intensive inference scenario for large language models (LLMs).One prominent inference speed-up approach is to construct a smaller key-value (KV) cache, relieving LLMs from computing attention over a long sequence of tokens.While such methods work well to generate short sequences, their performance degrades rapidly for longform generation.Most KV compression happens once, prematurely removing tokens that can be useful later in the generation.We propose a new inference method, RefreshKV, that flexibly alternates between full context attention and attention over a subset of input tokens during generation.After each full attention step, we update the smaller KV cache based on the attention pattern over the entire input.Applying our method to off-the-shelf LLMs achieves comparable speedup to eviction-based methods while improving performance for various long-form generation tasks.Lastly, we show that continued pretraining with our inference setting brings further gains in performance.

Authors

Publication Details

Published
2025-01-01
DOI
https://doi.org/10.18653/v1/2025.acl-long.1211
Primary Topic
Caching and Content Delivery
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

RefreshKV: Updating Small KV Cache During Long-form Generation

Eunsol Choi, Fangyuan Xu, Tanya Goyal
Caching and Content Delivery
article

RefreshKV: Updating Small KV Cache During Long-form Generation

Eunsol Choi, Fangyuan Xu, Tanya Goyal
article en

Abstract

Generating long sequences of tokens given a long-context input is a very compute-intensive inference scenario for large language models (LLMs).One prominent inference speed-up approach is to construct a smaller key-value (KV) cache, relieving LLMs from computing attention over a long sequence of tokens.While such methods work well to generate short sequences, their performance degrades rapidly for longform generation.Most KV compression happens once, prematurely removing tokens that can be useful later in the generation.We propose a new inference method, RefreshKV, that flexibly alternates between full context attention and attention over a subset of input tokens during generation.After each full attention step, we update the smaller KV cache based on the attention pattern over the entire input.Applying our method to off-the-shelf LLMs achieves comparable speedup to eviction-based methods while improving performance for various long-form generation tasks.Lastly, we show that continued pretraining with our inference setting brings further gains in performance.

National Science Foundation, Simons Institute for the Theory of Computing, University of California Berkeley
Affordable and clean energy
Openalex Percentile: Top 79%
Caching and Content Delivery
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

RefreshKV: Updating Small KV Cache During Long-form Generation — Eunsol Choi, Fangyuan Xu, et al. · (2025) | TGRS Research Map | TGRS