arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2611.10418cs.AI
收藏

超越查询相似度:面向LLM响应复用的安全条件感知缓存路由

Beyond Query Similarity: Safety-Conditioned Cache Routing for LLM Response Reuse

Shilong Pan, Zhiliang Tian, Weiguo Chen, Zihan Chen, DongSheng Li

AI总结:

针对现有语义响应缓存仅依赖查询相似度易引发安全冲突的问题,提出安全感知框架SafeCache,通过分离候选检索与安全审批、聚合风险评分等实现更优的安全-效用权衡。

摘要:

语义响应缓存通过为语义相似的查询复用缓存响应,以提升大语言模型(LLM)推理效率。然而,仅依赖查询相似度可能在安全条件发生变化时导致不安全的复用。现有方法通过更严格的相似度检查、上下文感知验证或响应验证来提升缓存安全性,但仍可能遗漏缓存响应与新请求之间的安全冲突,或引入不必要的验证开销。本文提出SafeCache,这是一种安全感知框架,将候选检索与安全审批分离,将语义响应复用建模为安全条件感知的路由问题。SafeCache会匹配每个缓存响应的安全条件与新请求,并将各条件的不匹配情况聚合为整体风险评分;独立的矛盾防护机制可防止明确冲突被强匹配稀释;它还会估计匹配不确定性,并在指定的不安全复用目标和验证调用预算下校准路由策略,以在直接复用、选择性验证或重新生成之间做出选择。实验表明,在评估的基线方法中,SafeCache实现了更优的安全-效用权衡,在保持相当缓存效用的同时实现了更安全的响应复用。

英文摘要:

Semantic response caching reuses a cached response for a semantically similar query to improve LLM inference efficiency. However, query similarity alone can lead to unsafe reuse when safety conditions change. Existing approaches improve cache safety through stricter similarity checks, context-aware validation, or response verification, yet they may still miss safety conflicts between the cached response and the new request or introduce unnecessary verification overhead. We argue that safe and efficient semantic caching requires a reuse policy that makes the cached response's safety conditions explicit and uses them to guide the reuse decision with a balance between safety and utility. In this paper, we propose SafeCache, a safety-aware framework that separates candidate retrieval from safety approval and formulates semantic response reuse as a safety-conditioned routing problem. SafeCache matches each cached-response condition against the new request and aggregates the per-condition mismatches into an overall risk score. A separate contradiction guard prevents explicit conflicts from being diluted by strong matches. It further estimates matching uncertainty and calibrates the routing policy under a required unsafe-reuse target and a verifier-call budget to choose among direct reuse, selective verification, or regeneration. Experiments show that SafeCache achieves the better safety-utility trade-off among the evaluated baselines, enabling safer response reuse at comparable cache utility.

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

↑