LLM Tiered Pricing and Cache Hit Optimization: A Practical Guide
This guide explains how tiered LLM pricing works and why cache hit rates are the real cost lever. It breaks down the four billing dimensions, shows how prefix caching turns repeated computation into lookups, and offers a decision method for choosing between lightweight and high-performance tiers. You will also find a reusable cost formula, four common pitfalls to avoid, and a practical rollout checklist. The goal is to turn lower per-token prices into a genuinely lower bill.
1. The Problem: How a 100x Price Gap Appears
A general-purpose LLM service recently launched two tiered versions and opened their weights at the same time, which sparked a lot of discussion. What deserves developers’ attention is not that one version is “cheap,” but the structure of the price gap. The lightweight version’s output price is about RMB 2 per million tokens, while a comparable overseas flagship model’s output price is roughly over RMB 200, a difference of two orders of magnitude. Within the same service, the output price of the lightweight version and the high-performance version differs by about 12x.
Looking at these two sets of numbers together leads to a more important conclusion: LLM inference has moved from a “single tier, uniform price” model to a stage of “tiered by capability, billed by invocation pattern.” Price is no longer a proxy for model quality; it is an input variable for architecture decisions.
2. Breaking Price Down into Cost: Four Billing Dimensions
To use tiered pricing rationally, you first need to break down the bill. LLM billing in the industry is typically composed of four dimensions:
- Input tokens (cache miss): billed at full price;
- Input tokens (cache hit): a significant discount, commonly one-fifth to one-twelfth of the full price;
- Output tokens: usually higher than input, because the generation stage is token-by-token autoregressive and has higher compute density;
- Add-on capabilities: long context, batch/async, fine-tuning and hosting, generally priced separately.
Take the two tiers in this discussion as an example: the lightweight version has input at RMB 1, cache hit at RMB 0.2, and output at RMB 2; the high-performance version has input at RMB 12, cache hit at RMB 1, and output at RMB 24. Note two details: first, the high-performance version’s cache discount is more aggressive (about one-twelfth), indicating the vendor is more eager to shift the load of high-frequency repeated prefixes from “recomputation” to “table lookup”; second, the output-to-input price ratio stays consistent across both tiers (about 2:1), which means the focus of cost optimization should be on “reducing generation length” and “increasing prefix reuse rate,” rather than simply picking the cheaper tier.
3. Why the Cache Hit Discount Is the Real Lever
The general principle of prefix caching is to retain the intermediate state (KV cache) corresponding to a completely identical token prefix in a request, so that subsequent requests that hit it skip that prefill computation. It holds only when the prefix is token-for-token identical. Therefore, system prompts, tool definitions, few-shot examples, and long document bodies can be reused as long as they are placed at the very front of the prompt and kept stable.
An illustrative way to organize a request:
[Stable prefix] System instructions + tool schema + domain knowledge + few-shot examples ← Goal: high hit rate[Variable part] Current user input, retrieved snippets, timestamps, etc. ← The later, the better
Engineering this requires three things: first, remove volatile content (time, random IDs, user nicknames) from the prefix or move it to the back; second, keep the prefix length within a reasonable range, since overly long prefixes raise the cost of a single miss; third, observe the hit rate through monitoring, alerting, and logging services rather than relying on intuition.
4. A Decision Method for Tier Selection
Do not choose by “expensive/cheap”; choose by task characteristics. You can use the following decision order:
- Is the task fault-tolerant: tasks with high fault tolerance such as classification, extraction, format conversion, and summary drafts should prefer the lightweight tier;
- Does it require long-chain reasoning: multi-step math, complex code refactoring, and cross-section reasoning over long documents go to the high-performance tier;
- Call volume: high-concurrency, short-output scenarios are extremely sensitive to unit price, and the lightweight tier’s benefit is amplified;
- Can it be asynchronous: offline batch processing can use async/batch channels to further dilute cost.
A practical approach is “routing + fallback”: first process all requests with the lightweight tier, then escalate samples with low confidence or that fail validation to the high-performance tier, forming a two-stage pipeline.
def route(prompt, ctx):r = light_model(prompt, ctx) # Run the low-cost tier firstif r.confidence < 0.75 or not schema_ok(r):return pro_model(prompt, ctx) # Escalate hard casesreturn r
5. Cost Estimation: A Reusable Formula
Let input be I and output be O (in millions of tokens), the miss input unit price be Pi, the hit unit price be Pc, the output unit price be Po, and the hit rate be h. Then:
Cost per call = I*(1-h)*Pi + I*h*Pc + O*Po
Plugging in the lightweight tier (Pi=1, Pc=0.2, Po=2), with I=1, O=0.5, h=0.8:
0.2*1 + 0.8*0.2 + 0.5*2 = 1.36 RMB per million request-level units
The same load on the high-performance tier (Pi=12, Pc=1, Po=24) is about RMB 14.8, with the gap coming mainly from the input and output unit prices. The value of this model is that it turns “whether to optimize” into a computable question of “how much can be saved by raising the hit rate from 0.5 to 0.8.”
6. Four Pitfalls to Avoid
- Runaway output: the output unit price is usually twice the input, and verbose answers do the most damage to the bill, so explicitly limit max tokens and require structured short output;
- Prefix drift: embedding timestamps or random strings in the template invalidates the entire cache;
- Over-downgrading: if the lightweight tier repeatedly fails on long-chain reasoning, retry costs may exceed directly using the high-performance tier;
- Counting only tokens, not engineering: caching, routing, evaluation, and observability all require investment and should be included in the total account.
7. Rollout Checklist
- Build a task tiering table, labeling each task type’s fault tolerance and latency requirements;
- Unify prompt templates, move stable content to the front, and version-control them;
- Use logging and monitoring systems to track three metrics: hit rate, average output length, and escalation rate;
- Recompute cost weekly using the formula above, and adjust routing thresholds accordingly.
In the practice of model services on platforms such as Baidu AI Cloud, the above methods apply equally: tier first, cache second, route third, and form a closed loop with monitoring and alerting, so that “lower unit prices” truly translate into a “lower bill.”
