arXiv:2508.07675cs.LG2025-08中稿 · INFOCOM 2026被引 14

用语义缓存降低大模型推理成本,自动学习适应未知访问模式。

Semantic Caching for Low-Cost LLM Serving: From Offline Learning to Online Adaptation

  • 基于语义相似度动态管理缓存,避免重复计算
  • 在未知查询频率和成本下仍保持高效,理论性能最优
  • 适合高并发场景的低成本大模型服务系统

大型语言模型(LLMs)正重塑信息交互方式,但其高昂的推理成本带来可扩展性与可持续性挑战。通过缓存推理结果避免重复前向计算成为潜在解决方案。传统精确匹配缓存忽略查询间的语义相似性,导致冗余计算。语义缓存通过语义相似度检索响应,但引入了全新的缓存淘汰问题:需权衡新查询与缓存响应之间的不匹配成本。此外,查询到达概率、服务成本等关键系统参数常未知,需随时间学习。现有语义缓存方法多为经验性,缺乏理论基础且难以适应现实不确定性。本文提出一种基于学习的语义缓存淘汰原则性框架,涵盖离线优化与在线学习两种变体,设计出具有理论保证的高效算法。在合成数据集上的评估表明,所提算法性能优于或媲美基线。

原文摘要 · Abstract (English)

Large Language Models (LLMs) are revolutionizing how users interact with information systems, yet their high inference cost poses serious scalability and sustainability challenges. Caching inference responses, allowing them to be retrieved without another forward pass through the LLM, has emerged as one possible solution. Traditional exact-match caching, however, overlooks the semantic similarity between queries, leading to unnecessary recomputation. Semantic caching addresses this by retrieving responses based on semantic similarity, but introduces a fundamentally different cache eviction problem: one must account for mismatch costs between incoming queries and cached responses. Moreover, key system parameters, such as query arrival probabilities and serving costs, are often unknown and must be learned over time. Existing semantic caching methods are largely ad-hoc, lacking theoretical foundations and unable to adapt to real-world uncertainty. In this paper, we present a principled, learning-based framework for semantic cache eviction under unknown query and cost distributions. We formulate both offline optimization and online learning variants of the problem, and develop provably efficient algorithms with state-of-the-art guarantees. We also evaluate our framework on a synthetic dataset, showing that our proposed algorithms perform matching or superior performance compared with baselines.

大模型服务语义缓存在线学习

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