LLM Inference Cache Hit Pricing: Why Cached Input Tokens Cost Less
This article breaks down what a price reduction limited to cached input tokens signals about the economics of large language model inference. It explains why prefix caching lowers cost by separating prefill from decode work, presents a cost model based on hit rate, reusable prefix length, and input/output pricing, and lists five categories of reusable prefixes. It also covers a three-tier prompt assembly design, benchmark methods for measuring real hit rates, common mistakes, and an action checklist for reducing cost per successful request.
1. The Signal Behind a Cached-Input Price Cut
A cloud provider’s model-as-a-service platform recently announced a price reduction for one of its large model services in a specific region, effective November 23, 2026, 00:00 (Beijing time). The adjustment applies only to the cached input portion, which drops to 20% of the original price; all other billing items remain unchanged.
The announcement is short, but the technical implication is not: it makes the cost structure of LLM inference more explicit and shifts the optimization focus from “switch to a cheaper model” to “reuse the compute and context you already have.”
This article does not evaluate any specific vendor’s product capabilities, APIs, or billing details. It treats the event as an industry signal: inference pricing is evolving from coarse per-input/per-output token billing toward granular pricing that distinguishes cache hits from misses. What developers and architects need to master is the underlying mechanism and the engineering methods behind it.
2. Why a Cache Hit Can Be Cheaper
LLM inference has two phases: prefill and decode. Prefill runs the entire input through the model in one pass; compute grows roughly linearly with input length and is compute-bound. Decode generates tokens one at a time and is mainly constrained by memory bandwidth.
When multiple requests share the same prefix (an identical system prompt, the same long document, the same few-shot examples, the same tool definitions), the intermediate state of that prefix, commonly called the KV cache, can be reused instead of recomputed. This is the general idea of prefix caching, or context reuse. A cache hit means that compute is skipped, so the cost is naturally lower; the price cut simply reflects that fact in the bill.
An important corollary follows: the cache hit rate is a metric that engineering effort can significantly influence, not an uncontrollable external condition.
3. A Cost Model: Turning the Bill into a Formula
Let a request have $L$ input tokens, of which a reusable prefix of length $Lc$ is shared, with hit rate $h$; the number of hit tokens is roughly $h \cdot L_c$. Let $r$ be the cached-input price as a fraction of the original price (here $r = 0.2$), $p{in}$ the miss input price, $p_{out}$ the output price, and $L_o$ the output length. The cost of a single request can be approximated as:
Cost = (h * Lc * r + (L - h * Lc)) * p_in + Lo * p_out
This formula shows three things:
- Output cost is not covered by this price cut, so controlling $L_o$ remains a hard constraint.
- Raising $h$ and increasing $L_c$ are two levers pulling in the same direction.
- When $r$ is small, the cost of the hit portion is nearly negligible, so the marginal gain comes mainly from moving more tokens into the hit range.
In practice, treat $h$, $L_c$, and average input/output length as first-class metrics in monitoring, alerting, and logging, rather than watching only the total bill.
4. Where Hit Rate Comes From: Five Categories of Reusable Prefixes
- System prompts and role definitions: fixed and never changing, the easiest to reuse, and should be placed first.
- Tool/function definitions and structured output constraints: stable content with non-trivial size, so the payoff is clear.
- Long domain knowledge and specification documents: injected once and queried many times, suitable as a persistent document prefix.
- Few-shot example sets: fixed examples hit more reliably than dynamically retrieved ones.
- Multi-turn conversation history: organize the stable prefix separately from the rolling new content.
The key engineering principle is prefix stability first: anything that changes the prefix at the byte level (timestamps, random IDs, unsorted fields, frequently rotated version numbers) will invalidate the cache.
5. Architecture: Layering and Ordering
Assemble requests in three tiers: a stable tier, a semi-stable tier, and a volatile tier.
[Stable] Role definition + tool definitions + domain specs + fixed examples[Semi-stable] Conversation summary / phase-level context[Volatile] Current user question + dynamic data such as timestamps
Supporting practices include: a single template rendering function, with business code forbidden from assembling prompts on its own; template normalization (sorted keys, whitespace differences removed); splitting long documents into fixed blocks and caching block-level results; and computing prefix fingerprints at the gateway to observe hit behavior. If you use retrieval augmentation, keep retrieved results in the volatile tier so they do not pollute the stable prefix.
6. Verification: Do Not Guess How Much You Saved
Build a repeatable benchmark process:
- Construct a fixed corpus covering three scenarios: long inputs, multi-turn, and tool calls.
- Run load tests under two configurations, reuse on and reuse off, recording average input/output length, time to first token, throughput, and cost.
- Compare the measured hit rate against the theoretical hit rate to locate sources of template instability.
- Use cost per successful request as the gate metric for release.
Illustrative statistics code:
stats = {"hit": 0, "miss": 0, "in": 0, "out": 0}for resp in run_benchmark(cases):u = resp.usagestats["hit"] += u.cached_inputstats["miss"] += u.input - u.cached_inputstats["out"] += u.outputhit_rate = stats["hit"] / max(1, stats["hit"] + stats["miss"])print(hit_rate, stats)
7. Common Mistakes
- Watching unit price but not structure: a lower price does little for the bill if the hit distribution does not change.
- Putting dynamic content first: a single timestamp at the start can invalidate the entire prefix.
- Blindly lengthening context: the miss portion grows linearly with length, which amplifies cost.
- Ignoring output length: when the output side is not discounted, verbose answers eat up the input-side savings.
- Lacking observability: without a hit rate metric, optimization cannot close the loop.
8. Action Checklist
- Audit existing prompt templates, extract the stable prefix, and fix it in place.
- Set up monitoring and alerting for hit rate and average input/output length.
- Run on/off reuse comparison experiments on the benchmark set to quantify the gain.
- Write the three-tier assembly convention into the development process and code review checklist.
- Track changes in billing definitions, but keep the optimization focus on hit rate and output length governance.
Closing note: a price adjustment that cuts only cached input while leaving everything else unchanged is essentially telling developers that the next round of inference cost reduction lies in context reuse and request structure governance, not in unit price negotiation alone.
