LLM Inference Cost Optimization: A Practical Guide to Model Selection
This guide explains why models with similar benchmark scores can produce very different bills, and how token usage—not just price per token—drives real spending. It walks through comparison experiments, shows how mid-tier models can replace flagship ones, and offers an actionable cost-control checklist covering reasoning effort, input compression, output limits, usage monitoring, and caching. It also proposes "cost per unit of effective output" as the core selection metric.
1. The Starting Point: Why “Similar Capability” Doesn’t Mean “Similar Cost”
A recurring pattern in enterprise LLM adoption is that two models may differ by only a few points on public benchmarks, yet their actual bills can differ by several times. Many teams focus only on the price sheet during selection and overlook the variable that truly drives spending: the total number of tokens consumed to complete the same task.
To understand this, start with the basic billing model. Mainstream LLM services generally charge by token. A token can be roughly understood as the smallest fragment after text is split; a single Chinese character or a fragment of an English word may correspond to one or more tokens. The cost of a request has two parts: what you send is input tokens, and what the model generates is output tokens. The final bill equals the input price multiplied by the input volume, plus the output price multiplied by the output volume.
The key point is that the unit price is only a coefficient in the formula; usage is the variable. Whether the model performs long-chain reasoning before answering, repeatedly self-checks, or produces a verbose final output can multiply usage several times over. So “the more it thinks and the longer it writes, the higher the bill” is not a figure of speech but a direct result of the billing mechanism.
2. Same Price, Different Cost: What a Typical Comparison Shows
Consider a comparison scenario: a new-generation model has an input price of $8 per million tokens and an output price of $40 per million tokens, about a 20% drop from the previous generation and exactly matching the list price of another model in the same tier.
Using the same set of comprehensive test questions with the highest reasoning setting enabled, a third-party evaluation agency found that the benchmark model scored 65 and ranked first, while the tested model scored 62 and ranked second. The score gap was only 3 points, but the cost structure was completely reversed: the benchmark model cost an average of $26.54 per question, while the tested model cost $4 per question, about one-seventh of the former.
Since both had the same list price, this sevenfold difference came almost entirely from token usage differences—the tested model used significantly fewer reasoning steps and shorter outputs on the same tasks. This conclusion is valuable in engineering terms: cost optimization does not necessarily depend on price negotiations; the model’s “expression efficiency” is itself an optimizable resource.
Now consider a scenario closer to real business. An independent development team used the same prompt to have multiple models each generate a 3D scene of “a lighthouse on a stormy sea.” The tested model tied for first place with the benchmark model, but the former cost $2.92 while the latter cost $19.25, with a several-fold difference in wait time as well. This shows that in generative, multi-step tasks, cost gaps not only exist but are further amplified by task complexity.
3. Mid-Tier Replacing Flagship: The Architectural Opportunity from Capability Parity
Within the same product line, a smaller-tier model is typically priced at only one-quarter of the flagship tier. If a mid-tier model scores 57 on a comprehensive benchmark, matching the previous-generation flagship from just over two months ago, at a cost of only $1.01 per question, the direct takeaway is that output quality once available only at flagship prices can now be covered by a low-cost tier.
The implication for architecture is a clear tiered routing strategy: classify requests by difficulty, send simple requests to the smaller tier, and escalate complex requests.
# Example: tiered routing based on task complexitydef route(prompt: str, need_reasoning: bool) -> str:if need_reasoning or len(prompt) > 4000:return "flagship" # complex reasoning tasksreturn "mid_tier" # routine tasks, about 1/4 the cost of flagship
4. An Actionable Cost Governance Checklist
- Control the reasoning setting. The highest reasoning tier is not the default; it should be decided by the accuracy gains per task, and most business requests do not need it enabled.
- Compress input. In retrieval-augmented scenarios, rerank and deduplicate fragments first, and avoid stuffing an entire document into the context.
- Constrain output. Use structured output and length limits to reduce ineffective generation.
- Establish usage observability. With logging services and monitoring and alerting systems, track the distribution of input and output tokens by business line to locate abnormal consumption.
- Cache and reuse. Build result caches for high-frequency repeated requests, and combine object storage with message queues for asynchronous batch processing.
5. A Selection Methodology
It is recommended to replace “unit price” with “cost per unit of effective output” as the core metric—that is, on a fixed evaluation set and fixed business samples, calculate the total cost required to complete the task. During evaluation, keep the reasoning setting, prompts, and scoring criteria consistent, and record elapsed time as well, because wait time is also a user experience cost. If an enterprise uses model services from platforms such as Baidu AI Cloud, it can feed these metrics into existing monitoring, alerting, and logging services to form a sustainable cost dashboard, turning selection from a one-time decision into a process of continuous calibration.
