arXiv:2502.03771cs.LGcs.CL2025-02中稿 · ed被引 12

vCache让大模型缓存更可靠,可设定错误率上限

vCache: Verified Semantic Prompt Caching

  • 动态调整相似性阈值,避免固定阈值导致的误判
  • 实测误差率降低26倍,缓存命中率最高提升12.5倍
  • 适合对可靠性要求高的实际部署场景

语义缓存通过返回语义相似提示的缓存响应来降低大模型推理延迟和成本。系统将缓存提示嵌入向量数据库并存储其对应响应,利用嵌入相似度度量为请求与缓存中最近邻提示的相似性打分。现有系统对所有请求使用相同的静态相似性阈值判断是否共享响应,但该方法缺乏形式化正确性保证,导致意外错误率并影响缓存命中率。本文提出vCache,首个支持用户自定义错误率保证的验证型语义缓存。它采用在线学习算法为每个缓存提示估计最优阈值,实现可靠缓存响应且无需额外训练。实验表明,vCache始终满足指定错误边界,优于最先进的静态阈值和微调嵌入基线,缓存命中率最高达12.5倍,错误率降低26倍。我们开源了vCache实现及四个基准测试,以支持后续研究。

原文摘要 · Abstract (English)

Semantic caches return cached responses for semantically similar prompts to reduce LLM inference latency and cost. They embed cached prompts and store them alongside their response in a vector database. Embedding similarity metrics assign a numerical score to quantify the similarity between a request and its nearest neighbor prompt from the cache. Existing systems use the same static similarity threshold across all requests to determine whether two prompts can share similar responses. However, we observe that static thresholds do not give formal correctness guarantees, result in unexpected error rates, and lead to suboptimal cache hit rates. This paper proposes vCache, the first verified semantic cache with user-defined error rate guarantees for predictable performance. It employs an online learning algorithm to estimate an optimal threshold for each cached prompt, enabling reliable cache responses without additional training. Our experiments show that vCache consistently meets the specified error bounds while outperforming state-of-the-art static-threshold and fine-tuned embedding baselines with up to 12.5$\times$ higher cache hit and 26$\times$ lower error rates. We release the vCache implementation and four benchmarks to support future research.

大模型优化缓存机制可靠性

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