Continuous Semantic Caching for Low-Cost LLM Serving

Baran Atalar, Xutong Liu, Jinhang Zuo, Siwei Wang, Wei Chen +1 more
4/21/2026
cs.LGcs.CL

No confident code implementation found for this paper.

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{atalar2026continuous,
  title  = {Continuous Semantic Caching for Low-Cost LLM Serving},
  author = {Baran Atalar and Xutong Liu and Jinhang Zuo and Siwei Wang and Wei Chen and Carlee Joe-Wong},
  year   = {2026},
  eprint = {2604.20021},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.20021v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2604.20021.svg)](https://codeofpaper.com/paper/2604.20021)

Discussion