CARVE:结合任务感知重计算与KV缩放的高效缓存融合检索增强生成
CARVE: Efficient Cache-Fused RAG with Task-Aware Recomputation and KV-Scaling
AI总结:
本文针对RAG全提示预填充成本高、块间交互修复不足的问题,提出CARVE系统,通过实体链接规划器、位置感知KV缩放等技术,在多数据集多模型上较CacheBlend提升F1并大幅缩短TTFT。
摘要:
检索增强生成(RAG)通过将检索到的上下文融入提示词来提升大语言模型(LLM)的生成质量。然而,随着检索上下文的增长,处理完整RAG提示词的全提示词预填充成本日益高昂,导致首token生成时间(TTFT)增加。现有系统通过独立预填充检索块并在请求时拼接其缓存的KV状态来降低该成本,但会忽略块间交互。近期系统通过token级选择性重计算部分修复这些交互,即重计算部分token位置并复用其余缓存KV状态。但这种按位置选择可能遗漏与任务相关的块间交互,还会破坏连贯上下文,同时复用内容可能干扰生成。为解决这些局限,本文提出CARVE,一种以块对粒度执行任务感知块间修复的KV缓存复用系统。CARVE采用实体链接规划器,由离线实体-块图和在线查询条件规划器组成,用于识别并重计算与任务相关的修复对;同时利用位置感知KV缩放,缩放复用的VALUE向量以减少复用内容对生成的干扰。此外,块重排序与流水线执行进一步降低服务开销。在三个数据集和五个模型上,CARVE在相当的重计算比例下,较CacheBlend平均提升F1值4.1个百分点,且较全提示词预填充实现8.71至62.31倍的TTFT加速。
英文摘要:
Retrieval-augmented generation (RAG) improves LLM generation quality by incorporating retrieved context into prompts. However, full-prompt prefill, which processes the complete RAG prompt, becomes increasingly expensive as the retrieved context grows, increasing time-to-first-token (TTFT). Existing systems reduce this cost by prefilling retrieved chunks independently and stitching their cached KV states at request time, but this omits cross-chunk interactions. Recent systems partially repair these interactions through token-level selective recomputation, recomputing a subset of token positions while reusing the remaining cached KV states. However, such position-wise selection may miss task-relevant cross-chunk interactions. It can also fragment coherent context, while reused content can distract generation. To address these limitations, we present CARVE, a KV-cache reuse system that performs task-aware cross-chunk repair at chunk-pair granularity. CARVE uses Entity-Linked Planner, which consists of an offline entity--chunk graph and an online query-conditioned planner, to identify and recompute task-relevant repair pairs, while Position-Aware KV Scaling is leveraged to scale reused VALUE vectors to reduce the distracting influence of reused content on generation. Chunk reordering and pipelined execution further reduce serving overhead. Across three datasets and five models, CARVE improves F1 over CacheBlend by 4.1 points on average at a comparable recomputation ratio and achieves an 8.71--62.31$\times$ TTFT speedup over full-prompt prefill.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。