Manuscript Offprint
arXiv:2611.01077Multi-Turn Semantic Caching for Low-Cost LLM Serving
ABSTRACT
Semantic caching lowers the cost of serving large language models (LLMs) by reusing stored responses for similar requests. In multi-turn conversations, whether a cached response is acceptable depends on both conversations' histories, which embedding similarity of requests and histories predicts poorly (AUC 0.62–0.74 on five workloads). We therefore learn the reuse risk, the probability that a cached response is unacceptable, from judge feedback, and choose a budgeted set of conversation states to cache by weighing the generation cost a reuse avoids against a price for unacceptable reuse. We propose CUCB-SC-MT, which learns a cache from logged conversations with a suboptimality guarantee, and CLCB-LS-MT, which learns online and has regret over requests when conversation states recur. On math-tutoring (SocraTeach) and movie-ticketing (Taskmaster-3) conversations, both achieve lower loss than prior semantic caching approaches: ContextCache, multi-turn variants of ElastiCache and vCache, and single-turn semantic caching at every cache budget. With 1,000 cache entries, CLCB-LS-MT avoids 35–41% of the generation cost through acceptable reuses, against at most 22–25% for the baselines, and lowers estimated serving latency by 19–35%.
1 INTRODUCTION
Serving large language models (LLMs) is expensive, and much of the work repeats: about 31% of ChatGPT users' queries are similar to earlier ones (Gill et al., 2025). Semantic caching answers a new request with the stored response of a similar earlier one and skips token generation entirely (Bang, 2023; Gaspar Schroeder et al., 2026), thus lowering serving cost and latency. Recent work gives such caches cost guarantees, both offline and online (Liu et al., 2026; Atalar et al., 2026). Cloud providers also offer semantic caching as a service (Amazon Web Services, 2026).
These guarantees treat each request as a standalone query, but LLM traffic is conversational: 73% of ShareGPT conversations have several turns (Gao et al., 2024). The same follow-up, such as “Yes, that’s right” in a ticket booking, calls for different replies under different histories, so whether a cached response is acceptable depends on a pair of conversation states, the current one and the one whose response is cached, and the probability that it is not, the reuse risk, is unknown. Yet multi-turn semantic caches still threshold an embedding similarity, computed on the recent messages or on the request followed by a context check (Gill et al., 2025; Yan et al., 2025; Yu et al., 2026), and single-turn analyses take the cost of a mismatch to be a known function

