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

KVLink: Accelerating Large Language Models via Efficient KV Cache Reuse

About

We describe KVLink, an approach for efficient key-value (KV) cache reuse in large language models (LLMs). In many LLM applications, different inputs can share overlapping context, such as the same retrieved document appearing in multiple queries. However, the LLMs still need to encode the entire context for each query, leading to redundant computation. In this paper, we investigate a new strategy to eliminate such inefficiency, where the KV cache of each document is precomputed independently. During inference, the KV caches of retrieved documents are concatenated, allowing the model to reuse cached representations instead of recomputing them. To mitigate the performance degradation when using KV caches computed independently for each document, KVLink introduces two key techniques: adjusting positional embeddings of the KV cache at inference to match the global position after concatenation, and using trainable special tokens to restore self-attention across independently encoded documents. Experiments across 7 datasets demonstrate that KVLink improves question answering accuracy by an average of 4% over state-of-the-art methods. Furthermore, by leveraging precomputed KV caches, our approach reduces time-to-first-token by up to 96% compared to standard LLM inference, making it a scalable and efficient solution for context reuse. Additionally, KVLink can be combined with KV cache compression to further save cache loading and storage overhead while outperforming the baselines.

Jingbo Yang, Bairu Hou, Wei Wei, Yujia Bao, Shiyu Chang• 2025

Related benchmarks

TaskDatasetResultRank
Code GenerationMBPP+
Accuracy78.31
243
Mathematical ReasoningAIME 2024
AIME 2024 Accuracy50
60
Question AnsweringRAG Benchmarks
HotpotQA Score41.15
17
Graduate-level Science QAGPQA
Accuracy35.35
13
Agent ReasoningGAIA Level 2
Number Correct20
7
Agent ReasoningGAIA Level-1
Correct Samples20
7
Code GenerationHumanEvalPlus
HumanEval+ Accuracy87.8
7
Retrieval-Augmented GenerationRAG benchmarks (HotpotQA, TriviaQA, 2WikiMQA, MuSiQue, NQ)
HotpotQA Score41.55
7
Scientific QAMedQA
Accuracy67.05
7
Agent ReasoningGAIA Level 3
Correct Samples1
7
Showing 10 of 11 rows

Other info

Follow for update