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.


翻译:检索增强生成(RAG)系统通过融入检索到的辅助文档来提升大语言模型(LLM)的性能,从而生成更准确且具有上下文感知能力的响应。然而,整合这些外部文档通常会导致极长的输入序列,这显著增加了预填充阶段的计算成本——该阶段需要为所有输入令牌生成键值(KV)表示。这种延迟瓶颈在高吞吐量服务场景中尤为突出。KV缓存复用提供了一种有前景的解决方案,通过存储共享输入前缀的先前计算出的KV状态,避免对包含重叠上下文的请求进行重复计算。然而,缓存复用的有效性常受到三个实际挑战的限制:由朴素驱逐策略导致的低缓存命中率、较高的CPU-GPU数据传输开销,以及缓存溢出到存储时缓慢的SSD I/O。为解决这些问题,我们提出了PCR系统,通过智能预取和流水线数据移动来最大化KV缓存复用的效率。具体而言,PCR引入了三项关键技术:(1)一种前缀树缓存结构,采用具有前瞻性LRU替换策略,利用调度队列中的待处理请求提高缓存命中率;(2)跨CUDA流的层级重叠技术,将KV缓存加载与GPU计算流水线化以隐藏通信延迟;(3)基于队列的预取机制,在需要之前主动将相关KV缓存从SSD加载至DRAM。大量实验表明,PCR优于现有的KV缓存复用方法,在平均TTFT上实现了高达2.47倍的加速。

0
下载
关闭预览

相关内容

主成分回归分析principle component regression;PCR,以主成分为自变量进行的回归分析。是分析多元共线性问题的一种方法。用主成分得到的回归关系不像用原自变量建立的回归关系那样容易解释。
检索增强生成(RAG)技术,261页slides
专知会员服务
42+阅读 · 2025年10月16日
检索增强生成(RAG)与推理的协同作用:一项系统综述
专知会员服务
34+阅读 · 2025年4月27日
智能体检索增强生成:关于智能体RAG的综述
专知会员服务
94+阅读 · 2025年1月21日
检索增强生成系统中的可信度:综述
专知会员服务
44+阅读 · 2024年9月18日
NLP-Progress记录NLP最新数据集、论文和代码: 助你紧跟NLP前沿
中国人工智能学会
12+阅读 · 2018年11月15日
NLG ≠ 机器写作 | 专家专栏
量子位
13+阅读 · 2018年9月10日
深度学习在CTR预估中的应用 | CTR深度模型大盘点
PaperWeekly
15+阅读 · 2018年4月11日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
13+阅读 · 2014年12月31日
VIP会员
最新内容
ICML 2026 | 自回归Boltzmann生成器重塑分子采样
专知会员服务
0+阅读 · 7分钟前
GNN跨域综述:从消息传递到图基础模型
专知会员服务
0+阅读 · 9分钟前
无人机自主控制与人工智能:系统性综述
专知会员服务
10+阅读 · 今天7:25
巡飞弹与反无人机系统——现代战场的两大支柱
专知会员服务
3+阅读 · 今天6:54
《打造“黄金舰队”》57页报告
专知会员服务
3+阅读 · 今天6:52
《北约数字教官网络发展路径》128页报告
专知会员服务
2+阅读 · 今天6:33
ECCV 2026 | MIMFlow:MIM与归一化流统一图像生成
专知会员服务
7+阅读 · 6月25日
网状网络及其在军事领域的运用
专知会员服务
8+阅读 · 6月25日
无美国参与的欧洲战争方式(万字长文)
专知会员服务
8+阅读 · 6月25日
《国防领域敏感性分析白皮书》
专知会员服务
9+阅读 · 6月25日
相关VIP内容
检索增强生成(RAG)技术,261页slides
专知会员服务
42+阅读 · 2025年10月16日
检索增强生成(RAG)与推理的协同作用:一项系统综述
专知会员服务
34+阅读 · 2025年4月27日
智能体检索增强生成:关于智能体RAG的综述
专知会员服务
94+阅读 · 2025年1月21日
检索增强生成系统中的可信度:综述
专知会员服务
44+阅读 · 2024年9月18日
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
13+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员