vCache: 验证的语义提示缓存
vCache: Verified Semantic Prompt Caching
AI总结:
vCache是一种具有用户定义误差率保证的验证语义缓存,通过在线学习算法动态优化阈值,实现更高的缓存命中率和更低的错误率。
摘要:
语义缓存通过返回语义相似的提示的缓存响应来减少大语言模型(LLM)推理延迟和成本。它们将缓存的提示进行嵌入,并将它们与其响应一起存储在向量数据库中。嵌入相似性度量为量化请求与其缓存中最近邻提示之间的相似性分配一个数值分数。现有系统在所有请求中使用相同的静态相似性阈值来确定两个提示是否可以共享相似的响应。然而,我们发现静态阈值无法提供正式的正确性保证,导致意外的错误率,并导致缓存命中率低下。本文提出了vCache,这是首个具有用户定义错误率保证的验证语义缓存,以实现可预测的性能。它采用在线学习算法来估计每个缓存提示的最佳阈值,从而在不额外训练的情况下实现可靠的缓存响应。我们的实验表明,vCache能够持续满足指定的误差界限,同时在缓存命中率上比最先进的静态阈值和微调嵌入基线高出多达12.5倍,错误率低26倍。我们发布了vCache的实现和四个基准测试以支持未来的研究。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。