LLM Inference Cost Optimization: How Cache Hit Billing Cuts Input Prices to 20%
This article examines a recent price adjustment in which a cloud provider's MaaS platform reduced the input price for cache-hit requests to 20% of the original rate. It explains how prefix caching (prompt caching) works, the billing structure behind it, the strict conditions under which a cache hit occurs, and how enterprises can restructure prompts, design cache-friendly multi-turn conversations, aggregate traffic, and build cost observability to capture the savings. The key takeaway: cache-tiered billing is becoming a standard feature of inference services, and a cache-friendly architecture delivers portable, platform-independent cost advantages.
LLM Inference Cost Optimization: A Full Breakdown of Cache Hit Billing
1. Background: A Price Signal from the Model-as-a-Service Platform
A cloud provider’s model-as-a-service (MaaS) platform recently announced a price adjustment for one of its large language model inference services: starting from a specified date, for that model deployed in a particular region, the input (Input) price for cache hits is set to 20% of the original price, while other components (such as input on cache misses, output, and reasoning tokens) remain unchanged.
On the surface this looks like a routine commercial move, but it reflects an industry-level technical trend: Prefix Caching (prompt caching) has moved from an experimental optimization to large-scale commercial use, and it now directly affects the structure of enterprise inference bills. Understanding the technical meaning of this price cut is more valuable than memorizing the size of the discount.
For developers, this raises a direct question: how should you adjust your application architecture and calling patterns to capture as much of the cache-hit price benefit as possible? This article addresses that question.
2. What Cache Hit Billing Means: Starting from the Billing Model
2.1 The Basic Billing Structure of LLM Inference
Mainstream LLM API billing is typically calculated by token count and usually split into:
- Input tokens: the prompt sent to the model in the request, including system prompts, context, conversation history, retrieved content, and so on;
- Output tokens: the content generated by the model;
- Some services further distinguish between “cache-hit input” and “cache-miss input” at different rates.
In many real business scenarios—especially RAG, long system prompts, and multi-turn conversations—input tokens make up a very high proportion, sometimes several times to tens of times the output tokens. As a result, a price cut on the input side often has a larger impact on total cost than the headline percentage suggests.
2.2 How Prompt Caching Works
LLM inference generates output autoregressively, token by token, but processing the input prompt requires a Prefill computation. If the prompt prefix of two requests is exactly the same, the intermediate Prefill results (the KV Cache, i.e., the Key/Value cache in the attention mechanism) can in principle be reused instead of recomputed.
This is the core idea of Prefix Caching:
Request A: [system prompt 2000 tokens] + [user question 50 tokens]Request B: [system prompt 2000 tokens] + [user question 80 tokens]↑Prefixes are identical, cache hit, only the difference is computed
When Request B arrives, the platform detects that its prefix matches a recently computed request and can directly reuse the existing KV Cache, running Prefill only on the new portion. This yields two benefits:
- Compute savings: skipping duplicate Prefill computation and reducing GPU usage;
- Lower latency: significantly shorter time to first token (TTFT), especially for long-prompt scenarios.
It is precisely because the platform saves real cost that there is room to pass part of that benefit on to users. Reducing the cache-hit input price to 20% is essentially converting a technical dividend into a price dividend.
2.3 When a Cache Hit Occurs and When It Does Not
Note that cache hits have strict matching conditions, typically including:
- The prefix must be exactly identical: matching is done token by token from the very first token; once a difference appears, the portion before the difference is valid while the portion after it cannot hit the cache;
- The prefix must be long enough: most services require the matched portion to reach a minimum token-length threshold; a common prefix that is too short is not counted as a cache hit;
- The cache is time-sensitive: the KV Cache can be evicted by recent requests, so if the interval between two requests is too long, the cache may already have been dropped;
- Region isolation: the cache is usually effective only within a single deployment region, and cross-region requests cannot share it.
This explains why this price cut is explicitly limited to a specific region: different regions are independent compute and cache pools, so their pricing strategies may naturally differ.
3. How Enterprises Can Use Cache Billing to Optimize Cost Architecture
3.1 Restructure the Prompt: Put the “Unchanged” Parts First
Since caching matches on the prefix, the first principle of application design is: put stable, unchanging content at the very front of the prompt and variable content at the end.
A typical before-and-after comparison:
# Before: variable content is interleaved at the front, cache almost certainly missesprompt = f"Hello user {name}, please answer according to the following guidelines: {guidelines_doc}..."# After: stable prefix first, variable content lastSYSTEM_PROMPT = "Please answer strictly according to the following guidelines: ...{guidelines_doc}..." # fixed and unchanginguser_input = f"{name}'s question: ..."messages = [{"role": "system", "content": SYSTEM_PROMPT},{"role": "user", "content": user_input}]
For RAG scenarios, the recommended order is: system instructions → retrieval template description → (potentially changing) retrieved content → user question. If the retrieved content differs every time, consider moving stable descriptions such as “retrieval result summarization rules” to the front.
3.2 Cache-Friendly Design for Multi-Turn Conversations
Multi-turn conversations are one of the scenarios with the highest cache benefit. The conversation history is a naturally growing prefix, so as long as you:
- do not dynamically rewrite history messages on each request;
- keep the wording of the system prompt fixed (place dynamic fields such as version numbers and dates carefully);
- avoid inserting random IDs or timestamps into the history;
then every subsequent request can hit the prefix cache for all prior history, and input costs drop substantially.
3.3 Traffic Scheduling and Request Aggregation
Because the cache is time-sensitive, “gathering” similar requests closer together in time can significantly improve the hit rate:
- for batch tasks that use the same large prompt template, avoid sending them sparsely over a long time window; process them in a concentrated way through a task queue;
- for scenarios such as A/B testing that require multiple prompt variants, make the common portion as long as possible;
- if the business is deployed in a single region, deploy the application-side service in the same region as the model service, which both reduces network latency and ensures cache hits.
3.4 Build a Cost Observability System
After a price adjustment, what enterprises should focus on is not the unit price but the effective unit price:
Effective input unit price = (hit tokens × hit price + miss tokens × original price) / total input tokens
It is advisable to instrument the calling side to record the number of cache-hit tokens returned in each response (for example, via the usage fields the platform provides), and break down the cache hit rate by application, by template, and by tenant, continuously monitoring the effect of optimizations. Under the condition that “the hit price is 20% of the original price,” every 10-percentage-point increase in the hit rate reduces input-side cost by about 8%, and the cumulative effect is considerable.
4. A Rational View of the Price Cut: More Than Saving Money, a Signal About Architecture
4.1 Cost Optimization Is Systems Engineering
A single price cut solves the “unit price” problem, but enterprise inference cost governance is systems engineering that includes model selection, prompt design, caching strategy, batch scheduling, and elastic scaling. The value of a cache-friendly architecture is that it does not depend on any single platform’s pricing strategy; it is based on general principles of the inference engine and is portable across platforms.
4.2 Evaluating Migration and Deployment Strategy
When choosing where to deploy a model service, enterprises can weigh the following general dimensions:
- Regional price and caching policy differences: billing structures may differ across regions and instance types, so evaluate them against your own traffic distribution;
- Service level and stability: beyond price, availability commitments, rate-limiting policies, and concurrency capacity are also part of cost (failed retries are a cost too);
- Data compliance requirements: cross-region calls must meet data residency requirements.
4.3 A View on Future Trends
From the general industry trend, as inference frameworks mature in their support for Prefix Caching, Continuous Batching, speculative decoding, and other techniques, the unit cost of LLM inference still has room to keep falling. “Cache-tiered billing” is very likely to become a standard configuration for inference services. Enterprises that complete prompt-structure governance and cost observability early will automatically benefit from every round of price adjustments.
5. Summary
This cloud provider’s move to set the cache-hit input price at 20% of the original is a typical case of the chain “technical progress → cost reduction → price benefit passed on.” For developers and enterprise users, the right response is:
- Understand the mechanism: master the matching rules and billing logic of prefix caching;
- Rework the architecture: put stable content first, keep conversation history immutable, and aggregate traffic appropriately;
- Quantify and monitor: build a closed loop for observing the cache hit rate and the effective unit price;
- Take a long-term view: incorporate cost governance into architecture design rather than fixing it after the fact.
Prices will fluctuate, but the engineering logic of “paying less for reusable computation” is stable. Whoever designs their application to be more “cache-friendly” will sustain a cost advantage in the era of large-scale inference.
