Does prompt caching actually reduce agentic LLM costs?
Explores whether prompt caching—reusing computed attention tensors across repeated prompt prefixes—delivers claimed cost and latency gains across major LLM providers, and whether naive implementation strategies backfire.
"Don't Break the Cache" evaluates prompt caching — a provider feature that reuses previously computed key-value (KV) tensors from attention layers so a repeated prompt prefix is not recomputed — across three providers (OpenAI, Anthropic, Google) and four flagship models (GPT-5.2, Claude Sonnet 4.5, Gemini 2.5 Pro, GPT-4o). The evaluation runs on DeepResearch Bench, a multi-turn agentic benchmark where agents autonomously run web-search tool calls to answer research questions, across "over 500 agent sessions with 10,000-token system prompts." The headline result: "prompt caching reduces API costs by 41-80% and improves time to first token (TTFT) by 13-31% across providers," and these savings hold "across all three caching strategies" tested.
The paper compares four cache conditions, each defined by where a UUID is inserted to deliberately break the cache: a No Cache baseline (UUID at the start, forcing full recomputation — standing in for dynamic content like timestamps injected into a system prompt at inference time); Full Context Caching (no UUIDs, letting the provider's automatic caching run unmanaged); System Prompt Only Caching (UUID after the system prompt, so only the static instructions are cached); and Exclude Tool Results Caching (UUIDs after the system prompt and after every tool result). The paradox it surfaces: "naively enabling full-context caching can paradoxically increase latency," because providers "automatically trigger cache creation when token thresholds are exceeded," which caches dynamic, session-specific tool results that will never be read again — cache-write overhead with no matching cache-read benefit. System Prompt Only Caching "provides the most consistent benefits across both cost and latency dimensions," and "the cache strategy that maximizes cost savings does not always maximize latency improvement."
This sits in productive tension with Do persistent agents really cost less per token?, which observed 82.9% cache-read tokens in one physician-scientist's 115-day agentic workflow and inferred that persistent, cache-dominant agents should be costed per artifact rather than per token. That note is a single observational case study with no controlled comparison; this paper supplies the missing controlled measurement — a specific, provider-compared range (41-80% cost, 13-31% TTFT) and the caveat that caching has to be managed, not merely turned on, or its benefit can invert. Both agree that the cache, not the raw token count, is now the economically load-bearing layer of a persistent agent, a point also implicit in how Can external state caches let models solve harder problems? treats the cache hierarchy as engineered harness infrastructure rather than a transparent provider default.
The evaluation is bounded to one benchmark (DeepResearch Bench), one system-prompt size (10,000 tokens), and research/web-search agentic tasks — it does not establish that the same 41-80%/13-31% ranges hold for coding agents, customer-support agents, or other tool-call profiles, and the excerpt notes "provider-specific strategy discrepancies" from an ablation (500-50,000 token prompts, 3-50 tool calls) without detailing what those discrepancies are. The implication the evidence does support: caching strategy is a parameter to tune per provider and per workload, not a single switch to flip, and a team that enables full-context caching by default without checking its latency effect is working against the paper's own central finding.
Inquiring lines that read this note 16
This note is a source for these research framings, grouped by the broader line of inquiry each explores. Scan the bold lines of inquiry; follow any specific question forward.
When does routing outperform scaling as a performance solution? How does explicit structure improve LLM reasoning on complex tasks?- How do latency and reliability trade off against price in real LLM adoption decisions?
- When would OS paging techniques actually harm rather than help LLM serving performance?
- How does data residency constraint change the economics of self hosted LLMs?
- How does block-wise KV cache pruning differ from PagedAttention's packing strategy?
- How does PagedAttention differ from LMCache in solving KV cache memory limits?
- Can KV cache offloading generalize beyond vLLM and SGLang inference engines?
- What latency tradeoffs emerge when moving KV cache between GPU and CPU storage?
- What storage hardware conditions are needed for offloading to reduce latency?
- Why do long-context inputs truncated for relevance lose cache reuse benefits?
- Why does context pruning and tool summarization break cached prompt representations?
- Do cache benefits hold with different system prompt sizes and tool counts?
- Which caching strategy works best for coding agents and support tasks?
Related concepts in this collection 3
This note in its neighbourhood — explore the map, then jump to a related concept in the list below.
Click a node to walk · click center to open · click Open in graph to see this note in the full knowledge graph
-
Do persistent agents really cost less per token?
When AI agents reuse cached context across tasks, does the standard cost-per-token metric still reveal true economic efficiency? A case study suggests the answer may be no.
contrast: that case study observed cache-dominant token flow without a controlled comparison; this paper supplies the quantified, provider-compared savings and the latency caveat
-
Can external state caches let models solve harder problems?
Explores whether organizing model state across weights, context, persistent memory, and disk—rather than relying only on weights and tokens—expands what models can do. Matters because long-horizon tasks may need more state than a model can hold internally.
both treat the cache as engineered harness infrastructure that must be deliberately managed, not a transparent provider default
-
Does dynamic tool discovery break prompt caching benefits?
When agentic systems discover tools dynamically through protocols like MCP, does the changing tool set invalidate cached prompt prefixes? Understanding this matters for cost-conscious production workflows.
sibling note: the same paper's second mechanism for why agentic tool-calling architecture, not just prompt content, determines cache yield
Related papers in this collection 8
Papers most semantically related to this note, ranked by cosine similarity in the embedding space.
- Don't Break the Cache: An Evaluation of Prompt Caching for Long-Horizon Agentic Tasks
- LMCache: An Efficient KV Cache Layer for Enterprise-Scale LLM Inference
- Persistent AI Agents in Academic Research: A Single-Investigator Implementation Case Study
- Toward Efficient Agents: A Survey of Memory, Tool Learning, and Planning
- Small Language Models are the Future of Agentic AI
- MiniMax Sparse Attention
- Know It, Act on It: Investigating Memory Utilization in LLM Personalization
- Towards a Science of Scaling Agent Systems
Original note title
prompt caching cuts agentic LLM API costs 41 to 80 percent but naive full-context caching can increase latency