To reduce LLM costs and latency, semantic caching systems must accurately identify when a new prompt matches a cached one. Current methods often rely on simplistic similarity measures, which limit their effectiveness. We introduce MVR-cache, a novel semantic caching approach that significantly improves retrieval accuracy by integrating Multi-Vector Retrieval (MVR). MVR-cache is built upon a learnable segmentation model that intelligently splits prompts, enabling fine-grained similarity comparisons via MaxSim. We derive the model's training objective from a rigorous theoretical analysis. This can ensure that optimizing this objective directly maximizes cache hits under strict correctness constraints. To solve the resulting non-differentiable combinatorial optimization problem, we leverage a reinforcement learning-based training strategy with the theoretically grounded objectives as the reward. Experimental results on established benchmarks across diverse tasks confirm that in comparison to the state-of-the-art, MVR-cache consistently increases the cache hit rates by up to 37% while maintaining the same correctness guarantees. MVR-cache is available at https://github.com/PKU-SDS-lab/MVR-Cache


翻译:为降低大语言模型的使用成本与延迟,语义缓存系统需准确识别新提示是否与缓存中的提示匹配。当前方法通常依赖简单的相似度度量,限制了其有效性。我们提出MVR-cache,一种通过集成多向量检索(MVR)显著提升检索准确率的新型语义缓存方法。MVR-cache基于可学习的分割模型构建,该模型能智能地划分提示,并通过MaxSim实现细粒度相似度比较。我们从严谨的理论分析出发推导模型训练目标,确保优化该目标可直接在严格正确性约束下最大化缓存命中率。为求解由此产生的不可微组合优化问题,我们采用基于强化学习的训练策略,将理论推导的目标函数作为奖励函数。在跨多种任务的权威基准测试中,实验结果表明:与现有最优方法相比,MVR-cache在保持相同正确性保证的前提下,缓存命中率最高可提升37%。MVR-cache开源代码见 https://github.com/PKU-SDS-lab/MVR-Cache

0
下载
关闭预览

相关内容

专知会员服务
11+阅读 · 2021年2月4日
【Google】多模态Transformer视频检索,Multi-modal Transformer
专知会员服务
103+阅读 · 2020年7月22日
基于图片内容的深度学习图片检索(一)
七月在线实验室
20+阅读 · 2017年10月1日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
4+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
6+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
3+阅读 · 6月17日
相关VIP内容
专知会员服务
11+阅读 · 2021年2月4日
【Google】多模态Transformer视频检索,Multi-modal Transformer
专知会员服务
103+阅读 · 2020年7月22日
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员