Evaluating LLM Cost-Performance: Four Key Dimensions
As per-token pricing gives way to cost-based billing, simple price comparisons fail. This article redefines cost-performance as effective task output divided by end-to-end total cost, and breaks evaluation into four weighted dimensions: task success rate, cost per task, latency and stability, and engineering fit. It also presents a reproducible micro-benchmark based on an auto-verifiable interactive task, a cost accounting table for attributing expenses, common evaluation pitfalls, and practical recommendations for building internal baselines and tiered routing.
1. The Problem: Why “Price per Million Tokens” Is No Longer Enough
The core issue here is not the ranking of a few specific models, but a more fundamental engineering problem: once inference pricing shifts from subsidized discounts back to cost-based rates, the unit-price comparison tables developers relied on quickly become useless. For the same task, different models may consume a total number of tokens that differs by an order of magnitude. Cache hit rates vary, reasoning effort settings vary, and the number of tool-calling rounds varies, so the final bill can differ far more than the unit prices suggest.
Cost-performance therefore needs to be redefined as a ratio:
Cost-performance = effective task output / end-to-end total cost
The numerator is not “how many words were generated,” but the number of tasks that pass acceptance criteria. The denominator is not just the model invocation fee; it also includes retries, manual rework, and deployment and operations overhead. This definition moves the discussion away from the “price sheet” and back to “cost per unit of effective output,” and it is the foundation for all the methodology that follows.
2. Evaluation Framework: Four Dimensions and Suggested Weights
2.1 Task Success Rate (suggested weight 0.4)
This is the proportion of tasks for which the model produces a runnable, acceptance-ready result in a single pass given a prompt. Evaluation should distinguish three levels: syntactically runnable, functionally matching requirements, and deliverable without manual modification. Most teams’ hidden costs concentrate at the third level.
2.2 Cost per Task (suggested weight 0.3)
The measurement is the total cost consumed to complete one task that passes acceptance, not the price of a single request. The calculation is:
cost per task = (input tokens × input price + output tokens × output price+ cached tokens × cache price) × retry count + fixed overhead
2.3 Latency and Stability (suggested weight 0.2)
This includes time to first token, overall completion time, performance degradation under long context, and whether rate limiting or timeouts occur under high concurrency. Interactive scenarios are sensitive to first-token latency, while batch scenarios care more about throughput.
2.4 Engineering Fit (suggested weight 0.1)
This covers adherence to structured output, long-context consistency, tool-calling and multi-turn rewriting ability, the cost of migrating prompts, and how easily the model can integrate with common cloud capabilities such as logging, monitoring, and alerting.
3. A Reproducible Micro-Benchmark: A Small Interactive Task as the Yardstick
The most valuable methodology in the original material is to use a small task with clear boundaries and automatic acceptance as a “yardstick,” rather than relying on subjective impressions. Here is an abstracted equivalent design: a market microstructure sandbox.
The task requires the model to produce an interactive single-page application: the user plays a strategist who bids alongside a group of virtual participants that follow fixed behavioral models. The scenario must support three types of operational objectives: pushing the price above a specified level before the close, accumulating a target quantity in batches below the average price line, and distributing a large position without breaking the price. The virtual participant parameters are configurable, and pure random-noise traders can also be mixed in.
The acceptance script can be fully automated, as sketched below:
checks = {"build_pass": lambda r: r.exit_code == 0,"ui_render": lambda p: has_canvas(p) and has_control_panel(p),"simulate": lambda p: run_headless(p, rounds=200) is not None,"objective_close": lambda m: m.close_above_strike,"objective_accumulate": lambda m: m.bought >= 5000 and m.vwap_gap < 0,"objective_distribute": lambda m: m.sold_block and not m.price_cracked,}score = sum(f(report) for f in checks.values()) / len(checks)
The advantages of this design are: the requirements are specific enough to avoid subjective arguments about whether it is “written well”; the results can be judged automatically, which makes batch regression easy; and it covers four capability areas—UI rendering, state machines, numerical computation, and interaction control—giving good discrimination.
It is worth emphasizing that evaluation should be “one prompt, one pass,” meaning no follow-up clarifications are added, in order to measure the model’s ability to infer implicit requirements. Multi-turn iteration can improve the quality of the result, but it shifts cost onto the human communication rounds, which must be reflected in the cost accounting.
4. Cost Accounting: Breaking the Bill into Attributable Items
A common observation in practice is that a single call may consume millions of tokens in total, yet because most of the input hits the cache, the actual cost is only a few cents; meanwhile another model consumes fewer tokens but ends up with a higher bill because of cache misses and repeated retries. An attributable accounting table should include the following fields:
| Field | Description |
|---|---|
| Input/output tokens | Distinguish system prompt, context, and generated content |
| Cache hit rate | Determines whether repeated long-context calls are economical |
| Reasoning effort setting | Higher settings improve accuracy but significantly amplify output cost |
| Retry count | Failed retries are the main source of hidden cost |
| Manual rework minutes | Once converted to labor cost, often exceeds the invocation fee |
A practical conclusion: when a task requires repeated rewriting over a long context, cache friendliness affects total cost more than unit price; when a task is one-shot generation, output unit price and the choice of effort setting matter more.
5. Common Pitfalls
- Looking only at unit price while ignoring total token volume, which distorts the budget model.
- Replacing automatic acceptance with subjective impressions, making conclusions non-reproducible.
- Ignoring the reasoning effort setting and wrongly attributing “high accuracy” and “low cost” to the same configuration.
- Failing to count manual rework, underestimating the real cost.
- Drawing conclusions from a one-time evaluation while ignoring capability drift from version iterations; a regular regression mechanism should be established.
6. Practical Recommendations
- Build 10 to 20 internal standard tasks covering four categories—generation, rewriting, structured output, and long-document understanding—with fully automated acceptance.
- Record the four-dimensional metrics for each task to form a comparable baseline table, and rerun it after every model or configuration change.
- Add an abstraction layer in the application that decouples model invocation, retry strategy, cache configuration, and logging/monitoring, so models can be swapped horizontally without changing business code.
- Adopt tiered routing: simple requests go to a low-cost configuration, complex requests are escalated to a higher-capability configuration, with rules or a small classifier making the upfront decision.
- Feed cost, latency, and failure rate into monitoring and alerting, set a per-task cost ceiling, and automatically downgrade or escalate to a human when the threshold is exceeded.
7. Conclusion
A price increase is not the problem; the lack of a quantifiable evaluation method is. Breaking “cost-performance” into four measurable dimensions—success rate, cost per task, latency and stability, and engineering fit—and then validating them with an auto-verifiable micro-benchmark and an attributable cost table turns model selection from a contest of impressions into a data-driven decision. This framework is vendor-agnostic and can be implemented directly on top of the general capabilities of cloud platforms such as Baidu AI Cloud: model services handle inference, object storage and container platforms host the application and sandbox runtime, and logging and monitoring/alerting services provide observability for cost and quality.
