arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2603.23049cs.DC
收藏

PCR:一种增强预取的缓存重用系统,用于低延迟RAG服务

PCR: A Prefetch-Enhanced Cache Reuse System for Low-Latency RAG Serving

Shanghai Jiao Tong University(上海交通大学);East China Normal University(华东师范大学)

Wenfeng Wang, Xiaofeng Hou, Peng Tang, Hengyi Zhou, Jing Wang, Xinkai Wang, Chao Li, Minyi Guo

AI总结:

PCR通过智能预取和流水线数据传输技术,提升RAG服务中KV缓存重用效率,降低TTFT延迟。

摘要:

Retrieval-Augmented Generation (RAG)系统通过整合补充检索文档提升大语言模型(LLM)性能,但整合外部文档常导致输入序列过长,显著增加预填充阶段的计算成本。此瓶颈在高吞吐服务场景中尤为明显。KV缓存重用通过存储共享输入前缀的先前计算KV状态,避免冗余计算。然而,缓存重用效果常受限于三个实际挑战:由于朴素驱逐策略导致的低缓存命中率、高CPU-GPU数据传输开销以及缓存溢出到SSD时的慢速I/O。为解决这些问题,我们提出了PCR系统,通过智能预取和流水线数据传输最大化KV缓存重用效率。具体而言,PCR引入三种关键技术:(1)具有前瞻LRU替换策略的前缀树缓存结构,利用调度器队列中的待请求来提高缓存命中率;(2)分层重叠,通过CUDA流流水线KV缓存加载和GPU计算以隐藏通信延迟;(3)基于队列的预取,主动从SSD加载相关KV缓存到DRAM中,以在需要前加载。大量实验表明,PCR在现有KV缓存重用方法上表现更优,平均TTFT提速达2.47倍。

英文摘要:

Retrieval-Augmented Generation (RAG) systems enhance the performance of large language models (LLMs) by incorporating supplementary retrieved documents, enabling more accurate and context-aware responses. However, integrating these external documents often results in very long input sequences, which significantly increases computation costs during the prefill stage, where key-value (KV) representations for all input tokens are generated. This latency bottleneck becomes especially pronounced under high-throughput serving scenarios. KV-cache reuse offers a promising solution by storing previously computed KV states for shared input prefixes, thereby avoiding redundant computation across requests that contain overlapping context. Yet, the effectiveness of cache reuse is often limited by three practical challenges: low cache hit rates due to naive eviction policies, high CPU-GPU data transfer overhead, and slow SSD I/O when caches spill to storage. To address these issues, we propose PCR, a system designed to maximize KV-cache reuse efficiency through intelligent prefetching and pipelined data movement. Specifically, PCR introduces three key techniques: (1) a prefix-tree caching structure with a look-ahead LRU replacement policy that uses pending requests in the scheduler queue to improve cache hit ratios; (2) layer-wise overlapping that pipelines KV-cache loading and GPU computation across CUDA streams to hide communication latency; and (3) queue-based prefetching that proactively loads relevant KV caches from SSD into DRAM before they are needed. Extensive experiments show that PCR outperforms existing KV-cache reuse methods, achieving up to a 2.47x speedup in terms of average TTFT.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