RefineKV compresses the KV cache per query, with up to 7.6x faster attention

An arXiv paper proposes RefineKV, a decoding-time, query-adaptive method for compressing the key-value (KV) cache in long-context language models.

The starting point is a bottleneck: repeatedly accessing the full KV cache is, in the authors' words, a major bottleneck in long-context decoding. They report a finding that motivates the design. Small query-specific subsets of the cache can accurately approximate full attention, but the union of those subsets across queries covers nearly the entire cache. So a fixed subset chosen in advance would lose information, and access has to adapt to each query.

The approach splits the KV cache into clusters. For clusters whose approximation error is negligible, the method uses compact representatives. The remaining clusters are expanded back to their original KV entries.

The choice of which clusters to compress comes from a selection criterion that the authors derive from an upper bound on attention-output error. The bound shows two complementary factors governing the error. Importance measures the impact of a cluster. Distortion measures how faithfully the cluster can be represented. RefineKV is built on this criterion.

The authors tested it in experiments on two models and three benchmarks. They report that RefineKV retains near-full-attention quality while achieving up to 7.6x speedup in the attention phase and 1.66x faster decoding. They say this establishes a new quality-latency Pareto frontier.

Key facts

  • RefineKV is a decoding-time, query-adaptive KV cache compression method for long-context language models.
  • It splits the cache into clusters, uses compact representatives where error is negligible, and expands the other clusters to their original KV entries.
  • The selection criterion comes from an upper bound on attention-output error, with two factors: importance (a cluster's impact) and distortion (how faithfully it can be represented).
  • The authors report up to 7.6x speedup in the attention phase and 1.66x faster decoding, with near-full-attention quality.
  • The results come from experiments on two models and three benchmarks; the authors claim a new quality-latency Pareto frontier.

Why it matters

Reading the full KV cache again and again is a major bottleneck when a model decodes over a long context. RefineKV goes after that cost. Its premise is that each query needs only a small subset of the cache, but different queries need different subsets, and together they cover almost everything. That is why the method adapts to the query instead of discarding cache entries once and for all.

Who it affects

The work targets long-context language model decoding, so it is most relevant to researchers and engineers who work on inference efficiency and KV cache handling.

How to use it

The source is an abstract and describes the method, not a usage recipe. The idea, in outline: cluster the KV cache, then for each query keep compact representatives for low-error clusters and expand the rest to their original entries, with the choice guided by importance and distortion.

How solid is it

The claims are the authors' own, from experiments on two models and three benchmarks. The 7.6x figure is stated as 'up to' and refers to the attention phase only. The 1.66x figure is for decoding and is given without that qualifier. The abstract does not name the models or benchmarks and gives no baselines. It gives no numeric quality results behind 'near-full-attention quality'.

Risks and caveats

The speedups should not be read as a general guarantee, since the 7.6x is a best case for the attention phase and the abstract does not say what it is measured against. The source does not state the context length or hardware. It also does not state the memory savings or compression ratio of the KV cache. The headline 'Pareto frontier' claim is the authors' own.