paper-with-me

Papers

KVLink: Accelerating Large Language Models via Efficient KV Cache Reuse

2025-02-21 · Jingbo Yang, Bairu Hou, Wei Wei, Yujia Bao, Shiyu Chang

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 propose 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 of LLMs when using KV caches computed independently for each document, KVLink introduces three key components: adjusting positional embeddings of the KV cache at inference to match the global position after concatenation, using trainable special tokens to restore self-attention across independently encoded documents, and applying mixed-data fine-tuning to enhance performance while preserving the model's original capabilities. 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 90% compared to standard LLM inference, making it a scalable and efficient solution for context reuse.

📄 PDF Abstract BibTeX arXiv:2502.16002

Code (1)

UCSB-NLP-Chang/KVLink 공식 구현 pytorch

Tasks

Question Answering

Similar Papers 제목 키워드 기반

Prompt Cache: Modular Attention Reuse for Low-Latency Inference

2023-11-07 · In Gim, Guojun Chen, Seung-seob Lee, Nikhil Sarda 외

We present Prompt Cache, an approach for accelerating inference for large language models (LLM) by reusing attention states across different LLM prompts. Many input prompts have overlapping text segments, such as system …

CPUGPUQuestion Answering

RelayCaching: Accelerating LLM Collaboration via Decoding KV Cache Reuse

2026-02-28 · Yingsheng Geng, Yuchong Gao, Weihong Wu, Guyue Liu 외 arxiv

The increasing complexity of AI tasks has shifted the paradigm from monolithic models toward multi-agent large language model (LLM) systems. However, these collaborative architectures introduce a critical bottleneck: red…

Mathematical ReasoningGeneral KnowledgeCode Generation

d$^2$Cache: Accelerating Diffusion-Based LLMs via Dual Adaptive Caching

2025-09-27 · Yuchu Jiang, Yue Cai, Xiangzhong Luo, Jiale Fu 외 arxiv

Diffusion-based large language models (dLLMs), despite their promising performance, still suffer from inferior inference efficiency. This is because dLLMs rely on bidirectional attention and cannot directly benefit from …

From Prefix Cache to Fusion RAG Cache: Accelerating LLM Inference in Retrieval-Augmented Generation

2026-01-19 · Jiahao Wang, Weiyu Xie, Mingxing Zhang, Boxing Zhang 외 arxiv

Retrieval-Augmented Generation enhances Large Language Models by integrating external knowledge, which reduces hallucinations but increases prompt length. This increase leads to higher computational costs and longer Time…

Selective KV-Cache Sharing to Mitigate Timing Side-Channels in LLM Inference

2025-08-11 · Kexin Chu, Zecheng Lin, Dawei Xiang, Zixu Shen 외 arxiv

Global KV-cache sharing is an effective optimization for accelerating large language model (LLM) inference, yet it introduces an API-visible timing side channel that lets adversaries infer sensitive user inputs from shar…