arXiv:2605.27494cs.CRcs.AI2026-05被引 1

提出安全缓存路由机制,防止错误答案被重复使用。

Grounded Cache Routing for Retrieval-Augmented Generation: When Is It Safe to Reuse an Answer?

论文配图:Grounded Cache Routing for Retrieval-Augmented Generation: When Is It Safe to Reuse an Answer?
图 1 · 摘自论文原文
  • 用四个低成本判断条件验证证据,决定是否可复用缓存答案。
  • 在多个测试场景中将错误服务率降至0.0%至1.5%,显著降低风险。
  • 适合追求高可靠性、低错误率的生产级大模型应用部署。

现代检索增强生成(RAG)系统为降低令牌开销和首令牌延迟(TTFT),越来越多地依赖缓存。前缀级键值对复用已成为vLLM等服务栈的标准,而最近系统(如RAGCache、TurboRAG、CacheBlend、EPIC、ContextPilot、PCR、LMCache)进一步推进了块级与位置无关的复用。然而,输出级语义答案缓存仍易出错:相似提示可能对应不同正确答案,检索证据随语料更新而漂移,且已证实存在对抗性碰撞攻击可劫持缓存响应。我们主张,缓存复用的关键不在于提速,而在于何时安全复用。为此提出GroundedCache,一种基于证据验证的缓存路由机制,仅当四个廉价判断条件同时满足时才接受缓存答案:查询相似性、检索证据重叠度、源版本有效性,以及新检索证据对缓存答案的词法(或人工判别)支持。我们构建了一个包含六种运行场景的工作负载,用于压力测试缓存安全性而非仅命中率,并引入面向操作者的指标——非安全服务率(USR),即收到错误缓存答案的查询占比。在两个数据集上,共12,000次真实LLM生成(Qwen2.5-7B-Instruct,vLLM,自动前缀缓存)下,GroundedCache使HotpotQA各场景的USR降至0.0%(对比朴素缓存的15%-35%),mtRAG文档漂移场景下降至1.5%(对比51.5%),设计点对抗场景下降低34倍,其他mtRAG场景降低3-10倍;端到端p50延迟仅比无缓存基线高出1.04-1.07倍。逐门消融实验表明,词法支持门是双数据集上的核心安全机制,其余门提供近乎零成本的纵深防御。代码、工作负载与评估框架均已开源。

原文摘要 · Abstract (English)

Modern retrieval-augmented generation(RAG) deployments increasingly rely on caching to reduce token cost and time-to-first-token(TTFT). Prefix-level KV reuse is now standard in serving stacks such as vLLM, and chunk-level and position-independent reuse have been pushed further by recent systems(RAGCache, TurboRAG, CacheBlend, EPIC, ContextPilot, PCR, LMCache). Output-level semantic answer caches, by contrast, remain fragile: similar prompts can map to different correct answers, retrieved evidence drifts as the corpus is updated, and adversarial collision attacks have been shown to hijack cached responses. We argue that the right framing for cached answer reuse is not how to reuse faster but when reuse is safe. We propose GroundedCache, an evidence-validated cache router that admits a cached answer only when 4 cheap gates simultaneously hold: query similarity, retrieved-evidence overlap, source-version validity, and lexical (or judge-based) support of the cached answer by the freshly retrieved evidence. We build a six-regime workload that stress-tests cache safety rather than only hit rate, and introduce an operator-facing metric, the unsafe-served rate (USR), fraction of all queries that received a wrong cached answer. Across 2 datasets and 12,000 real-LLM generations(Qwen2.5-7B-Instruct on vLLM with Automatic Prefix Caching), GroundedCache drives USR to 0.0% on every HotpotQA regime(vs. 15-35% under naive caching) and to 1.5% on mtRAG document drift(vs. 51.5%), a 34x reduction on the design-point adversarial regime and 3-10x reductions across the other mtRAG regimes, while end-to-end p50 latency stays within 1.04-1.07x of a no-cache RAG baseline. A per-gate ablation isolates the lexical support gate as the load-bearing safety mechanism on both datasets, with the remaining gates providing defense-in-depth at near-zero cost. We release the implementation, workload, and evaluation harness.

RAG缓存安全大模型推理可靠性

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。