Manuscript Offprint

arXiv:2609.09768

Fine-Tuning a KV Cache Concatenation-Aware Model or Recomputing KV Caches? Why Not Both?

Fumihiko Tachibana, Daisuke Miyashita, Jun Deguchi

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

In Retrieval-Augmented Generation (RAG) systems, a large number of retrieved chunks are concatenated to form the input context so that users can receive high-quality responses based on external knowledge. As a result, the input context length increases substantially, leading to a larger prefill workload and, in turn, a longer time to first token (TTFT). While previous works that reuse precomputed key-value (KV) caches effectively reduce TTFT for long-context inputs, it remains unclear whether response quality is preserved when the input context becomes very long. In this paper, we propose a combined approach that (i) fine-tunes the model while taking KV cache concatenation into account and (ii) selectively recomputes a subset of the KV caches. By applying both techniques, we demonstrate improved accuracy for long-context inputs. Experiments on the RULER benchmark show that, for a 124k-token input, our method improves the RULER score by 9.7 point over the baseline that recomputes KV caches only. Moreover, TTFT is reduced by 80% compared with full attention.

1 Introduction

When a large language model (LLM) receives additional chunks retrieved by Retrieval-Augmented Generation (RAG) (Li et al., 2022; Gao et al., 2024), the total input context length increases substantially. Since prefill computation scales quadratically with input context length, computing the key-value (KV) caches incurs a large computational cost, which in turn increases the time to first token (TTFT).

One approach for reducing TTFT is to reuse precomputed KV caches for the context that is frequently reused. First, prefix caching stores and reuses KV caches when the context begins with the same initial token sequence (Zheng et al., 2024). Prefix caching does not degrade generation quality because the KV caches for the prefix context are independent of the subsequent text. However, this reuse is only valid when the input tokens exactly match those of the stored KV caches. This constraint limits the reusability of KV caches.

Second, KV cache concatenation aims to reuse KV caches even when the context corresponding to the precomputed KV caches is not a prefix, thereby increasing their reusability. However, because pre-computed KV caches are generated without preceding chunks, reused KV caches for non-prefix tokens do not include cross-attention from preceding chunks, which introduces deviations in the KV caches compared with those computed with full attention. When such a mismatch occurs, the attention outputs change, and generation quality degrades even if the positional embeddings of the KV caches are adjusted to match the current context positions (He et al., 2025).

To mitigate this problem, several methods have been proposed. CacheBlend (Yao et al., 2025) and EPIC (Hu et al., 2025) selectively recompute portions of the KV caches based on certain criteria. Other approaches, such as Block-attention (Ma et al., 2025), TurboRAG (Lu et al., 2025), and KVLink (Yang et al., 2025d), fine-tune the model under the assumption that there is no cross-attention between chunks, allowing multiple KV caches to be concatenated and reused. Although prior techniques improve generation quality on several benchmarks, their response accuracy under long input contexts remains underexplored. We show that accuracy consistently declines as context length increases, revealing that existing methods are inadequate for long-context settings. Since the benefit of KV cache reuse grows with context length, developing methods that preserve accuracy for long inputs is essential.

In this paper, we demonstrate that combining model fine-tuning with selective recomputation of a small fraction of the KV caches enables more robust handling of long-context inputs. We demon-

Figure

Figure 1: Comparison of four KV cache concatenation strategies: (1) normal, (2) fine-tuning model, (3) KV cache recomputation, and (4) the proposed combination. By combining fine-tuned model with selective KV cache recomputation, generation quality is better than using either technique alone. Accuracy values are taken from the results on the RULER HQA shown in Figure 10.

strate that using both methods suppresses the deviation in the key entries (i.e., the values of the key vectors) more effectively than using either method alone because the two approaches contribute differently to reduce these deviations. As a result, our approach achieves a 9.7 point improvement in the RULER score over the CacheBlend-only approach at a 124k-token input. Furthermore, TTFT is reduced by 80% at a 124k-token input when the KV caches are loaded from the SSD.

References (20)