arXiv:2604.20021cs.LGcs.CL2026-04

让大模型缓存更智能:自动识别语义相似请求,降低推理成本。

Continuous Semantic Caching for Low-Cost LLM Serving

论文配图:Continuous Semantic Caching for Low-Cost LLM Serving
图 1 · 摘自论文原文
  • 用动态ε-网+核岭回归,把连续语义空间转为可优化的缓存结构。
  • 实测缓存效率接近理想最优,计算和切换开销显著低于现有方法。
  • 适合高并发、长尾查询场景的低延迟大模型服务部署。

随着大语言模型广泛应用,通过缓存语义相似查询的响应来降低推理成本和延迟已成为关键策略。现有缓存框架假设查询空间是有限且离散的,但现实中的大模型查询分布在无限连续的嵌入空间中,该假设难以成立。本文首次建立在不确定环境下连续查询空间中语义缓存的严格理论框架。为连接离散优化与连续表示空间,提出动态ε-网离散化结合核岭回归的方法,能形式化量化估计不确定性,并将部分反馈推广至连续语义邻域。设计了离线学习与在线自适应算法,以最小化缓存响应变更带来的切换开销。证明所提在线算法对理想连续最优解具有次线性遗憾界,退化情形下还原为离散模型已有边界。大量实验证明,该框架在逼近连续最优缓存的同时,显著降低了计算与切换开销。

原文摘要 · Abstract (English)

As Large Language Models (LLMs) become increasingly popular, caching responses so that they can be reused by users with semantically similar queries has become a vital strategy for reducing inference costs and latency. Existing caching frameworks have proposed to decide which query responses to cache by assuming a finite, known universe of discrete queries and learning their serving costs and arrival probabilities. As LLMs' pool of users and queries expands, however, such an assumption becomes increasingly untenable: real-world LLM queries reside in an infinite, continuous embedding space. In this paper, we establish the first rigorous theoretical framework for semantic LLM response caching in continuous query space under uncertainty. To bridge the gap between discrete optimization and continuous representation spaces, we introduce dynamic $ε$-net discretization coupled with Kernel Ridge Regression. This design enables the system to formally quantify estimation uncertainty and generalize partial feedback on LLM query costs across continuous semantic query neighborhoods. We develop both offline learning and online adaptive algorithms optimized to reduce switching costs incurred by changing the cached responses. We prove that our online algorithm achieves a sublinear regret bound against an optimal continuous oracle, which reduces to existing bounds for discrete query models. Extensive empirical evaluations demonstrate that our framework approximates the continuous optimal cache well while also reducing computational and switching overhead compared to existing methods.

大模型服务缓存优化连续空间在线学习

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