Figure 1. AUC for acceptable reuse of embedding distance and of a learned reuse risk when each follow-up turn is served by its nearest state (request and history) in another conversation and an LLM judge rates the reuse. Right: AUC gain of the learned risk (95% CI). The risk model is fixed on WildChat (Appendix D.1).
of embedding distance (Atalar et al., 2026).
Figure 1 shows that distance is a poor proxy in conversations. We took five workloads: open-domain chat (WildChat (Zhao et al., 2024)), movie-ticket booking (Taskmaster-3 (Byrne et al., 2021)), math tutoring (SocraTeach (Liu et al., 2024)), document-grounded assistance (MultiDoc2Dial (Feng et al., 2021)) and customer service (ABCD (Chen et al., 2021)). We matched every follow-up turn to its nearest state (request and history) in another conversation and asked an LLM
¹Carnegie Mellon University, Pittsburgh, PA, USA ²University of Washington Tacoma, Tacoma, WA, USA. Correspondence to: Baran Atalar batalar@andrew.cmu.edu.
Preprint. Under review.
judge whether the cached response would be acceptable. Distance ranks acceptable reuse poorly (AUC 0.62–0.74). A reuse-risk model learned from judge labels with kernel regression on features that compare the two requests, their histories, the cached response and the turn positions, ranks it better on every workload (AUC +0.06 to +0.20), with one configuration fixed on open-domain WildChat. At 80% judge precision it serves 2.2× as many Taskmaster-3 follow-ups as a distance threshold (38.9% vs. 17.3%).
Learning this risk while serving is hard: it lives on pairs of states whose histories grow with every turn and is revealed only by judge labels on reuses, while generation costs are revealed only by LLM calls; turns of a conversation are correlated; and choosing what to cache is NP-hard. Our contributions are:
-
Model (Sections 2–3): multi-turn semantic caching over conversation states with a learned reuse risk and a price for unacceptable reuse. Given the costs and risks, Reverse Greedy chooses the cache and keeps its approximation guarantee for learned, masked and asymmetric reuse losses.
-
Offline learning (Section 4): The learning algorithm CUCB-SC-MT, whose suboptimality bound holds for arbitrarily dependent turns and adds a reuse-risk term evaluated only along the comparator's decisions.
-
Online learning (Section 5): Our proposed algorithm CLCB-LS-MT, which freezes its policy within each conversation, labels a random fraction of reuses and rarely recomputes its cache. Its regret is over requests when conversation states recur, although its net is built from correlated turns.
-
Evaluation (Section 6): on math tutoring (SocraTeach) and movie-ticket booking (Taskmaster-3), our algorithms have the lowest loss at every cache budget, offline and online, against ElastiCache, ContextCache, vCache, a joint-state threshold and single-turn caching.
Related work. GPTCache (Bang, 2023) serves the nearest cached response above a similarity threshold. For conversations, MeanCache (Gill et al., 2025) also compares each entry's context chain, ContextCache (Yan et al., 2025) refines the match with self-attention over the dialogue history, and SmartCache (Yu et al., 2026) detects context shifts from the LLM's attention scores; vCache (Gaspar Schroeder et al., 2026) learns a threshold per entry to meet an error-rate target. None weighs a reuse against the generation cost it saves. Learning formulations (Liu et al., 2026; Atalar et al., 2026), similarity caching (Garetto et al., 2020) and online caching with regret guarantees (Paschos et al., 2019) take the mismatch cost as given while we learn the reuse risk itself. KV and prefix caching (Kwon et al., 2023; Gao et al., 2024; Gim

Figure 2. Multi-turn semantic caching system.
et al., 2024; Zheng et al., 2024) reuses computation within a request and complements response reuse, and cascades and routers (Chen et al., 2023; Ong et al., 2025) choose which model answers. Unlike generic combinatorial bandits (Chen et al., 2013), CUCB-SC-MT and CLCB-LS-MT choose a cache whose loss couples a learned cost with a learned risk on pairs of states, and learn from correlated turns that reveal the risk only on sampled reuses.
2.1 Multi-Turn LLM Serving System
Conversations and states. Conversation has turns. At turn the user submits a request , a natural-language message such as a question or an instruction, and receives a response , which is either generated by the LLM or served from the cache. When invoked, the LLM receives together with the conversation history , with . The same request calls for different responses under different histories (contexts), so we cache over conversation states rather than requests. A cache item stores the fixed-size representation of its state, defined next, and its response, so its size does not grow with the history, and the cache capacity counts items, as in single-turn caches.
State representation. The state encoder represents the conversation state of each turn by , which we also call a state. The exact-match key holds the discrete facts that decide whether a response is admissible at all: the entities the request refers to after resolving the history, and explicit output constraints, e.g., . Every state has exactly one key, which is empty when the request names no entity or constraint, and is the finite set of keys that occur with positive probability. The embedding concatenates unit-norm sentence embeddings of the request and the history with a fixed weight : . We write and with strata , and measure distance only within a stratum: if and otherwise. Replacing “Paris” by “Lyon” barely changes the embedding but can make a cached response wrong, so keeping such facts in lets the cost and reuse risk vary smoothly with inside each stratum, so nearby states with the same key can share estimates.
Conversation Arrivals. Conversations are i.i.d. draws of a random sequence of states whose distribution is unknown. Turns within a conversation may be arbitrarily dependent. We evaluate the system under the per-request law
which, by the strong law of large numbers, is the long-run fraction of requests falling in . For , it is the query distribution of Atalar et al. (2026). With and the law of given , we assume intrinsic dimension : there are such that for all , and .
We assume that serving a request from the cache does not change how the conversation continues. Single-turn queries
satisfy this by construction, as they are drawn independently from (Atalar et al., 2026); in conversations the response at turn enters , but the assumption is accurate when reused responses are acceptable substitutes for fresh ones, so that users continue as they would have, and unacceptable reuses are rare: online, they affect 8.2% and 13.1% of the requests served by CLCB-LS-MT (Table 1). It also matches how semantic caches are evaluated, by replaying logged queries or conversations (Gill et al., 2025; Yan et al., 2025; Gaspar Schroeder et al., 2026). Relaxing it turns caching into a reinforcement-learning problem, which we leave to future work.
Assumption 1 (Exogenous conversation states). The law of the conversation process does not depend on how earlier turns were served, i.e., on whether, and with which cached responses, previous requests were answered.
Serving costs and partial observations. Invoking the LLM at has expected cost . The input cost of processing and grows with the conversation and is known before the call while the generation cost is unknown. Invoking the LLM at turn reveals ; otherwise no cost is observed. The noise is conditionally -sub-Gaussian given the -field of all states, decisions and feedback at earlier turns (ordered by conversation) together with .
Cache items, compatibility and reuse risk. The cache holds at most items : a source state at which the LLM was invoked and the response generated there. We write for the state being served and for the state whose response is reused. Whether may be returned at cannot be read off the embedding distance alone. A known compatibility mask excludes reuse that is never admissible, e.g., , and the unknown reuse risk , the probability that is unacceptable at for an LLM judge or the user, is learned from pair features . The reuse loss is
where the known price converts risk into units of normalized cost. As with in Atalar et al. (2026), the cap never changes since . We write , with , and . Reusing at may reveal a label with conditional mean , e.g., a judge's verdict on a sampled reuse. The reverse feedback of (Atalar et al., 2026) thus applies to both unknowns: costs are observed only on LLM calls, and risk labels only on reused or judged pairs.
2.2 Multi-Turn Semantic Caching
At each turn the system either returns and incurs , or invokes the LLM on and incurs and observes its cost. The optimal rule is
A cache therefore incurs the per-state loss and the expected loss
which, by (1) and Assumption 1, is the long-run average cost per request of a fixed cache. The cache design problem is
where is the set of cacheable source states.
Discretization via a stratified -net. A stratified -net contains, for every , a representative with . Since across strata, each stratum has its own representatives . The Voronoi cells partition without crossing strata and have weights . With and , the discretized loss of is
Unlike in Atalar et al. (2026), is not a function of distance: it is learned, equals 1 wherever , and need not be symmetric. Caches are chosen among the representatives, whose states and responses they store, and a request in cell is routed by the costs and risks estimated at .
3 ORACLE CACHING WITH KNOWN PARAMETERS
We first assume that , and are known. Problem (5) is NP-hard, as it contains the single-turn problem of Atalar et al. (2026) (Lemma A.1). We therefore minimize the discretized loss (6) with Reverse Greedy (Liu et al., 2026) (Algorithm 3 in Appendix A), which starts from all representatives and repeatedly removes the one whose removal increases the loss the least. Its guarantee uses no metric property of the reuse costs, so it holds for learned, masked and asymmetric reuse losses.
Lemma 3.1 (Approximation guarantee (Liu et al., 2026)). For any , and , the discretized loss is non-increasing and supermodular on , and Reverse Greedy returns with for every , where , , and is the curvature of the instance (Il'ev, 2001).
Relating the discretized loss to the true loss needs regularity, but only within a key.
Assumption 2 (Regularity within keys). There are constants such that for all states with the same key and all source states with the same key,
The first two conditions are Assumption 1 of Atalar et al. (2026) within a key; across keys jumps to 1. The third is new: the cache stores responses generated at representatives, not at the items of , and without it could rely on a response that no representative reproduces. It holds automatically when the risk depends on the source only through its distance to the target, as in the single-turn model. Under Assumption 2, is -Lipschitz with , so the discretized loss is within of the true loss (Lemma A.2).
Theorem 3.2 (Approximation guarantee). Let be returned by Reverse Greedy on and let solve (5). Under Assumption 2,
The last term is the price of replacing each item of by its nearest representative with the same key. In the single-turn model the bound becomes the of Theorem 3.3 in Atalar et al. (2026).
Lemma 3.3 (Size of a stratified net). If the representatives lie in supp , representatives with the same key are more than apart, and , then .
This replaces the of the single-turn analysis by the intrinsic dimension , at the price of a factor , which favors coarse keys that contain only facts that change the answer. Proofs for this section are in Appendix A.
4 OFFLINE LEARNING WITH UNKNOWN PARAMETERS
None of , and is known when a cache is deployed: they depend on the application's traffic, on the length of responses not yet generated, and on what its users accept. We therefore learn them from logged conversations. For every turn the logs record the state , the cache in use and the realized cost if the LLM was invoked. They are complemented by labeled pairs from
Algorithm 1 CUCB-SC-MT: Offline Multi-Turn Semantic Caching
Require: conversations split into ; cost observations ; labeled pairs ; , kernels , ridge , , , mask ,
1: Build on : add a state as a representative if it is farther than from all representatives with the same key
2: for all
3: Fit KRR with on , giving ; set
4: Fit KRR with on the compatible labeled pairs , giving
5: for do
6: if , else
7: end for
8: Reverse Greedy()
9: Serve from if , else invoke the LLM
an LLM judge run on logged reuses or on pairs of logged states. As in Atalar et al. (2026), we compete with the -approximate oracle and evaluate the serving rule actually deployed, whose expected loss is :
Algorithm 1 extends CUCB-SC-Cont of Atalar et al. (2026), which learns one function, the cost, from independent queries and takes the mismatch cost as known. Here the data differ in three ways, and each changes the algorithm. (i) Turns of a conversation are dependent, so it splits conversations, not turns, into , which builds the net, and ( conversations, turns), which estimates the weights. (ii) The reuse risk is a second unknown function, defined on pairs of states and observed only through judge labels; it is learned by KRR on pair features , and a pessimistic reuse-loss matrix is formed for compatible pairs only (, e.g., the same key; the others have ). (iii) Later states contain earlier responses, so regression inputs depend on earlier noise, and the confidence widths must be self-normalized (Chowdhury & Gopalan, 2017) (Appendix B). Below, refers to the pessimistic instance .
Assumption 3 (Logged conversations). Conversations in are independent of each other and of , and for every . Turns within a conversation, and the logging decisions, may be arbitrarily dependent.
Assumption 4 (Kernel regularity). (a) depends on through and lies in the RKHS of a kernel with
norm at most . (b) , where lies in the RKHS of a kernel on with norm at most , and . (c) The labeled pairs can be ordered so that each pair is fixed before its label is drawn and .
Part (b) allows misspecification of size , with the realizable case. Let and be the maximum information gains of and after and observations (Chowdhury & Gopalan, 2017), and set
With probability at least , the estimated weights satisfy , where , and and upper-bound and with gaps at most and (Lemma B.1, Appendix B). The weights count conversations, not turns: when all conversations have the same length, which cannot be improved under arbitrary within-conversation dependence.
To state the main result, let the comparator replace each item of by its nearest representative with the same key. For every , let attain (ties go to the LLM), and define , , and for . These are the cells where the comparator invokes the LLM and where it reuses, and the item it reuses.
Theorem 4.1 (Suboptimality of CUCB-SC-MT). Suppose Assumptions 1–4 hold and the net built on covers supp . With probability at least ,
The four terms are discretization, arrival, cost and reuse risk. The first three have the form of Theorem 4.1 in Atalar et al. (2026), but each needs a new step: the arrival term concentrates over conversations rather than turns (Lemma B.2), the cost widths must hold although regression inputs contain earlier responses, and the discretization term pays because cached responses move with their source states. The reuse-risk term is new. Both learning terms are evaluated only along the comparator's decisions: costs where invokes the LLM and risks on the pairs it reuses. The logs therefore need to cover what a good cache does, not every state and pair, which is the usual benefit of pessimism (Jin et al., 2021).
Corollary 4.2 (Rate). Use RBF kernels with length scales on and on , and suppose the logs cover the comparator's decisions: the LLM is invoked with propensity at least near its LLM cells, and the labeled pairs near its reused pairs have density constant and intrinsic dimension (Appendix B.4). For and , with probability at least ,
where is the comparator's reuse mass and . Appendix B.4 gives the explicit bound.
The new term converges more slowly because it lives in pair space, with for concatenated target and source features. It is weighted by the comparator's reuse mass and depends on label coverage only through , so labels should target plausible pairs, such as nearest compatible candidates, rather than all pairs. The term is the price of misspecification and vanishes in the realizable case. With and a known risk, Theorem 4.1 recovers Theorem 4.1 of Atalar et al. (2026) with a smaller arrival constant and an optimal radius set by rather than (Appendix B.5).
5 ONLINE LEARNING WITH UNKNOWN PARAMETERS
Online, the system starts without data and must build the net, learn costs and risks, and choose caches while serving. This is the usual case in deployment: a new application, or one that switches LLMs, has no judged logs to learn from. Conversations make this harder in two ways. Turns of a conversation are correlated, so a request is not a fresh draw from given the past, and the per-request concentration arguments of the single-turn analysis fail. Risk labels arrive only for a sample of the reuses that the algorithm itself chose, so it must reuse uncertain pairs to learn their risk.
5.1 Online Learning Setup
Stream and regret. Conversations arrive one after another as the independent copies of Section 2, and each is served to completion before the next one starts. We index requests globally by rounds , write for the state at round , and let be the -field of the first conversations and of all feedback they generated. Let , the expected length of the conversation that a random request belongs to. At round the system either invokes the LLM, with loss , or reuses a cached item ,
with loss .
with and from (5). As in Atalar et al. (2026), the second sum charges for every inserted item, whose response must be generated (in Algorithm 2, when the representative is created). (8) compares with the best cache over all cacheable states and, in the single-turn case, upper-bounds the regret of Atalar et al. (2026).
Assumption 5 (Online feedback). (a) On each reuse round, a label is observed with probability , independently of the past given the served pair, and . (b) For every source state , is -Lipschitz within a key.
Part (a) models an LLM judge run on a random sample of reuses, and part (b) holds with when concatenates the embeddings.
5.2 Algorithm Design of CLCB-LS-MT
Algorithm 2 extends CLCB-SC-LS-Cont of Atalar et al. (2026), keeping its optimism and low switching, with four changes. (i) Per-conversation snapshots. Each conversation is served with a frozen snapshot , and all updates happen at conversation boundaries. A request is correlated with the earlier turns of its conversation, but a whole conversation visits every region times in expectation by (1), so freezing the policy within a conversation lets the analysis average its loss against . (ii) Routing at the representative. A covered request takes the option that the lower confidence bounds choose for its cell representative; an uncovered request goes to the LLM and may become a representative. Optimism keeps uncertain cells receiving LLM calls and uncertain pairs being reused and labeled. (iii) Learned risk with sampled labels. The risk is learned by KRR from the sampled labels, with , and as in Section 4, the information gains taken after observations and the number of labels at the snapshot. (iv) Low switching. The cache changes only at a conversation boundary where a representative was added, an arrival stage ended, or of the cost or label data grew by at least since the last switch. Unlike the per-representative counters of Atalar et al. (2026), this information trigger accounts for how one KRR observation shrinks the widths of all nearby representatives and pairs (Appendix C).

(a) Taskmaster-3 offline

(b) Taskmaster-3 online

(c) SocraTeach offline

(d) SocraTeach online
Cache budget k
Figure 3. Loss at as a percentage of the no-cache loss (lower is better) by cache budget , offline on the test conversations (a, c) and online over the whole stream (b, d). Blue bars are CUCB-SC-MT offline and CLCB-LS-MT online. Error bars are 95% bootstrap CIs over conversations (2,000 resamples); the dashed line is no caching; bars above 110% are clipped and labeled.
5.3 Theoretical Results
Theorem 5.1 (Regret of CLCB-LS-MT). Suppose Assumptions 1, 2, and 5 hold, and , and let bound the net size (Lemma 3.3). Let be the quantization of the served requests, and let be the largest distance from an item of to the net at round , set to 0 where it exceeds . Then
where , , and ,
Table 1. Online reuse quality at (%). Prec.: share of hits the judge accepts; False: unacceptable reuses as a share of all requests; SCA: safe cost avoided (Section 6.3). Appendix D.4 gives every budget and no budget.
| Method | Taskmaster-3 | SocraTeach | ||||
|---|---|---|---|---|---|---|
| Prec. | False | SCA | Prec. | False | SCA | |
| CLCB-LS-MT | 74.6 | 8.2 | 35.0 | 67.5 | 13.1 | 41.0 |
| ContextCache | 62.0 | 9.5 | 17.9 | 76.9 | 6.9 | 25.1 |
| ElastiCache-MT | 82.5 | 3.6 | 22.3 | 95.6 | 0.3 | 0.8 |
| vCache | 81.1 | 2.8 | 14.7 | 78.4 | 0.1 | 0.7 |
| Joint-state thr. | 70.7 | 1.0 | 2.3 | 83.5 | 2.0 | 6.0 |
| Single-turn | 29.1 | 2.0 | 1.1 | 84.7 | 0.5 | 2.0 |
, vanishes when , and the remainder (Appendix C.5) grows with only logarithmically for fixed .

(a) Taskmaster-3 online, k = 200

(b) Taskmaster-3 online, k = 1000

(c) SocraTeach online, k = 200

(d) SocraTeach online, k = 1000
Figure 4. Running online loss at : the cumulative loss divided by the cumulative no-cache cost after each request, for budgets (a, c) and (b, d). Dotted curves show CLCB-LS-MT and the strongest unbounded baseline (ElastiCache-MT on Taskmaster-3, ContextCache on SocraTeach) without a budget. The dashed line is no caching.
The cost and risk terms are the elliptical-potential terms of kernelized bandits, and the arrival term has the rate of the single-turn analysis, inflated by the conversation length and by the arrival stages; and count the information triggers. The discretization term covers the quantization of the served requests, the transfer of widths from representatives to requests, and the projection of onto the net. For deployment, a smaller lowers the discretization term but enlarges the net (), and labeling a fraction of reuses saves judge calls at a factor in the risk term.
Unlike the single-turn proof (Appendix C), the error of the estimated cell weights must concentrate over conversations, as the net is built from correlated turns (Lemma C.2), and the confidence widths frozen within a conversation must stay within a factor of current ones, which the information triggers ensure except on rounds (Lemmas C.3–C.4).
Corollary 5.2 (Regret rates). Under the conditions of Theo-
rem 5.1: (a) No structural assumption. With tuned to (Appendix C.6), . (b) Separated support. If, for every key , is supported on finitely many points that are pairwise more than apart, and denotes their number, then , , , and .
In the realizable case , part (b) gives regret when conversation states, including their histories, recur, and the same rate holds whenever . For general support, part (a) tunes to and gives the per-request rate of Corollary 4.2. In the single-turn case, part (b) matches the horizon dependence of Theorem 5.1 in Atalar et al. (2026) (Appendix C, which also contains the proofs).
Algorithm 2 CLCB-LS-MT: Online Multi-Turn Semantic Caching with Low Switching
Require: horizon , radius , kernels , ridge , mask , label rate
1: ; cost data and label data
2: for conversations do
3: for each round of conversation do
4: If is covered: its cell,
5: if is uncovered (no representative with key within ) or then
6: Invoke the LLM; add to
7: else
8: Return ; with probability observe and add to
9: end if
10: end for
11: Add the states of conversation to greedily, as in Algorithm 1
12: if a representative was added, an arrival stage ends, or of or grew by since the last switch then
13: fraction of all past rounds in , with the uncovered rounds as an extra cell
14:
15: if , else
16: Reverse Greedy()
17: end if
18: end for
6 EXPERIMENTS
Workloads. Multi-turn caching needs responses that are reusable across conversations, which is rare in open domain chat: in WildChat 1M (Zhao et al., 2024), every tested cache could safely serve only 1–2% of follow-up turns from another conversation (Appendix D.1). We therefore use two structured workloads in which history matters. For identical messages with different histories, a response from another conversation is acceptable only 22% of the time on Socrateach and 45% on Taskmaster-3.
Socrateach. Socrateach (Liu et al., 2024) pairs a GPT-4 tutor with a GPT-4-simulated student on GSM8K and MAWPS problems. We sample five dialogues for each of 440 problems (2,200 dialogues, 10,821 requests), as for a class working through a shared assignment. Shared openings carry only 2% of the cost; savings must come from follow-ups such as “12 cookies”, whose reply depends on the problem and step.
Table 2. Online estimated latency relative to (858 ms on Taskmaster-3, 1,100 ms on Socrateach; lower is better), including background work. Appendix D.3 gives every budget, the hit rates and the offline estimates.
| Method | Taskmaster-3 | Socrateach | ||
|---|---|---|---|---|
| Nobudget | Nobudget | |||
| CLCB-LS-MT | 0.80–0.85 | 0.81 | 0.65–0.70 | 0.59 |
| ContextCache | 0.76–0.87 | 0.75 | 0.72–0.94 | 0.53 |
| ElastiCache-MT | 0.83–0.94 | 0.77 | 0.95–1.00 | 0.10 |
| vCache | 0.90–1.04 | 0.92 | 1.01 | 0.65 |
| Joint-state thr. | 1.05–1.08 | 0.99 | 0.91–1.02 | 0.41 |
| Single-turn | 1.01–1.05 | 1.03 | 0.99–1.02 | 0.89 |
Taskmaster-3. Taskmaster-3 (Byrne et al., 2021) contains crowd-written movie-ticketing dialogues that follow a common booking flow. Follow-ups such as “Yes, that’s right” recur across conversations, but the correct reply depends on the movie, theater and time chosen earlier. We sample 2,200 dialogues with at least two user turns (21,892 requests); responses are the logged, human-written agent turns.
Costs, acceptability and loss. The cost of request with history counts the input and output tokens of its LLM call (GPT-4o-mini tokenizer), normalized to by the 1st and 99th percentiles of the calibration set. States are embedded with Granite (Awasthy et al., 2025) as . GPT-4o-mini (temperature 0) judges whether a cached response is acceptable for a request and its history (Zheng et al., 2023). All methods share the judge and its labels (on Socrateach it accepts 98% of exact-context duplicates and 2.7% of random pairs). A miss costs and a hit costs , where if the judge rejects the reuse. We report the total loss at as a percentage of the no-cache loss.
Baselines. ElastiCache-MT (Amazon Web Services, 2026) thresholds the cosine similarity of an embedding of the recent messages; ContextCache (Yan et al., 2025) retrieves by the current message and then matches the recent user messages; vCache (Gaspar Schroeder et al., 2026) learns per-entry thresholds from correctness feedback to keep its error rate below . A joint-state threshold on our isolates the state representation from CUCB-SC-MT’s cache design and risk bounds, and single-turn CUCB-SC-Cont (Atalar et al., 2026) uses the current message alone (Appendix D.2).
Offline protocol. Each workload is split by conversation into 1,800 calibration, 200 validation and 200 test conversations. All hyperparameters (net radii, similarity thresholds, vCache’s , risk multipliers) minimize the validation loss at with caches built from calibration data, on which
Algorithm 1 also fits its risk model from judge-labeled pairs. The selected configurations are rebuilt on calibration and validation data (19,932 source states on Taskmaster-3, 9,822 on SocraTeach) and tested on 1,960 and 999 requests at and without a budget, where the baselines cache every source state and CUCB-SC-MT and single-turn every -net center. Validation also selects the risk multiplier that replaces in : the analyzed , except on SocraTeach at and without a budget (; would change the test loss by +0.7, +4.9 and -1.9 pp).
Online protocol. All 2,200 conversations arrive in one random order, turns in order, and every method sees the same stream, starting from an empty cache with no labels. Methods observe the cost of each LLM call and the judge label of each reuse and keep their offline-selected hyperparameters (CLCB-LS-MT uses ). CLCB-LS-MT also reuses from a session buffer of the current conversation's responses, which Theorem 5.1 does not cover (Appendix D.4 compares the methods without it). Losses include the cold start and CIs bootstrap conversations with the decisions fixed and so omit arrival-order variation.
6.1 Loss across cache budgets
Figure 3 reports each method's loss at its validation-selected setting. Differences are in percentage points (pp) of the no-cache loss.
Offline. CUCB-SC-MT has the lowest loss at every budget. On Taskmaster-3 it is 16.9 to 7.4 pp below the strongest baseline, ElastiCache-MT, from (77.1%) to (72.6%); with 100 entries it already matches unbounded ElastiCache-MT (77.3%), which caches all 19,932 source states. On SocraTeach, the budgeted baselines stay near no caching (96.2–101.0%), while CUCB-SC-MT falls from 94.3% to 69.1%. Without a budget it is 6.2 pp (CI 2.5–9.8) and 11.9 pp (CI 2.7–20.9) below the best unbounded baseline, but within 2 pp of its own loss at . Single-turn, which ignores history, stays at 96–101%.
Online. CLCB-LS-MT has the lowest loss at every budget on both workloads. On Taskmaster-3 its loss barely depends on (73.0–75.0%; 74.1% without a budget), while ElastiCache-MT needs a large cache (99.0% at , 81.9% unbounded): the gap is 24.0 to 11.4 pp at matched budgets and 7.8 pp (CI 6.5–9.1) without a budget. On SocraTeach only ContextCache is competitive; CLCB-LS-MT is 2.4 pp (CI 0.5–4.1) below it at , 9.2 pp (CI 7.1–11.2) at and 7.5 pp (CI 5.4–9.6) without a budget. There, unbounded ElastiCache-MT, the joint-state threshold and vCache are worse than no caching.
6.2 Learning over the stream
Figure 4 plots the running loss . Fixed-threshold baselines flatten once their caches fill, while CLCB-LS-MT keeps learning from feedback: on Taskmaster-3 it falls from 80.3% in the first quarter of the stream to 72.0% () and 71.7% () in the last, while the budgeted baselines' quarterly losses move by at most 2.6 pp. On SocraTeach, it briefly exceeds 100% while its risk model has few labels, falls below ContextCache within 2,500–4,000 requests, and improves by 7.5–15.8 pp from the first to the last quarter (ContextCache: at most 4.1 pp; Appendix D.5). As Theorem 5.1 predicts, the loss per request falls as the confidence widths shrink, and the early excess on SocraTeach is the price of optimism, which reuses uncertain pairs to learn their risk.
6.3 Reuse quality and generation cost saved
Table 1 separates the avoided cost from the penalties via the safe cost avoided (SCA), . At , CLCB-LS-MT safely avoids 35.0% (Taskmaster-3) and 41.0% (SocraTeach) of the no-cache cost, against at most 22.3% and 25.1% for the baselines. Since CLCB-LS-MT weighs cost against risk as in (3), it reuses on requests that cost about 1.5 times the average, against 1.1–1.3 times for the strongest baselines. Its precision is lower and its false reuse higher (8.2% and 13.1% of requests), each charged as much as the most expensive request, yet its loss is lowest.
6.4 Latency
We estimate the mean latency of method at budget as : embedding time (GPU) and decision time (CPU), averaged over 300 requests, plus the LLM time (mean of 40 sequential GPT-4o-mini calls) on misses, where is the hit rate. Online, amortizes the updates made after each response; judge calls for learning are off the request path and excluded (Appendix D.3).
Online (Table 2), CLCB-LS-MT lowers the estimated latency by 15–20% on Taskmaster-3 and 30–35% on SocraTeach at (19% and 41% without a budget), including 23–28 ms of background work per request. Its hit path takes 39–83 ms, under a tenth of an LLM call. The hit rate dominates: vCache, the joint-state threshold and single-turn rarely reuse and stay at 0.90–1.08, while aggressive reuse can be fast but costly (unbounded ElastiCache-MT on SocraTeach: 0.10, at a loss of 154.7%). Offline, CUCB-SC-MT reaches 0.81–0.84 on Taskmaster-3 and 0.61–0.99 on SocraTeach. These estimates ignore queueing and count every reuse as a fast hit, so they should be read with the loss.
7 CONCLUSION
In multi-turn conversations, whether a cached response can be reused depends on a pair of conversation states, which embedding similarity predicts poorly. We learn this reuse risk from judge feedback and weigh it against the generation cost a reuse saves. CUCB-SC-MT and CLCB-LS-MT have suboptimality and regret guarantees despite correlated turns, and online with 1,000 entries CLCB-LS-MT avoids 35–41% of the generation cost through acceptable reuses, against at most 22–25% for the baselines. Natural next steps are to let reuses change how conversations continue (Assumption 1) and to extend the guarantees to reuse within a conversation. The appendix contains all proofs (Appendices A–C) and further results (Appendix D): the motivation study, per-budget latency and reuse quality, the full loss tables, the online loss over the stream and a sweep over the price .
REFERENCES
Abbasi-Yadkori, Y., Pál, D., and Szepesvári, C. Improved algorithms for linear stochastic bandits. In Advances in Neural Information Processing Systems, volume 24, 2011.
Amazon Web Services. Amazon elasticsearch documentation. https://docs.aws.amazon.com/elasticsearch/, 2026.
Atalar, B., Liu, X., Zuo, J., Wang, S., Chen, W., and Joe-Wong, C. Continuous semantic caching for low-cost llm serving, 2026. URL https://arxiv.org/abs/2604.20021.
Awasthy, P., Trivedi, A., Li, Y., Bornea, M., Cox, D., Daniels, A., Franz, M., Goodhart, G., Iyer, B., Kumar, V., Lastras, L., McCarley, S., Murthy, R., P. V., Rosenthal, S., Roukos, S., Sen, J., Sharma, S., Sil, A., Soule, K., Sultan, A., and Florian, R. Granite embedding models, 2025. URL https://arxiv.org/abs/2502.20204.
Bang, F. GPTCache: An open-source semantic cache for LLM applications enabling faster answers and cost savings. In Proceedings of the 3rd Workshop for Natural Language Processing Open Source Software (NLP-OSS 2023), pp. 212–218. Association for Computational Linguistics, 2023. doi: 10.18653/v1/2023.nlposs-1.24.
Byrne, B., Krishnamoorthi, K., Ganesh, S., and Kale, M. Tickettalk: Toward human-level performance with end-to-end, transaction-based dialog systems. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 671–680, 2021.
Chen, D., Chen, H., Yang, Y., Lin, A., and Yu, Z. Action-based conversations dataset: A corpus for building more in-depth task-oriented dialogue systems. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 3002–3017, 2021.
Chen, L., Zaharia, M., and Zou, J. Frugalgpt: How to use large language models while reducing cost and improving performance. arXiv preprint arXiv:2305.05176, 2023.
Chen, W., Wang, Y., and Yuan, Y. Combinatorial multi-armed bandit: General framework and applications. In International conference on machine learning, pp. 151–159. PMLR, 2013.
Chowdhury, S. R. and Gopalan, A. On kernelized multi-armed bandits, 2017. URL https://arxiv.org/abs/1704.00445.
Feng, S., Patel, S. S., Wan, H., and Joshi, S. Multidoc2dial: Modeling dialogues grounded in multiple documents. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 6162–6176, 2021.
Gao, B., He, Z., Sharma, P., Kang, Q., Jevdjjc, D., Deng, J., Yang, X., Yu, Z., and Zuo, P. Cost-efficient large language model serving for multi-turn conversations with cache-dattention. In 2024 USENIX annual technical conference (USENIX ATC 24), pp. 111–126, 2024.
Garetto, M., Leonardi, E., and Neglia, G. Similarity caching: Theory and algorithms. In IEEE INFOCOM 2020-IEEE Conference on Computer Communications, pp. 526–535. IEEE, 2020.
Gaspar Schroeder, L., Desai, A., Cuadron Lafuente, A., Chu, K., Liu, S., Zhao, M., Krusche, S., Kemper, A., Zaharia, M., and Gonzalez, J. E. vcache: Verified semantic prompt caching. In International Conference on Learning Representations, volume 2026, pp. 92634–92661, 2026.
Gill, W., Elidrisi, M., Kalapatapu, P., Ahmed, A., Anwar, A., and Gulzar, M. A. MeanCache: User-centric semantic caching for LLM web services. In Proceedings of the 39th IEEE International Parallel and Distributed Processing Symposium (IPDPS), pp. 1298–1310, 2025. doi: 10.1109/IPDPS64566.2025.00117.
Gim, I., Chen, G., Lee, S.-s., Sarda, N., Khandelwal, A., and Zhong, L. Prompt cache: Modular attention reuse for low-latency inference. Proceedings of Machine Learning and Systems, 6:325–338, 2024.
Il'ev, V. P. An approximation guarantee of the greedy descent algorithm for minimizing a supermodular set function. Discrete Applied Mathematics, 114(1-3):131–146, 2001.
Jin, Y., Yang, Z., and Wang, Z. Is pessimism provably efficient for offline rl? In International conference on machine learning, pp. 5084–5096. PMLR, 2021.
Kwon, W., Li, Z., Zhuang, S., Sheng, Y., Zheng, L., Yu, C. H., Gonzalez, J., Zhang, H., and Stoica, I. Efficient memory management for large language model serving with pagedattention. In Proceedings of the 29th symposium on operating systems principles, pp. 611–626, 2023.
Liu, J., Huang, Z., Xiao, T., Sha, J., Wu, J., Liu, Q., Wang, S., and Chen, E. Socraticlm: exploring socratic personalized teaching with large language models. In Proceedings of the 38th International Conference on Neural Information Processing Systems, NIPS '24, Red Hook, NY, USA, 2024. Curran Associates Inc. ISBN 9798331314385.
Liu, X., Atalar, B., Dai, X., Zuo, J., Wang, S., Lui, J. C., Chen, W., and Joe-Wong, C. Semantic caching for low-cost llm serving: From offline learning to online adaptation. In IEEE INFOCOM 2026 - IEEE Conference on Computer Communications, pp. 1–10, 2026. doi: 10.1109/INFOCOM59046.2026.11571467.
Ong, I., Almahairi, A., Wu, V., Chiang, W.-L., Wu, T., Gonzalez, J. E., Kadous, M., and Stoica, I. Routellm: Learning to route llms from preference data. In International Conference on Learning Representations, volume 2025, pp. 34433–34448, 2025.
Paschos, G. S., Destounis, A., Vigneri, L., and Iosifidis, G. Learning to cache with no regrets. In IEEE INFOCOM 2019-IEEE Conference on Computer Communications, pp. 235–243. IEEE, 2019.
Srinivas, N., Krause, A., Kakade, S. M., and Seeger, M. Gaussian process optimization in the bandit setting: No regret and experimental design. In Proceedings of the 27th International Conference on Machine Learning (ICML), pp. 1015–1022, 2010.
Yan, J., Ni, W., Chen, L., Lin, X., Cheng, P., Qin, Z., and Ren, K. Contextcache: Context-aware semantic cache for multi-turn queries in large language models. Proc. VLDB Endow., 18(12):5391–5394, August 2025. ISSN 2150-8097. doi: 10.14778/3750601.3750679. URL https://doi.org/10.14778/3750601.3750679.
Yu, C., Wang, T., Shao, Z., and Jiang, S. Smartcache: Context-aware semantic cache for efficient multi-turn llm inference. Advances in Neural Information Processing Systems, 38:172487–172508, 2026.
Zhao, W., Ren, X., Hessel, J., Cardie, C., Choi, Y., and Deng, Y. Wildchat: 1m chatgpt interaction logs in the wild, 2024. URL https://arxiv.org/abs/2405.01470.
Zheng, L., Chiang, W.-L., Sheng, Y., Zhuang, S., Wu, Z., Zhuang, Y., Lin, Z., Li, Z., Li, D., Xing, E., et al. Judging llm-as-a-judge with mt-bench and chatbot arena. Advances in neural information processing systems, 36: 46595–46623, 2023.
Zheng, L., Yin, L., Xie, Z., Sun, C., Huang, J., Yu, C. H., Cao, S., Kozyrakis, C., Stoica, I., Gonzalez, J. E., et al. Sglang: Efficient execution of structured language model programs. Advances in neural information processing systems, 37:62557–62583, 2024.
A PROOFS FOR SECTION 3
Table 3 collects the notation used in the proofs. For we write , so that .
Setting , , , , and for the known mismatch function of Atalar et al. (2026) gives , makes the nearest cached query, and reduces (3)–(6) to Eqs. (1)–(4) of Atalar et al. (2026).
Lemma A.1 (NP-hardness). The multi-turn semantic caching problem (5) is NP-hard.
Proof. Problem (5) contains the single-turn problem of (Atalar et al., 2026) as the special case described above, which is NP-hard by Lemma 3.1 there.
Algorithm 3 Reverse Greedy (Liu et al., 2026)
Require: representatives with , weights , costs , reuse losses , cache size
1:
2: while do
3:
4:
5: end while
Ensure: cache
Lemma 3.1 applies Lemma 2 and Theorem 1 of (Liu et al., 2026) with reuse costs ; their proofs treat the reuse cost of each pair as an arbitrary non-negative number. The continuous loss and its discretization are related as follows.
Lemma A.2 (Continuous-to-discrete approximation). Let be a stratified -net and suppose Assumption 2 holds. For every cache and key , is -Lipschitz with , and
For , the sum equals .
The third condition of Assumption 2 holds automatically in the single-turn model, where is Lipschitz in . In that model and , so Theorem 3.2 gives . The single-turn analysis uses , which grows with the embedding dimension; Lemma 3.3 replaces by because each key is covered separately.
A.1 Proof of Lemma A.2
The main difference relative to Lemma 3.2 of (Atalar et al., 2026) is that is Lipschitz only within a key. Fix a key and a cache . The map is -Lipschitz by Assumption 2. For , the mask does not depend on : if it is 0, then ; if it is 1, then is -Lipschitz, since is -Lipschitz. A minimum of finitely many -Lipschitz functions is -Lipschitz, so is -Lipschitz.
The approximation bound then follows from the proof of Lemma 3.2 of (Atalar et al., 2026), applied within each key: since the net covers supp and across keys, every has the key of and . Finally, for , .
A.2 Proof of Theorem 3.2
The only new step relative to Theorem 3.3 of (Atalar et al., 2026) is the projection of the optimum, where the mismatch function is replaced by the masked reuse risk. Every has a representative with the same key and ; let , so . For every state , because the keys of and coincide. If both masks are 0, both reuse losses are 1; otherwise the third condition of Assumption 2 gives . Taking the minimum over yields pointwise, hence
The remainder is the chain in the proof of Theorem 3.3 of (Atalar et al., 2026), with Lemma A.2 in place of Lemma 3.2 there and (9) in place of its projection step: .
A.3 Proof of Lemma 3.3
Fix a key and let be the embeddings of the representatives with key . They are pairwise more than apart, so the balls of radius around them are disjoint. Each lies in supp and , so by the lower-mass condition of Section 2 each ball has conditional mass at least . The masses of disjoint sets sum to at most 1, so . Representatives lie in supp , so their keys belong to , and summing over gives the claim. The representatives built by Algorithm 1 satisfy the separation condition by construction.
B PROOFS FOR SECTION 4
We write , and , for the true values at the representatives. We use Lemma A.2 of (Atalar et al., 2026) (regularized posterior width via local counts) and the variational characterization in its proof: the regularized variance at equals , at-
Table 3. Notation.
| Symbol | Meaning |
|---|---|
| System model | |
| conversation, turn, conversation length | |
| request, history, returned response | |
| conversation state: exact-match key, embedding | |
| stratum of key ; distance within a stratum, across strata | |
| per-request law (1), law of given | |
| intrinsic dimension, lower-mass constant, radius up to which the lower-mass bound holds | |
| expected serving cost: known input part, unknown generation part | |
| observed cost, its noise, sub-Gaussian parameter | |
| cache item: source state and the response stored with it | |
| cache, cache size | |
| known compatibility mask | |
| reuse risk, pair features, risk label | |
| risk price, reuse loss (2) | |
| smallest reuse loss over the cache, item attaining it | |
| per-state loss, expected loss (4) | |
| cacheable source states, optimal cache (5) | |
| stratified -net, representatives, cells, weights, size, radius | |
| costs and reuse losses at the representatives, discretized loss (6) | |
| Oracle | |
| Reverse Greedy approximation factor, curvature | |
| Lipschitz constants of , of in the target and in the source | |
| , Lipschitz constant of within a key | |
| Symbol | Meaning |
|---|---|
| Offline learning | |
| conversations that build the net and that estimate the weights | |
| conversations and turns in , effective sample size | |
| numbers of cost observations and labeled pairs | |
| kernels on and on , RBF length scales, ridge | |
| RKHS norm bounds, risk misspecification | |
| KRR estimates and widths for generation cost and reuse risk | |
| maximum information gains of | |
| confidence multipliers, misspecification width | |
| pessimistic (upper) cost and reuse-loss estimates | |
| loss of the deployed rule, suboptimality (7) | |
| projected onto the net, cells where it invokes the LLM or reuses, item it reuses | |
| LLM propensity, label-density constant, intrinsic dimension of (coverage) | |
| comparator's reuse mass, largest misspecification width on its pairs | |
| Online learning | |
| round, horizon, state at round | |
| -field of the first conversations | |
| loss served at round , regret (8) | |
| label rate, Lipschitz constant of in | |
| optimistic (lower) estimates, snapshot used in conversation | |
| largest net size; of the data before round | |
| logarithmic factor and burn-in thresholds (Lemma C.2, Theorem 5.1) | |
| arrival stages, cost and label information triggers, all switches | |
| quantization of served requests, projection distance of | |
| discretization constant, misspecification term, lower-order remainder | |
| coverage burn-in, mass of the -ball around | |
tained at . Both hold for an RBF kernel on any feature map, which we apply to for the cost and to for the risk.
Design choices of Algorithm 1. Splitting turns rather than conversations between and would leave dependent
samples on both sides. The input cost , which grows with the history, enters exactly (Line 3). The confidence widths are self-normalized with a fixed ridge because later states contain earlier responses, so regression inputs depend on earlier noise and fixed-design bounds do not apply.
Lemma B.1 (Concentration of estimates). Let be built on and cover supp , and let . Under Assumptions 3–4, each of the following events holds with probability at least :
where holds for all , for all , and for incompatible pairs.
counts conversations, not turns: by Cauchy–Schwarz, , with equality iff all conversations have the same length. This cannot be improved under arbitrary within-conversation dependence, and for it recovers the arrival event of (Atalar et al., 2026). and hold uniformly over the space, so they can be evaluated at the data-dependent representatives.
B.1 A Conversation-Level Chernoff Bound
Local counts in the single-turn analysis rely on a binomial Chernoff bound for independent samples. Turns within a conversation are dependent and logging may be adaptive, so we use the following martingale version over conversations.
Lemma B.2 (Conversation-level Chernoff bound). Let be a filtration and with -measurable. If almost surely, then
Proof. Let and . By convexity, on , so , and satisfies . Take . On , and , so . Markov's inequality and give the claim.
With this reduces to the Chernoff step behind the local-count event of (Atalar et al., 2026).
B.2 Proof of Lemma B.1
Arrival event. Condition on , so the cells are fixed, and follow the proof of the arrival event in Lemma 4.2 of (Atalar et al., 2026): with and , iff for some . The only change is that turns are not independent. Write with . By Assumption 3, conditionally on the lengths, the are independent with mean , so Hoeffding's inequality gives . A union bound over the subsets and give .
Remark B.3 (Random lengths). If length-invariance is dropped and conversations are i.i.d. with random lengths, as in Section 2, then by (1), and the summands are independent with ranges . The same argument gives with replaced by .
Cost event. As in the proof of Lemma 5.2 of (Atalar et al., 2026), this is Theorem 2 of (Chowdhury & Gopalan, 2017), applied to with the cost observations ordered conversation by conversation and turn by turn. Its hypotheses hold because the decision to invoke the LLM is made before the cost is revealed, so each input is predictable, and by the noise model of Section 2 each is conditionally -sub-Gaussian given the past, even though later states contain earlier responses. The bound is uniform over the space, so it holds at the data-dependent representatives. Since is exact and , and .
Risk event. Let be a compatible pair and , so . Write with , a martingale difference by Assumption 4(c) that is conditionally -sub-Gaussian because . Then . The first bracket is at most by Theorem 2 of (Chowdhury & Gopalan, 2017), uniformly over . For the second, , and the variational characterization at its minimizer gives ; with this yields . Since is monotone and -Lipschitz, at , and incompatible pairs have .
B.3 Proof of Theorem 4.1
The deployed rule serves from if and invokes the LLM otherwise. Work on , which has probability at least ; on , all entries of and lie in .
(i) , because oracle routing is pointwise optimal among rules that use .
(ii) . Let , so has the key of and . If the rule invokes the LLM, its loss is ; if it reuses , the mask is the same at and , so . In both cases the pessimistic value of the chosen option is . Integrate over the cells.
(iii) By Lemma 4 of (Liu et al., 2026), , where the constant instead of 1 follows from and .
(iv) By Lemma 3.1 on the instance , with feasible, .
(v) By (iii) again, and because is at most the pessimistic value of the option that attains (as in Lemma 6 of (Liu et al., 2026)),
(vi) By Lemma A.2 and (9), .
Chaining (ii)–(vi), subtracting and substituting and gives the theorem. Each is compatible, since an incompatible item has reuse loss and ties go to the LLM.
B.4 Coverage Conditions and Proof of Corollary 4.2
Order the conversations of arbitrarily, let be generated by and the first of them, and condition on the lengths. The quantities and depend only on and the true parameters, so they are -measurable. For and , let be the number of turns of conversation at which the LLM was invoked, the key equals and . Write .
(C1) Cost coverage. For every and ,
with : the logging policy invoked the LLM on at least a fraction of the turns near .
(C2) Risk coverage. For every , and , at least labeled pairs satisfy , and . Set .
Burn-in.
where and .
Under (C1), (C2) and , the explicit form of Corollary 4.2 is: with probability at least ,
With Lemma 3.3 and this gives the rate in Corollary 4.2.
Proof of Corollary 4.2. Run Theorem 4.1 with each event at level and add a count event at level .
Local counts. For , let ; gives . By the lower-mass condition and (C1), the expected count within is at least , and is exactly . Lemma B.2 and a union bound over give, with probability at least , for all .
Cost widths. By Lemma A.2 of (Atalar et al., 2026) at radius , , so . Cells of a key partition that key, so , and by concavity of , . With , this gives the cost term.
Risk widths. By Lemma A.2 of (Atalar et al., 2026) with features and (C2), for , . Choosing gives . Hölder's inequality with gives , and .
Rate. By Lemma 3.3, , so the arrival term is . Balancing it against the discretization term gives , and the cost term does not depend on .
B.5 Reduction to the Single-Turn Bound
Set , , , , and with known and -Lipschitz. Then , , the risk is known so and the reuse-risk term vanishes, and . With the two remaining events at level , Theorem 4.1 becomes
Compared with Theorem 4.1 of (Atalar et al., 2026), the discretization term is the same, the arrival term is smaller by a factor of 2 (step (iii) above), and the cost term is restricted to the cells where the comparator invokes the LLM (step (v)). The self-normalized also makes the bound valid for adaptively logged data, and Lemma 3.3 improves the optimal radius from to .
What a turn is worth. Multi-turn logs count differently for different terms. For the arrival weights a conversation counts once, because its turns may be arbitrarily correlated. For the cost, every turn counts: the self-normalized bound tolerates the dependence, and only the burn-in grows with , since one conversation can contribute correlated observations. Multi-turn data are thus worth between and single-turn samples, depending on the term.
C PROOFS FOR SECTION 5
Throughout, a superscript marks a quantity computed at the snapshot used in conversation , and , denote widths computed from all data available before round . For a covered round we write for its cell and , and for the reused item on a reuse round. The arrival stages of Algorithm 2 use the stage rule of Atalar et al. (2026): a stage ends once it holds at least rounds. The following four lemmas are used in the proof of Theorem 5.1.
Lemma C.1 (Anytime confidence). With probability at least , at every snapshot and for all and , with the widths computed from the data at the snapshot.
Lemma C.1 follows from the cost and risk events of Lemma B.1: Theorem 2 of (Chowdhury & Gopalan, 2017) holds uniformly over time, and online, whether a round yields a cost or a label is decided before that feedback is revealed.
Lemma C.2 (Arrival with correlated turns and a data-built net). Let and . With probability at least , for all and every representative set the algorithm can form from the first rounds,
where the uncovered set is included as an extra cell.
For , Lemma C.2 reduces to the arrival event of Lemma 5.2 in (Atalar et al., 2026). The leading term pays because a request shares its conversation with correlated turns on average. The second term pays for the conversations that host representatives, which cannot be treated as fresh samples.
Lemma C.3 (Frozen widths). Let be a width computed from the data available before round , and for the same data. (a) For and every input , . (b) For an RBF kernel with length scale , . (c) Let count the conversation boundaries at which of the cost (label) data has grown by at least since the last switch. Then at every round , where is the time of the snapshot in use, except on at most rounds for the cost data and rounds for the label data.
Part (a) bounds how stale a frozen width can be, part (b) transfers a width from a representative to the request it serves, and part (c) counts the rounds on which the frozen and current widths differ by more than a factor .
Lemma C.4 (Number of switches). The number of switches satisfies , with arrival stages, and .
C.1 Proof of Lemma C.2
Representatives are observed rounds. Index every round by its conversation and its position . A representative set is determined by the tuple I of positions of its at most representatives, the conversations containing them are its hosts.
Step 1: fix the hosts. Fix I and condition on its host conversations. This fixes the cells and the uncovered set. We do not condition on the algorithm selecting I, so the non-host conversations remain independent copies of the random conversation and independent of the hosts. This lifts the argument of Lemma 5.2 of (Atalar et al., 2026) from requests to conversations, which is necessary because conditioning on one turn conditions on its whole conversation.
Step 2: concentration over non-host conversations. Fix a sign vector over the cells, let for in cell and . For a non-host conversation , let with . By (1), , so ; moreover and . By Bernstein's inequality, for each fixed , with probability at least the sum of over the first non-host conversations is at most .
Step 3: number of conversations. By Hoeffding's inequality and a union bound over , with probability at least , for all . If conversations are complete before round , then . With , this gives for , hence .
Step 4: assemble. is the sum of over the completed non-host conversations, plus the contribution of the host rounds (at most ) and of the current partial conversation (at most ). With Steps 2 and 3,
and gives the claim.
Step 5: union bound. There are at most tuples, sign vectors and values of . The total failure probability is at most by the choice of .
C.2 Proof of Lemma C.3
(a) Write and, on the finite-dimensional span of the features of the data and of , let over the data before round . Then . Since , with , and Lemma 12 of (Abbasi-Yadkori et al., 2011) gives . By Sylvester's identity, .
(b) By the variational characterization of Appendix B, is the distance from to the subspace . A distance to a fixed subspace is 1-Lipschitz, so , where the last step is the RBF bound in Lemma A.2 of (Atalar et al., 2026).
(c) The condition is checked at every conversation boundary, and when it holds a switch resets the snapshot. Hence at the first round of every conversation. If the difference reaches during a conversation, the boundary at its end satisfies the condition and is counted in (or ). Each such conversation has at most rounds, and different conversations end at different boundaries.
C.3 Proof of Lemma C.4
New representatives. A representative can be added at most times, so at most boundaries switch for this reason.
Information triggers. Let be the boundaries at which the cost condition holds, and the last switch before . Then , and the intervals are disjoint because a switch occurs at every . Hence
. The same argument gives .
Arrival stages. The stage rule is that of Algorithm 3 in (Atalar et al., 2026), and the global-stage part of its Lemma 5.3 (Lemma 7 of (Liu et al., 2026)) uses only that each stage holds at least (rounds before it) rounds. Checking the rule only at conversation boundaries preserves this lower bound, so .
C.4 Width Sums and Coverage
Lemma C.5 (Width sums with sampled labels), and .
Proof. Every LLM round adds its input to the cost data, so the LLM rounds form the sequence of cost inputs, and is the width before the input is added. The first claim is then the Cauchy–Schwarz and elliptical-potential step (Srinivas et al., 2010) used in the proof of Theorem 5.1 of (Atalar et al., 2026), with at most LLM rounds. For the second, let and let indicate that the label of reuse round is observed. Given the past and the reuse decision, is fixed and is Bernoulli( ) by Assumption 5(a), so . The labeled rounds form the sequence of label inputs, so the same step gives with the number of labels. Jensen’s inequality and complete the proof.
Lemma C.6 (Coverage). (a) At most rounds are uncovered. (b) For , let . The expected number of rounds before the net contains a representative with key within of is at most . Hence the expected number of rounds at which some item of has no such representative is at most .
Proof. (a) A conversation with an uncovered round adds at least one representative at its end, so at most conversations contain uncovered rounds, each with at most of them.
(b) Let , let be the number of rounds of conversation in , and let . By (1), , and , so . If conversation visits at a state , then after its net update some representative with key lies within of , and hence within of ; representatives are never removed. The index of the first visiting conversation is dominated by a geometric variable with mean at most , and each conversation has at most rounds. A union bound over completes the proof.
C.5 Proof of Theorem 5.1
With , let .
Step 0: events and conversations. Let be the event that Lemmas C.1 and C.2 hold for the snapshot of conversation . Then and ; since , failures contribute at most . Let be the conversation containing round , a stopping time for . Since and , , and by optional stopping it suffices to bound on .
Step 1: per round. For a covered round of conversation with cell , let , and on LLM rounds and on reuse rounds. The routing rule picks the option attaining . Since and share a key, the mask is the same at both, and Assumption 2 gives . Uncovered rounds have .
Step 2: average over a conversation. The snapshot is -measurable, and conversation is independent of with a law that does not depend on how it is served (Assumption 1). By (1), the expected number of its rounds in is , so
with restricted to the covered cells. Likewise with .
Step 3: chain at the snapshot. Let replace each item of by its nearest representative in with the same key, and let be the event that some item has none within . On , with ,
The first and fourth steps are Lemma 4 of (Liu et al., 2026); the weights on the covered cells form a sub-probability vector, so the constant is 1. The second is Lemma 3.1, since is Reverse Greedy's output on exactly this instance; this is why the snapshot is frozen. The third holds because is monotone in and , and , by Lemma C.1. The fifth uses on . Off , it uses the proof of
Lemma A.2, which bounds pointwise and therefore gives on the covered cells, together with (9) with replaced by .
Step 4: widths. On a covered LLM round, Lemma C.1 and Lemma C.3(b) give , and Lemma C.3(a,c) gives except on at most rounds, where we use . On a covered reuse round, in the same way and with Assumption 5(b), , , and except on at most rounds. Summing with Lemma C.5,
Since , the misspecification term satisfies with .
Step 5: sum over conversations. Steps 1–4 give, on , . Insert Step 3 and sum over , using for -measurable . The terms , the transfer terms of Step 4 and form the discretization line. Lemma C.6 bounds the uncovered rounds by and the rounds in by , and Lemma C.4 bounds the switching cost by . It remains to bound the arrival sum .
Let be the number of rounds before stage and the length of stage , with . A stage ends at the first boundary at which it holds at least rounds, so , and every stage starts with a switch, so the snapshot used in stage is taken after at least rounds. Let be the last stage with . On the rounds up to we use , which contributes at most . On a later stage, Lemma C.2 applies because , and with ,
Summing over at most stages, and using , gives the arrival term of the theorem plus . Collecting the terms,
For fixed , , , , and grow at most polylogarithmically in , and does not depend on .
C.6 Proof of Corollary 5.2
Let . The explicit form of Corollary 5.2(a) is: choosing
\begin{aligned}\mathrm{Reg}(N)=\tilde{O}\Big(L^{\prime}_{\mathrm{disc}}_{\overline{p+2}}\big(\frac{T^{2}_{\max}|\Omega|}{\mathbb{E}[T]c_{0}}\big)^{\frac{1}{p+2}}N^{\frac{p+1}{p+2}}\\+\tilde{O}(\beta_{c}\sqrt{N\mathcal{I}_{c}}+\gamma\beta_{r}\sqrt{N\mathcal{I}_{r}/\zeta})\\+E_{\mathrm{mis}}.\end{aligned}(a) By definition and , so the discretization line is at most . By Lemma 3.3, , so and , using . Since also , the arrival term is . Balancing it against gives the stated and rate. Switching and are , since , and are of lower order.
(b) Support points of the same key are more than apart, so the first request at a support point is uncovered and becomes a representative located exactly there. Every later request at that point is served from it, so . Items of are support points, so once each has been seen, and earlier rounds are counted by with the mass of . The cost inputs take at most values and the label inputs at most , so the kernel matrices have rank at most and , which gives and . All remaining terms of Theorem 5.1 are then or lower order.
Single-turn special case. Setting , , and with known gives , removes the reuse-risk term and the risk switches, and yields plus . For fixed problem parameters, the separated-support condition of Corollary 5.2(b) yields regret, matching the horizon dependence of Theorem 5.1 in Atalar et al. (2026). That result likewise relies on a structural concentration condition: Assumption 2 there requires a bounded effective number of centers and approximation distances decaying as , and our separated-support condition serves the same purpose.
What conversations cost online. Compared with a stream of independent requests, conversations change only constants and lower-order terms. The arrival term carries , which equals 1 for , the burn-in grows with , and snapshots add the factor. The learned risk adds the reuse-risk term, which vanishes when the risk is known.
D ADDITIONAL EXPERIMENTAL RESULTS
D.1 Workload Screening and the Motivation Study
Protocol. Figure 1 measures how well each score separates acceptable from unacceptable reuse when every follow-up turn (turn ) is served by its nearest state in another conversation. States are with Granite embeddings. The pools are a 52k-conversation WildChat sample (59,648 follow-ups of 20k target conversations), screening samples of at most 6,000 conversations for Taskmaster-3, MultiDoc2Dial and ABCD (53,781, 26,772 and 32,456 follow-ups), and the 2,200 SocraTeach dialogues of Section 6 (8,621 follow-ups). For each workload, 2,109–2,897 (follow-up, neighbour) pairs are drawn stratified by distance band (width 0.05 up to 0.30, at most two per target conversation and band), labeled by the GPT-4o-mini judge of Section 6, and reweighted to the population of follow-ups. The learned risk is a Nyström RBF kernel ridge regression (rank 512) on a 40-dimensional pair feature : similarities of the two states, requests, standalone rewrites and histories, and of the target request to the cached response; same-intent, same-task and exact-match indicators; turn positions and history lengths; and 8-dimensional projections of both states and the cached response. Its bandwidth and ridge are chosen by nested grouped cross-validation on the Brier score, and all scores are out of fold (5 folds grouped by conversation). The configuration was fixed on WildChat and not tuned on the other workloads. CIs use 1,000 cluster-bootstrap resamples.
Results. Table 4 also reports safe reuse at 80% judge precision: the share of all follow-ups that a score can serve acceptably while at least 80% of its served pairs are accepted. Among the five screened task-oriented and document-grounded corpora (Taskmaster-3, MultiDoc2Dial, ABCD, SGD, MultiWOZ 2.2), Taskmaster-3 had the most follow-up reuse; in WildChat, both scores serve under 2% of follow-ups at this precision. On SocraTeach, the two coincide at 80% precision and the learned risk serves more below it (53.0% vs. 38.3% at 70%): beyond distance 0.10, neighbours from the same problem are accepted 55–64% of the time and those from other problems 9–15%. The learned risk finds the former, but they never reach 80%.
Table 4. The motivation study (Figure 1). AUC for acceptable reuse and safe reuse at 80% judge precision (% of follow-ups, 95% CI) for embedding distance (Dist.) and the learned risk (Learned).
| Workload | AUC | Safe reuse at 80% | ||
|---|---|---|---|---|
| Dist. | Learned | Dist. | Learned | |
| WildChat | 0.69 | 0.76 | 1.1 | 1.8 [0.5, 3.6] |
| Taskmaster-3 | 0.74 | 0.89 | 17.3 [14.2, 22.7] | 38.9 [32.2, 46.4] |
| SocraTeach | 0.67 | 0.75 | 20.5 [10.8, 24.0] | 15.5 [8.1, 33.4] |
| MultiDoc2Dial | 0.72 | 0.81 | 0.0 [0.0, 6.3] | 22.3 [16.3, 27.1] |
| ABCD | 0.62 | 0.82 | 0.0 [0.0, 0.2] | 13.9 [10.9, 18.8] |
D.2 Baselines
ElastiCache-MT follows the semantic-caching recipe of Amazon ElastiCache (Amazon Web Services, 2026): it embeds the most recent messages of the conversation as one string and serves the nearest cached entry if their cosine similarity exceeds a threshold. ContextCache (Yan et al., 2025) retrieves candidates by the similarity of the current message and serves one only if the mean embedding of the last five user messages also matches; it also serves exact context matches. vCache (Gaspar Schroeder et al., 2026) learns a similarity threshold for each cached entry from correctness feedback, keeping its error rate below a target ; it uses ElastiCache-MT's embedding. The joint-state threshold applies a single cosine threshold to our state embedding . Single-turn is CUCB-SC-Cont (Atalar et al., 2026) applied to the current message alone, without history.
Offline, ElastiCache-MT, ContextCache and the joint-state threshold cache the source states that are most often the nearest neighbor of a source state from another conversation, and vCache builds its cache by replaying the source conversations with judge feedback. Online, the threshold baselines insert every LLM-generated response and evict the least recently used (LRU) entry when the cache is full; vCache inserts a response when its exploration finds the cached one unacceptable, also with LRU eviction. Without a budget, nothing is evicted. Online, CLCB-LS-MT updates its cost and risk models and its -net at the end of each conversation and recomputes its cache when needed; the same lower-confidence rule decides reuses from its session buffer, which is cleared when the conversation ends.
Workload details. SocraTeach has 35,151 dialogues on 11,147 problems, with students drawn from six cognitive profiles; its responses are LLM-generated. Taskmaster-3 has 23,757 dialogues across 43 scenarios, each written by one crowd worker playing both customer and agent; it had the most follow-up reuse among five screened task-oriented and document-grounded corpora (Appendix D.1). Mean test costs are 0.36 on Taskmaster-3 and 0.33 on SocraTeach. Without a budget, CUCB-SC-MT and single-turn cache every center of their -nets offline (3,168 and 4,108 centers
on Taskmaster-3; 2,278 and 4,836 on SocraTeach), and CLCB-LS-MT ends the stream with 5,799 net centers on Taskmaster-3 and 5,346 on SocraTeach. Its session buffer is cleared when the conversation ends.
D.3 Latency
Tables 5–8 report the per-budget latency estimates of Section 6.4. Each table was timed in a single session with its own LLM measurement: is 891 and 1,471 ms offline and 858 and 1,100 ms online on Taskmaster-3 and SocraTeach. The LLM calls generate the assistant's reply to sampled requests given the conversation so far. Offline, the hit rate is that of the selected cache on the test requests. Online, it covers the whole stream (including the cold start), decisions are timed at each method's final cache (an upper bound for caches that grow), and methods are timed round-robin, request by request, so that they share the machine's state. For CLCB-LS-MT, the decision also includes the net-coverage check and the session candidates. Without a budget, CUCB-SC-MT's offline lookup over 3,168 net centers on Taskmaster-3 takes 132 ms, which raises its estimate to 0.90.
Online methods also work after each response: CLCB-LS-MT and single-turn update their models and nets and recompute their caches at the end of conversations (0.11–0.28 s per conversation for CLCB-LS-MT), the threshold baselines insert and evict entries, and vCache records observations. The online estimates add this work, amortized per request, to the request path, which is conservative because it can run after the response is returned. CLCB-LS-MT needs a judge label for each reuse (0.28–0.32 labels per request on Taskmaster-3 and 0.36–0.40 on SocraTeach at ), and vCache one for each exploration (0.85–0.99 and 0.99–1.00); these are extra LLM calls made off the request path. Methods that reuse aggressively can have lower estimated latency than CLCB-LS-MT while losing more, e.g., ContextCache at on Taskmaster-3 (0.76; loss 109.2%) and the unbounded ElastiCache-MT, joint-state threshold and ContextCache on SocraTeach (0.10, 0.41 and 0.53; losses 154.7%, 129.8% and 81.9%).
D.4 Online reuse quality
Tables 9 and 10 extend Table 1 to every method and budget. They add the hit rate, the share of hits that reuse a response of the same conversation, and the regret against the best fixed -entry cache in hindsight. “Other conv. only” variants never serve a response of the current conversation; for CLCB-LS-MT, this removes the session buffer.
On SocraTeach, 54% to 88% of CLCB-LS-MT's hits at reuse an earlier response of the same conversation, and removing the session buffer raises its loss by 8.6 to 14.0 pp. On Taskmaster-3, where same-conversation re-
Table 5. Offline latency estimates on Taskmaster-3. Budget columns report the estimated mean per-request latency relative to the no-cache LLM-call latency ( ms); values below 1 indicate lower expected latency. Ranges span ; the last column removes the cache-size constraint. Without a budget, CUCB-SC-MT's lookup over 3,168 net centers takes 132 ms.
| Method | Embeddings(ms) | Lookup (ms) | Hit latency(ms) | Hit rate | Expected latency relative to no cache | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| no budget | ||||||||||
| CUCB-SC-MT | 72.3 | 9.76–30.46 | 82–103 | 25.5–30.6% | 0.84 | 0.82 | 0.81 | 0.81 | 0.81 | 0.90 |
| ElastiCache-MT | 37.2 | 0.02–0.11 | 37 | 6.1–20.9% | 0.98 | 0.94 | 0.91 | 0.84 | 0.83 | 0.76 |
| ContextCache | 34.4 | 0.48–0.67 | 35 | 6.0–22.7% | 0.98 | 0.96 | 0.93 | 0.87 | 0.81 | 0.68 |
| vCache | 37.2 | 2.02–2.32 | 39–40 | 0.2–13.4% | 1.04 | 1.04 | 1.03 | 1.00 | 0.91 | 0.87 |
| Joint-state threshold | 72.3 | 0.02–0.12 | 72 | 0.3–6.1% | 1.08 | 1.06 | 1.06 | 1.03 | 1.02 | 0.96 |
| Single-turn | 34.4 | 0.82–1.09 | 35 | 0.1–9.1% | 1.02 | 0.95 | 1.01 | 1.04 | 1.01 | 1.01 |
Table 6. Offline latency estimates on SocraTeach. Budget columns report the estimated mean per-request latency relative to the no-cache LLM-call latency ( ms); values below 1 indicate lower expected latency. Ranges span ; the last column removes the cache-size constraint.
| Method | Embeddings(ms) | Lookup (ms) | Hit latency(ms) | Hit rate | Expected latency relative to no cache | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| no budget | ||||||||||
| CUCB-SC-MT | 35.7 | 10.80–76.87 | 46–113 | 6.8–47.0% | 0.99 | 0.89 | 0.84 | 0.65 | 0.61 | 0.58 |
| ElastiCache-MT | 16.5 | 0.03–0.21 | 17 | 0.4–13.2% | 1.01 | 1.01 | 1.01 | 1.01 | 0.88 | 0.02 |
| ContextCache | 16.2 | 0.45–0.58 | 17 | 1.1–20.6% | 1.00 | 1.00 | 1.00 | 0.93 | 0.81 | 0.47 |
| vCache | 16.5 | 1.65–2.71 | 18–19 | 0.0–0.2% | 1.01 | 1.01 | 1.01 | 1.01 | 1.01 | 0.69 |
| Joint-state threshold | 35.7 | 0.01–0.11 | 36 | 0.4–17.9% | 1.02 | 1.02 | 1.01 | 0.97 | 0.85 | 0.22 |
| Single-turn | 16.2 | 0.84–1.03 | 17 | 0.6–12.2% | 1.01 | 0.98 | 0.97 | 0.92 | 0.89 | 0.62 |
sponses are less often acceptable, these hits are 18% to 23% of its hits and the buffer is worth 1.9 to 2.5 pp. ContextCache also relies on the current conversation: its LRU cache holds the conversation's recent turns, which supply 59% to 94% (SocraTeach) and 39% to 91% (Taskmaster-3) of its hits at . On Taskmaster-3, where these responses are rarely acceptable, this is why ContextCache exceeds the no-cache loss at (up to 109.2%). When both methods may only reuse responses from other conversations, CLCB-LS-MT's loss is lower than ContextCache's at every budget, by 2.9 to 13.3 pp on SocraTeach and by 16.0 to 21.9 pp on Taskmaster-3. At , CLCB-LS-MT's acceptable reuses fall on requests that cost 1.45 (Taskmaster-3) and 1.51 (SocraTeach) times the average request, against 1.32 (ElastiCache-MT) and 1.15 (ContextCache) on Taskmaster-3 and 1.10 (ContextCache) on SocraTeach.
D.5 Loss tables, learning over the stream and the price of a reuse
Tables 13–16 give the losses of Figure 3 with their CIs. Figures 5–7 show validation diagnostics of CUCB-SC-MT on Taskmaster-3: the KRR cost prediction, the reliability of the kernel risk model, and the coverage and size of the keyed -net as varies.
Learning over the stream. Tables 11 and 12 split the online loss into the four quarters of the stream, each as a percentage of that quarter's no-cache cost. On Taskmaster-3, CLCB-LS-MT's loss falls by 7.9–9.1 pp from the first to the last quarter at every budget, most of it by the second quarter (80.3% to 72.0% at ), while the budgeted baselines change by at most 2.6 pp. On SocraTeach the decrease grows with the budget, from 7.5 pp at to 13.4 pp at and 15.8 pp without a budget, since a larger cache keeps more of the responses whose risk has been learned. CLCB-LS-MT is at most 2.3 pp above ContextCache in the first quarter and below it in every later quarter at every budget, while ContextCache changes by at most 4.1 pp. Without a budget, vCache also improves as its thresholds adapt (by 7.4 pp on Taskmaster-3 and 40.5 pp on SocraTeach), but it ends at 84.8% and 97.9%, against 72.0% and 68.5% for CLCB-LS-MT; on SocraTeach, unbounded ElastiCache-MT and the joint-state threshold stay above no
Table 7. Online latency estimates on Taskmaster-3. Budget columns report the estimated mean per-request latency, including the amortized background work, relative to the no-cache LLM-call latency ( ms); lower is better. Decisions are timed at the final caches; background work runs after the response, off the request path. These are component-based estimates rather than measured end-to-end latencies.
| Method | Embeddings (ms) | Decision (ms) | Hit latency (ms) | Background (ms/request) | Hit rate –1000 | Estimated latency relative to no cache | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| No budget | |||||||||||
| CLCB-LS-MT | 70.4 | 12.0–12.4 | 82–83 | 27.8–27.9 | 28.1–32.7% | 0.85 | 0.82 | 0.81 | 0.80 | 0.81 | 0.81 |
| ContextCache | 33.7 | 1.3–1.5 | 35 | 0.006–0.009 | 16.7–27.8% | 0.76 | 0.87 | 0.85 | 0.81 | 0.79 | 0.75 |
| ElastiCache-MT | 36.3 | 0.1–0.3 | 36–37 | 0.005 | 10.3–21.3% | 0.94 | 0.91 | 0.89 | 0.83 | 0.84 | 0.77 |
| vCache | 36.3 | 1.7–4.4 | 38–41 | 0.010–0.013 | 0.3–14.8% | 1.04 | 1.04 | 1.03 | 0.98 | 0.90 | 0.92 |
| Joint-state threshold | 70.4 | 0.1–0.3 | 70–71 | 0.005–0.006 | 0.7–3.5% | 1.08 | 1.06 | 1.06 | 1.05 | 1.05 | 0.99 |
| Single-turn (CUCB-SC-Cont) | 33.7 | 4.6–5.3 | 38–39 | 8.4–14.6 | 0.1–5.5% | 1.04 | 1.01 | 1.04 | 1.05 | 1.03 | 1.03 |
Table 8. Online latency estimates on SocraTeach. Budget columns report the estimated mean per-request latency, including the amortized background work, relative to the no-cache LLM-call latency ( ms); lower is better. Decisions are timed at the final caches; background work runs after the response, off the request path. These are component-based estimates rather than measured end-to-end latencies.
| Method | Embeddings (ms) | Decision (ms) | Hit latency (ms) | Background (ms/request) | Hit rate –1000 | Estimated latency relative to no cache | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| No budget | |||||||||||
| CLCB-LS-MT | 31.8 | 7.2–7.3 | 39 | 22.6–23.2 | 35.7–40.3% | 0.70 | 0.69 | 0.69 | 0.67 | 0.65 | 0.59 |
| ContextCache | 15.4 | 0.6 | 16 | 0.002 | 7.0–29.7% | 0.82 | 0.80 | 0.94 | 0.77 | 0.72 | 0.53 |
| ElastiCache-MT | 16.3 | 0.026–0.2 | 16–17 | 0.002 | 1.8–6.9% | 0.99 | 1.00 | 0.99 | 0.97 | 0.95 | 0.10 |
| vCache | 16.3 | 1.0–1.6 | 17–18 | 0.004–0.005 | 0.1–0.7% | 1.01 | 1.01 | 1.01 | 1.01 | 1.01 | 0.65 |
| Joint-state threshold | 31.8 | 0.035–0.2 | 32 | 0.002 | 1.1–12.2% | 1.02 | 1.01 | 0.97 | 0.95 | 0.91 | 0.41 |
| Single-turn (CUCB-SC-Cont) | 15.4 | 3.4–3.5 | 19 | 7.8–9.8 | 0.1–3.4% | 1.02 | 1.02 | 1.02 | 1.01 | 0.99 | 0.89 |
caching in every quarter.
Price of an unacceptable reuse. Figures 8 and 9 repeat the offline comparison for , with every method tuned on validation at each price. A lower price makes an unacceptable reuse cheaper, so every method reuses more and its loss falls. CUCB-SC-MT has the lowest loss at every price and budget on both workloads. The budgeted baselines approach no caching as grows, most clearly on SocraTeach, while CUCB-SC-MT stays below it. Without a budget on SocraTeach at , caching every source state becomes competitive: ElastiCache-MT and the joint-state threshold come within a few points of CUCB-SC-MT. CUCB-SC-MT as specified (, dotted) differs from the tuned version at only a few points, by at most 4.9 pp (SocraTeach, , ), so tuning matters little. The best -entry cache in hindsight (dashed) uses the test labels, so it is a reference rather than an achievable target.

Figure 5. Validation cost prediction in offline setting for Taskmaster.

Figure 6. Validation risk function predictions in offline setting for Taskmaster.

Figure 7. Validation epsilon selection in offline setting for Taskmaster.

Figure 8. Taskmaster-3 offline: test loss versus the price of an unacceptable reuse, with every method tuned on validation at each price. Dotted: CUCB-SC-MT as specified (); dashed: best -entry cache in hindsight.
Table 9. Taskmaster-3 online: reuse quality by method and budget. Precision is the judge's acceptance rate of the hits; false reuse and safe reuse are shares of all requests; safe cost avoided is a share of the no-cache cost. Regret is against the best fixed k-entry cache in hindsight (judged pool); for CLCB-LS-MT the session buffer is not part of the comparator.
| Method | Budget | Hit rate | Precision | Safe reuse | False reuse | Safe cost avoided | Same-conv. hits | Loss (%) | Regret (pp) |
|---|---|---|---|---|---|---|---|---|---|
| CLCB-LS-MT | k = 100 | 28.1% | 73.4% | 20.6% | 7.5% | 32.4% | 22.9% | 75.0 | +19.6 |
| CLCB-LS-MT | k = 200 | 30.4% | 73.4% | 22.3% | 8.1% | 33.9% | 20.5% | 74.1 | +25.3 |
| CLCB-LS-MT | k = 300 | 32.3% | 74.2% | 23.9% | 8.3% | 35.0% | 18.4% | 73.6 | +28.4 |
| CLCB-LS-MT | k = 500 | 32.7% | 75.1% | 24.5% | 8.1% | 35.4% | 17.9% | 73.0 | +32.8 |
| CLCB-LS-MT | k = 1000 | 32.3% | 74.6% | 24.1% | 8.2% | 35.0% | 18.7% | 73.5 | +40.6 |
| CLCB-LS-MT | no budget | 31.7% | 74.0% | 23.4% | 8.2% | 34.3% | 19.4% | 74.1 | +53.1 |
| CLCB-LS-MT, other conv. only | k = 100 | 25.0% | 76.9% | 19.2% | 5.8% | 29.3% | 0.0% | 76.9 | +21.5 |
| CLCB-LS-MT, other conv. only | k = 200 | 28.2% | 77.3% | 21.8% | 6.4% | 30.6% | 0.0% | 76.6 | +27.7 |
| CLCB-LS-MT, other conv. only | k = 300 | 27.9% | 78.1% | 21.8% | 6.1% | 30.6% | 0.0% | 76.0 | +30.8 |
| CLCB-LS-MT, other conv. only | k = 500 | 28.5% | 78.3% | 22.4% | 6.2% | 31.4% | 0.0% | 75.3 | +35.1 |
| CLCB-LS-MT, other conv. only | k = 1000 | 27.8% | 78.7% | 21.9% | 5.9% | 30.7% | 0.0% | 75.7 | +42.8 |
| CLCB-LS-MT, other conv. only | no budget | 28.1% | 78.5% | 22.1% | 6.1% | 31.2% | 0.0% | 75.5 | +54.5 |
| ContextCache | k = 100 | 27.8% | 39.9% | 11.1% | 16.7% | 16.7% | 91.3% | 109.2 | +53.8 |
| ContextCache | k = 200 | 16.7% | 50.2% | 8.4% | 8.3% | 11.4% | 74.4% | 101.1 | +52.2 |
| ContextCache | k = 300 | 19.2% | 53.2% | 10.2% | 9.0% | 13.3% | 65.6% | 100.2 | +55.1 |
| ContextCache | k = 500 | 22.6% | 56.3% | 12.8% | 9.9% | 15.8% | 54.0% | 99.4 | +59.3 |
| ContextCache | k = 1000 | 25.1% | 62.0% | 15.5% | 9.5% | 17.9% | 39.0% | 97.2 | +64.2 |
| ContextCache | no budget | 29.4% | 70.0% | 20.6% | 8.8% | 21.2% | 13.0% | 94.6 | +73.6 |
| ContextCache, other conv. only | k = 100 | 3.2% | 74.5% | 2.4% | 0.8% | 2.6% | 0.0% | 98.8 | +43.4 |
| ContextCache, other conv. only | k = 200 | 5.3% | 78.5% | 4.1% | 1.1% | 4.6% | 0.0% | 97.4 | +48.5 |
| ContextCache, other conv. only | k = 300 | 7.8% | 79.6% | 6.2% | 1.6% | 6.7% | 0.0% | 95.9 | +50.7 |
| ContextCache, other conv. only | k = 500 | 11.1% | 79.4% | 8.8% | 2.3% | 9.6% | 0.0% | 94.5 | +54.3 |
| ContextCache, other conv. only | k = 1000 | 16.0% | 80.9% | 12.9% | 3.1% | 13.9% | 0.0% | 91.7 | +58.8 |
| ContextCache, other conv. only | no budget | 26.4% | 76.0% | 20.0% | 6.3% | 20.2% | 0.0% | 91.9 | +70.9 |
| ElastiCache-MT | k = 100 | 10.3% | 60.4% | 6.2% | 4.1% | 9.0% | 60.9% | 99.0 | +43.6 |
| ElastiCache-MT | k = 200 | 13.3% | 68.1% | 9.0% | 4.2% | 12.8% | 44.9% | 95.6 | +46.7 |
| ElastiCache-MT | k = 300 | 15.6% | 72.2% | 11.3% | 4.3% | 15.7% | 36.8% | 92.9 | +47.8 |
| ElastiCache-MT | k = 500 | 21.3% | 74.0% | 15.8% | 5.6% | 20.8% | 30.6% | 90.2 | +50.0 |
| ElastiCache-MT | k = 1000 | 20.5% | 82.5% | 16.9% | 3.6% | 22.3% | 19.4% | 85.0 | +52.0 |
| ElastiCache-MT | no budget | 27.0% | 84.1% | 22.7% | 4.3% | 27.3% | 13.7% | 81.9 | +60.9 |
| ElastiCache-MT, other conv. only | k = 100 | 4.0% | 89.3% | 3.6% | 0.4% | 4.9% | 0.0% | 96.1 | +40.7 |
| ElastiCache-MT, other conv. only | k = 200 | 7.3% | 90.4% | 6.6% | 0.7% | 8.9% | 0.0% | 92.6 | +43.8 |
| ElastiCache-MT, other conv. only | k = 300 | 9.6% | 91.7% | 8.8% | 0.8% | 11.8% | 0.0% | 90.0 | +44.8 |
| ElastiCache-MT, other conv. only | k = 500 | 14.6% | 89.9% | 13.1% | 1.5% | 16.9% | 0.0% | 86.4 | +46.2 |
| ElastiCache-MT, other conv. only | k = 1000 | 16.4% | 92.7% | 15.2% | 1.2% | 19.7% | 0.0% | 82.9 | +49.9 |
| ElastiCache-MT, other conv. only | no budget | 23.4% | 91.5% | 21.4% | 2.0% | 25.2% | 0.0% | 79.5 | +58.5 |
| vCache | k = 100 | 0.3% | 70.3% | 0.2% | 0.1% | 0.2% | 0.0% | 100.1 | +44.7 |
| vCache | k = 200 | 0.7% | 81.2% | 0.6% | 0.1% | 0.7% | 0.0% | 99.6 | +50.7 |
| vCache | k = 300 | 1.2% | 89.2% | 1.1% | 0.1% | 1.5% | 0.0% | 98.8 | +53.6 |
| vCache | k = 500 | 6.9% | 86.5% | 6.0% | 0.9% | 7.7% | 0.0% | 93.9 | +53.7 |
| vCache | k = 1000 | 14.8% | 81.1% | 12.0% | 2.8% | 14.7% | 0.0% | 90.4 | +57.5 |
| vCache | no budget | 12.9% | 89.9% | 11.6% | 1.3% | 15.1% | 0.0% | 87.3 | +66.3 |
| Joint-state threshold | k = 100 | 0.7% | 61.9% | 0.4% | 0.3% | 0.6% | 80.3% | 99.8 | +44.4 |
| Joint-state threshold | k = 200 | 2.0% | 55.2% | 1.1% | 0.9% | 1.1% | 51.3% | 100.4 | +51.5 |
| Joint-state threshold | k = 300 | 2.4% | 61.7% | 1.5% | 0.9% | 1.5% | 41.1% | 100.1 | +54.9 |
| Joint-state threshold | k = 500 | 3.5% | 66.6% | 2.3% | 1.2% | 2.1% | 29.0% | 100.1 | +59.9 |
| Joint-state threshold | k = 1000 | 3.4% | 70.7% | 2.4% | 1.0% | 2.3% | 25.5% | 99.6 | +66.7 |
| Joint-state threshold | no budget | 9.2% | 78.6% | 7.2% | 2.0% | 6.7% | 8.2% | 97.6 | +76.6 |
| Single-turn (CUCB-SC-Cont) | k = 100 | 2.2% | 24.0% | 0.5% | 1.7% | 0.8% | 0.0% | 101.9 | +46.5 |
| Single-turn (CUCB-SC-Cont) | k = 200 | 5.5% | 30.0% | 1.6% | 3.8% | 2.7% | 0.0% | 102.8 | +54.0 |
| Single-turn (CUCB-SC-Cont) | k = 300 | 2.6% | 27.2% | 0.7% | 1.9% | 1.0% | 0.0% | 102.1 | +57.0 |
| Single-turn (CUCB-SC-Cont) | k = 500 | 0.1% | 18.2% | 0.0% | 0.1% | 0.0% | 0.0% | 100.2 | +60.0 |
| Single-turn (CUCB-SC-Cont) | k = 1000 | 2.8% | 29.1% | 0.8% | 2.0% | 1.1% | 0.0% | 102.3 | +69.3 |
| Single-turn (CUCB-SC-Cont) | no budget | 3.2% | 32.8% | 1.0% | 2.1% | 1.2% | 0.0% | 102.4 | +81.4 |
Table 10. SocraTeach online: reuse quality by method and budget. Precision is the judge's acceptance rate of the hits; false reuse and safe reuse are shares of all requests; safe cost avoided is a share of the no-cache cost. Regret is against the best fixed k-entry cache in hindsight (judged pool); for CLCB-LS-MT the session buffer is not part of the comparator.
| Method | Budget | Hit rate | Precision | Safe reuse | False reuse | Safe cost avoided | Same-conv. hits | Loss (%) | Regret (pp) |
|---|---|---|---|---|---|---|---|---|---|
| CLCB-LS-MT | k = 100 | 35.7% | 61.1% | 21.8% | 13.9% | 34.3% | 87.7% | 82.7 | +5.4 |
| CLCB-LS-MT | k = 200 | 36.4% | 63.6% | 23.2% | 13.3% | 36.6% | 77.6% | 79.9 | +18.6 |
| CLCB-LS-MT | k = 300 | 37.1% | 64.3% | 23.8% | 13.2% | 37.6% | 69.3% | 78.9 | +29.6 |
| CLCB-LS-MT | k = 500 | 38.4% | 66.2% | 25.4% | 13.0% | 39.6% | 60.4% | 77.1 | +43.8 |
| CLCB-LS-MT | k = 1000 | 40.3% | 67.5% | 27.2% | 13.1% | 41.0% | 54.4% | 76.1 | +61.6 |
| CLCB-LS-MT | no budget | 46.9% | 71.9% | 33.7% | 13.2% | 43.4% | 44.0% | 74.4 | +72.1 |
| CLCB-LS-MT, other conv. only | k = 100 | 6.9% | 55.3% | 3.8% | 3.1% | 6.2% | 0.0% | 96.8 | +19.4 |
| CLCB-LS-MT, other conv. only | k = 200 | 12.0% | 67.5% | 8.1% | 3.9% | 12.5% | 0.0% | 92.3 | +31.0 |
| CLCB-LS-MT, other conv. only | k = 300 | 14.8% | 68.6% | 10.1% | 4.6% | 15.5% | 0.0% | 90.7 | +41.4 |
| CLCB-LS-MT, other conv. only | k = 500 | 18.3% | 71.5% | 13.1% | 5.2% | 19.8% | 0.0% | 87.5 | +54.2 |
| CLCB-LS-MT, other conv. only | k = 1000 | 22.0% | 74.7% | 16.5% | 5.6% | 23.5% | 0.0% | 84.7 | +70.2 |
| CLCB-LS-MT, other conv. only | no budget | 27.2% | 78.8% | 21.5% | 5.8% | 24.9% | 0.0% | 83.9 | +81.6 |
| ContextCache | k = 100 | 19.8% | 71.4% | 14.1% | 5.7% | 22.5% | 93.5% | 85.1 | +7.8 |
| ContextCache | k = 200 | 21.2% | 72.5% | 15.4% | 5.8% | 22.9% | 86.6% | 85.1 | +23.7 |
| ContextCache | k = 300 | 7.0% | 77.3% | 5.4% | 1.6% | 5.2% | 58.9% | 97.1 | +47.9 |
| ContextCache | k = 500 | 24.7% | 74.7% | 18.5% | 6.3% | 23.8% | 73.3% | 85.2 | +51.9 |
| ContextCache | k = 1000 | 29.7% | 76.9% | 22.8% | 6.9% | 25.1% | 59.5% | 85.3 | +70.7 |
| ContextCache | no budget | 48.5% | 78.4% | 38.0% | 10.5% | 35.2% | 38.4% | 81.9 | +79.6 |
| ContextCache, other conv. only | k = 100 | 1.2% | 87.4% | 1.1% | 0.2% | 0.6% | 0.0% | 99.7 | +22.3 |
| ContextCache, other conv. only | k = 200 | 2.8% | 87.1% | 2.4% | 0.4% | 1.5% | 0.0% | 99.2 | +37.8 |
| ContextCache, other conv. only | k = 300 | 3.2% | 91.3% | 2.9% | 0.3% | 1.0% | 0.0% | 99.6 | +50.4 |
| ContextCache, other conv. only | k = 500 | 6.7% | 85.2% | 5.7% | 1.0% | 3.2% | 0.0% | 98.8 | +65.6 |
| ContextCache, other conv. only | k = 1000 | 12.5% | 83.8% | 10.4% | 2.0% | 6.1% | 0.0% | 98.0 | +83.5 |
| ContextCache, other conv. only | no budget | 36.6% | 81.2% | 29.7% | 6.9% | 21.1% | 0.0% | 91.8 | +89.5 |
| ElastiCache-MT | k = 100 | 2.7% | 67.9% | 1.8% | 0.9% | 1.5% | 66.9% | 100.3 | +22.9 |
| ElastiCache-MT | k = 200 | 1.8% | 93.0% | 1.7% | 0.1% | 0.3% | 6.5% | 100.0 | +38.7 |
| ElastiCache-MT | k = 300 | 2.7% | 94.2% | 2.5% | 0.2% | 0.4% | 4.5% | 100.0 | +50.8 |
| ElastiCache-MT | k = 500 | 4.2% | 93.4% | 3.9% | 0.3% | 0.6% | 2.9% | 100.2 | +67.0 |
| ElastiCache-MT | k = 1000 | 6.9% | 95.6% | 6.6% | 0.3% | 0.8% | 0.0% | 100.1 | +85.5 |
| ElastiCache-MT | no budget | 91.8% | 48.2% | 44.2% | 47.6% | 47.6% | 12.3% | 154.7 | +152.3 |
| ElastiCache-MT, other conv. only | k = 100 | 0.9% | 94.8% | 0.8% | 0.0% | 0.1% | 0.0% | 100.0 | +22.6 |
| ElastiCache-MT, other conv. only | k = 200 | 1.7% | 96.2% | 1.7% | 0.1% | 0.2% | 0.0% | 99.9 | +38.6 |
| ElastiCache-MT, other conv. only | k = 300 | 2.6% | 96.4% | 2.5% | 0.1% | 0.3% | 0.0% | 99.9 | +50.7 |
| ElastiCache-MT, other conv. only | k = 500 | 4.1% | 94.8% | 3.9% | 0.2% | 0.5% | 0.0% | 100.1 | +66.9 |
| ElastiCache-MT, other conv. only | k = 1000 | 6.9% | 95.6% | 6.6% | 0.3% | 0.8% | 0.0% | 100.1 | +85.5 |
| ElastiCache-MT, other conv. only | no budget | 84.6% | 49.3% | 41.7% | 43.0% | 44.3% | 0.0% | 151.8 | +149.5 |
| vCache | k = 100 | 0.1% | 25.0% | 0.0% | 0.1% | 0.0% | 0.0% | 100.1 | +22.7 |
| vCache | k = 200 | 0.2% | 39.1% | 0.1% | 0.1% | 0.1% | 0.0% | 100.2 | +38.9 |
| vCache | k = 300 | 0.2% | 40.0% | 0.1% | 0.1% | 0.1% | 0.0% | 100.2 | +50.9 |
| vCache | k = 500 | 0.3% | 54.5% | 0.2% | 0.1% | 0.2% | 0.0% | 100.1 | +66.9 |
| vCache | k = 1000 | 0.7% | 78.4% | 0.5% | 0.1% | 0.7% | 0.0% | 99.6 | +85.1 |
| vCache | no budget | 37.1% | 59.5% | 22.1% | 15.0% | 20.8% | 0.0% | 114.3 | +111.9 |
| Joint-state threshold | k = 100 | 1.1% | 85.8% | 1.0% | 0.2% | 0.4% | 24.2% | 99.8 | +22.5 |
| Joint-state threshold | k = 200 | 2.0% | 90.4% | 1.8% | 0.2% | 0.6% | 13.2% | 99.8 | +38.4 |
| Joint-state threshold | k = 300 | 5.6% | 77.7% | 4.4% | 1.3% | 3.3% | 35.4% | 98.7 | +49.5 |
| Joint-state threshold | k = 500 | 7.8% | 81.3% | 6.3% | 1.5% | 4.2% | 25.5% | 98.4 | +65.1 |
| Joint-state threshold | k = 1000 | 12.2% | 83.5% | 10.2% | 2.0% | 6.0% | 15.4% | 97.7 | +83.2 |
| Joint-state threshold | no budget | 61.8% | 52.8% | 32.6% | 29.2% | 36.2% | 10.4% | 129.8 | +127.5 |
| Single-turn (CUCB-SC-Cont) | k = 100 | 0.1% | 100.0% | 0.1% | 0.0% | 0.1% | 0.0% | 99.9 | +22.6 |
| Single-turn (CUCB-SC-Cont) | k = 200 | 0.6% | 82.1% | 0.5% | 0.1% | 0.8% | 0.0% | 99.4 | +38.0 |
| Single-turn (CUCB-SC-Cont) | k = 300 | 0.7% | 84.6% | 0.6% | 0.1% | 0.9% | 0.0% | 99.3 | +50.0 |
| Single-turn (CUCB-SC-Cont) | k = 500 | 1.8% | 79.3% | 1.5% | 0.4% | 1.4% | 0.0% | 99.3 | +66.1 |
| Single-turn (CUCB-SC-Cont) | k = 1000 | 3.4% | 84.7% | 2.9% | 0.5% | 2.0% | 0.0% | 99.0 | +84.5 |
| Single-turn (CUCB-SC-Cont) | no budget | 13.1% | 89.1% | 11.7% | 1.4% | 5.6% | 0.0% | 97.2 | +94.9 |

Figure 9. SocraTeach offline: test loss versus the price of an unacceptable reuse, with every method tuned on validation at each price. Dotted: CUCB-SC-MT as specified (); dashed: best -entry cache in hindsight.
Table 11. Taskmaster-3 online: loss in each quarter of the stream (% of that quarter's no-cache cost) and its change from the first to the last quarter.
| Method | Budget | Q1 | Q2 | Q3 | Q4 | Q4 – Q1 (pp) |
|---|---|---|---|---|---|---|
| CLCB-LS-MT | k = 100 | 81.6 | 73.5 | 72.5 | 72.5 | -9.1 |
| ContextCache | k = 100 | 108.4 | 109.5 | 109.1 | 109.8 | +1.4 |
| ElastiCache-MT | k = 100 | 99.1 | 99.5 | 98.2 | 99.2 | +0.1 |
| vCache | k = 100 | 100.1 | 100.4 | 100.0 | 99.8 | -0.2 |
| Joint-state threshold | k = 100 | 99.9 | 99.7 | 99.9 | 99.6 | -0.3 |
| Single-turn (CUCB-SC-Cont) | k = 100 | 102.0 | 102.2 | 102.0 | 101.5 | -0.5 |
| CLCB-LS-MT | k = 200 | 80.3 | 72.8 | 71.4 | 72.0 | -8.2 |
| ContextCache | k = 200 | 100.0 | 102.7 | 100.6 | 100.9 | +0.9 |
| ElastiCache-MT | k = 200 | 95.6 | 95.9 | 94.9 | 95.8 | +0.2 |
| vCache | k = 200 | 99.7 | 99.6 | 99.6 | 99.3 | -0.4 |
| Joint-state threshold | k = 200 | 100.3 | 100.5 | 100.4 | 100.2 | -0.2 |
| Single-turn (CUCB-SC-Cont) | k = 200 | 102.1 | 104.0 | 103.4 | 101.8 | -0.3 |
| CLCB-LS-MT | k = 300 | 79.4 | 72.9 | 71.1 | 71.2 | -8.2 |
| ContextCache | k = 300 | 100.3 | 101.2 | 99.3 | 100.0 | -0.3 |
| ElastiCache-MT | k = 300 | 93.0 | 92.7 | 91.6 | 94.4 | +1.4 |
| vCache | k = 300 | 100.0 | 99.2 | 96.9 | 99.1 | -0.9 |
| Joint-state threshold | k = 300 | 100.0 | 100.2 | 100.3 | 100.1 | +0.1 |
| Single-turn (CUCB-SC-Cont) | k = 300 | 102.3 | 102.3 | 102.2 | 101.7 | -0.6 |
| CLCB-LS-MT | k = 500 | 78.7 | 71.9 | 70.7 | 70.8 | -7.9 |
| ContextCache | k = 500 | 99.9 | 99.9 | 99.5 | 98.5 | -1.3 |
| ElastiCache-MT | k = 500 | 90.6 | 89.9 | 89.0 | 91.2 | +0.7 |
| vCache | k = 500 | 95.7 | 92.8 | 93.6 | 93.7 | -2.0 |
| Joint-state threshold | k = 500 | 100.1 | 100.1 | 100.1 | 100.1 | +0.0 |
| Single-turn (CUCB-SC-Cont) | k = 500 | 100.2 | 100.1 | 100.2 | 100.1 | -0.1 |
| CLCB-LS-MT | k = 1000 | 80.3 | 72.0 | 70.2 | 71.7 | -8.6 |
| ContextCache | k = 1000 | 97.6 | 96.2 | 97.0 | 98.0 | +0.3 |
| ElastiCache-MT | k = 1000 | 86.0 | 84.0 | 84.0 | 85.9 | -0.0 |
| vCache | k = 1000 | 93.0 | 89.1 | 89.1 | 90.4 | -2.6 |
| Joint-state threshold | k = 1000 | 99.2 | 99.9 | 99.6 | 99.7 | +0.5 |
| Single-turn (CUCB-SC-Cont) | k = 1000 | 102.5 | 102.3 | 102.3 | 102.0 | -0.4 |
| CLCB-LS-MT | no budget | 80.8 | 73.1 | 70.5 | 72.0 | -8.8 |
| ContextCache | no budget | 95.7 | 94.3 | 93.4 | 95.0 | -0.8 |
| ElastiCache-MT | no budget | 84.1 | 80.9 | 80.8 | 81.8 | -2.3 |
| vCache | no budget | 92.3 | 86.3 | 85.8 | 84.8 | -7.4 |
| Joint-state threshold | no budget | 99.0 | 97.2 | 98.1 | 96.2 | -2.8 |
| Single-turn (CUCB-SC-Cont) | no budget | 102.5 | 102.6 | 102.4 | 102.1 | -0.4 |
Table 12. SocraTeach online: loss in each quarter of the stream (% of that quarter's no-cache cost) and its change from the first to the last quarter.
| Method | Budget | Q1 | Q2 | Q3 | Q4 | Q4 – Q1 (pp) |
|---|---|---|---|---|---|---|
| CLCB-LS-MT | k = 100 | 87.4 | 80.3 | 83.4 | 79.9 | -7.5 |
| ContextCache | k = 100 | 86.8 | 83.8 | 87.0 | 82.9 | -3.9 |
| ElastiCache-MT | k = 100 | 99.7 | 100.7 | 100.5 | 100.2 | +0.4 |
| vCache | k = 100 | 100.2 | 100.1 | 100.1 | 99.9 | -0.3 |
| Joint-state threshold | k = 100 | 100.0 | 99.6 | 99.7 | 99.9 | -0.1 |
| Single-turn (CUCB-SC-Cont) | k = 100 | 99.8 | 100.0 | 100.0 | 99.9 | +0.1 |
| CLCB-LS-MT | k = 200 | 86.6 | 76.8 | 78.0 | 78.4 | -8.2 |
| ContextCache | k = 200 | 86.7 | 83.4 | 87.1 | 83.3 | -3.4 |
| ElastiCache-MT | k = 200 | 99.8 | 100.1 | 100.2 | 100.0 | +0.2 |
| vCache | k = 200 | 100.3 | 100.3 | 100.4 | 100.0 | -0.3 |
| Joint-state threshold | k = 200 | 100.0 | 99.3 | 99.6 | 100.1 | +0.1 |
| Single-turn (CUCB-SC-Cont) | k = 200 | 99.5 | 99.6 | 99.3 | 99.1 | -0.4 |
| CLCB-LS-MT | k = 300 | 85.6 | 76.7 | 77.8 | 75.5 | -10.1 |
| ContextCache | k = 300 | 97.3 | 96.5 | 97.5 | 97.2 | -0.1 |
| ElastiCache-MT | k = 300 | 99.8 | 100.1 | 100.3 | 99.9 | +0.1 |
| vCache | k = 300 | 100.1 | 100.3 | 100.3 | 99.9 | -0.2 |
| Joint-state threshold | k = 300 | 99.4 | 98.3 | 98.6 | 98.8 | -0.6 |
| Single-turn (CUCB-SC-Cont) | k = 300 | 99.5 | 99.5 | 99.1 | 99.0 | -0.5 |
| CLCB-LS-MT | k = 500 | 85.6 | 75.2 | 74.8 | 72.6 | -13.1 |
| ContextCache | k = 500 | 87.0 | 83.7 | 87.1 | 83.0 | -4.1 |
| ElastiCache-MT | k = 500 | 99.7 | 100.3 | 100.7 | 100.1 | +0.4 |
| vCache | k = 500 | 100.0 | 100.3 | 100.4 | 99.7 | -0.3 |
| Joint-state threshold | k = 500 | 99.5 | 98.0 | 97.8 | 98.0 | -1.5 |
| Single-turn (CUCB-SC-Cont) | k = 500 | 99.8 | 99.2 | 99.4 | 99.0 | -0.8 |
| CLCB-LS-MT | k = 1000 | 84.6 | 75.8 | 72.7 | 71.2 | -13.4 |
| ContextCache | k = 1000 | 86.2 | 83.5 | 87.4 | 84.0 | -2.1 |
| ElastiCache-MT | k = 1000 | 99.8 | 100.0 | 100.7 | 99.8 | +0.0 |
| vCache | k = 1000 | 99.9 | 99.3 | 100.0 | 99.3 | -0.6 |
| Joint-state threshold | k = 1000 | 98.6 | 96.7 | 97.9 | 97.8 | -0.8 |
| Single-turn (CUCB-SC-Cont) | k = 1000 | 99.8 | 98.7 | 98.8 | 98.7 | -1.2 |
| CLCB-LS-MT | no budget | 84.3 | 73.3 | 71.6 | 68.5 | -15.8 |
| ContextCache | no budget | 82.0 | 80.5 | 82.6 | 82.6 | +0.6 |
| ElastiCache-MT | no budget | 165.8 | 150.6 | 156.8 | 145.8 | -20.0 |
| vCache | no budget | 138.3 | 113.4 | 107.4 | 97.9 | -40.5 |
| Joint-state threshold | no budget | 128.3 | 124.2 | 135.5 | 131.6 | +3.2 |
| Single-turn (CUCB-SC-Cont) | no budget | 99.6 | 97.5 | 96.1 | 95.6 | -4.0 |
Table 13. Taskmaster-3 offline: loss at by cache budget (% of the no-cache cost; lower is better), with 95% bootstrap confidence intervals in brackets. These are the values of Figure 3.
| Method | no budget | |||||
|---|---|---|---|---|---|---|
| CUCB-SC-MT | 77.1[72.6, 81.6] | 74.6[69.8, 79.5] | 74.6[69.4, 79.6] | 73.2[68.1, 78.2] | 72.6[67.5, 77.7] | 71.2[65.7, 76.7] |
| ElastiCache-MT | 94.0[91.9, 96.0] | 88.1[84.9, 91.2] | 85.6[81.7, 89.6] | 82.2[76.8, 87.3] | 80.0[74.7, 85.2] | 77.3[71.3, 83.4] |
| ContextCache | 97.3[95.3, 99.2] | 95.4[93.0, 97.5] | 94.6[91.7, 97.3] | 90.3[86.4, 94.0] | 86.3[81.4, 90.7] | 87.2[81.2, 93.0] |
| vCache | 100.2[99.9, 100.8] | 100.3[99.7, 101.0] | 98.7[97.8, 99.6] | 97.9[96.4, 99.2] | 94.4[90.9, 97.8] | 82.7[78.0, 87.4] |
| Joint-state threshold | 100.2[100.0, 100.6] | 100.3[99.7, 101.0] | 100.6[99.7, 101.6] | 98.6[97.1, 100.0] | 98.1[96.0, 100.0] | 93.1[90.0, 96.1] |
| Single-turn | 99.3[98.0, 100.5] | 98.0[95.8, 100.4] | 99.1[97.8, 100.5] | 100.1[99.9, 100.4] | 99.0[97.6, 100.4] | 99.3[97.8, 100.9] |
Table 14. Taskmaster-3 online: loss at by cache budget (% of the no-cache cost; lower is better), with 95% bootstrap confidence intervals in brackets. These are the values of Figure 3.
| Method | no budget | |||||
|---|---|---|---|---|---|---|
| CLCB-LS-MT | 75.0[73.5, 76.4] | 74.1[72.6, 75.6] | 73.6[72.2, 75.1] | 73.0[71.5, 74.5] | 73.5[72.0, 75.0] | 74.1[72.6, 75.5] |
| ContextCache | 109.2[107.9, 110.6] | 101.1[100.1, 102.0] | 100.2[99.1, 101.4] | 99.4[98.1, 100.8] | 97.2[95.7, 98.7] | 94.6[93.0, 96.2] |
| ElastiCache-MT | 99.0[98.0, 99.9] | 95.6[94.3, 96.7] | 92.9[91.6, 94.3] | 90.2[88.6, 91.7] | 85.0[83.4, 86.6] | 81.9[80.0, 83.7] |
| vCache | 100.1[99.9, 100.2] | 99.6[99.4, 99.8] | 98.8[98.5, 99.1] | 93.9[93.2, 94.7] | 90.4[89.2, 91.6] | 87.3[86.1, 88.4] |
| Joint-state threshold | 99.8[99.6, 100.0] | 100.4[100.0, 100.7] | 100.1[99.7, 100.5] | 100.1[99.6, 100.6] | 99.6[99.1, 100.1] | 97.6[96.8, 98.4] |
| Single-turn(CUCB-SC-Cont) | 101.9[101.5, 102.3] | 102.8[102.3, 103.4] | 102.1[101.7, 102.6] | 100.2[100.1, 100.3] | 102.3[101.8, 102.7] | 102.4[102.0, 102.9] |
Table 15. Socrateach offline: loss at by cache budget (% of the no-cache cost; lower is better), with 95% bootstrap confidence intervals in brackets. These are the values of Figure 3.
| Method | no budget | |||||
|---|---|---|---|---|---|---|
| CUCB-SC-MT | 94.3[90.5, 97.7] | 88.1[83.5, 92.8] | 81.6[76.4, 86.6] | 77.9[70.6, 85.4] | 69.1[61.4, 76.8] | 67.3[59.8, 74.9] |
| ElastiCache-MT | 99.9[99.7, 100.0] | 100.0[99.9, 100.0] | 100.0[99.9, 100.0] | 100.0[99.9, 100.0] | 101.0[99.5, 103.0] | 88.0[78.5, 97.7] |
| ContextCache | 99.6[98.6, 100.6] | 99.9[98.7, 101.1] | 100.6[99.6, 102.0] | 98.8[96.7, 101.1] | 97.4[93.9, 100.9] | 87.7[81.4, 93.4] |
| vCache | 100.6[100.0, 101.4] | 100.0[100.0, 100.0] | 100.3[100.0, 101.0] | 100.0[100.0, 100.0] | 99.9[99.6, 100.0] | 93.1[87.7, 98.3] |
| Joint-state threshold | 99.7[99.2, 100.0] | 100.0[99.3, 100.9] | 98.7[97.2, 100.0] | 98.0[96.4, 99.5] | 97.4[94.8, 100.0] | 79.2[70.9, 86.9] |
| Single-turn | 100.6[99.9, 101.5] | 101.0[99.2, 102.9] | 99.1[96.6, 101.6] | 99.2[96.2, 102.0] | 96.2[92.8, 99.4] | 89.5[83.8, 95.0] |
Table 16. Socrateach online: loss at by cache budget (% of the no-cache cost; lower is better), with 95% bootstrap confidence intervals in brackets. These are the values of Figure 3.
| Method | No budget | |||||
|---|---|---|---|---|---|---|
| CLCB-LS-MT | 82.7[81.0, 84.5] | 79.9[78.2, 81.8] | 78.9[77.1, 80.7] | 77.1[75.2, 78.9] | 76.1[74.1, 77.9] | 74.4[72.6, 76.3] |
| ContextCache | 85.1[83.8, 86.4] | 85.1[83.8, 86.4] | 97.1[96.4, 97.8] | 85.2[83.8, 86.5] | 85.3[83.9, 86.7] | 81.9[80.3, 83.7] |
| ElastiCache-MT | 100.3[99.8, 100.7] | 100.0[99.9, 100.2] | 100.0[99.8, 100.2] | 100.2[99.9, 100.5] | 100.1[99.8, 100.4] | 154.7[150.7, 159.0] |
| vCache | 100.1[100.0, 100.2] | 100.2[100.0, 100.5] | 100.2[100.0, 100.4] | 100.1[99.9, 100.3] | 99.6[99.3, 99.9] | 114.3[111.8, 116.9] |
| Joint-state threshold | 99.8[99.6, 100.0] | 99.8[99.5, 100.0] | 98.7[98.1, 99.3] | 98.4[97.7, 99.0] | 97.7[96.9, 98.5] | 129.8[126.8, 133.0] |
| Single-turn(CUCB-SC-Cont) | 99.9[99.8, 100.0] | 99.4[99.1, 99.6] | 99.3[99.0, 99.5] | 99.3[98.9, 99.7] | 99.0[98.6, 99.5] | 97.2[96.5, 98.0] |