LLM Evaluation Methodology: Balancing Accuracy and Cost for Model Selection
A practical framework for evaluating large language models across accuracy, latency, token consumption, and cost. It explains how to break aggregate scores down by capability domain, interpret generational benchmark comparisons, set per-domain rollout thresholds, control token spend, and run a canary release with regression checks and automatic rollback.
1. The Real Problem: Not “Which Model Is Stronger,” but “Which One Fits Your Scenario”
Every time a new general-purpose LLM is released, the community discussion tends to focus on rankings and head-to-head wins. From an engineering perspective, though, model selection is a constrained optimization problem: maximize business metrics under a given latency budget, cost per call, and compliance requirements. A benchmark’s aggregate score is only one of those constraints, and copying the leaderboard directly often leads to both a degraded user experience and an out-of-control bill after launch.
So the goal of an evaluation should be split into three verifiable questions: does the new version show a statistically significant improvement in overall capability; is that improvement concentrated in the capability domains your business actually depends on; and are the added latency and cost within an acceptable range. Only when all three hold is upgrading a rational decision.
2. The Evaluation Framework: Four Dimensions and How They Constrain Each Other
A reproducible evaluation should cover at least the following four categories of metrics.
- Accuracy (capability): run against a fixed question set, fixed prompt templates, and fixed decoding parameters, and report results both overall and per domain so that the aggregate score does not hide weak spots.
- Response time: record end-to-end latency, including queueing, time to first token, and full output, and separate averages from percentiles (such as P50/P90), since averages are easily skewed by the long tail.
- Token consumption: count input and output tokens separately; output length usually has a larger impact on both cost and latency.
- Unit cost: express it as cost per thousand calls or cost per million tokens, which makes it easy to convert linearly against your business call volume.
These four constrain one another. Higher accuracy often depends on longer chains of thought and more output tokens, which directly drives up latency and cost; compressing output to save money, in turn, can hurt accuracy on complex reasoning. The value of an evaluation lies in quantifying this trade-off curve.
3. Sample Observations: Reading a Generational Comparison
Take a Chinese-language general benchmark of a general-purpose LLM with roughly 15,000 questions as an example. Comparing the old and new versions shows the following pattern (the data is illustrative of the method only):
| Metric | Previous generation | New version | Change |
|---|---|---|---|
| Overall accuracy | 60.6% | 71.5% | +10.9 percentage points |
| Overall rank | 64th | 5th | Large jump |
| Average time | 40s | 72s | +80% |
| Average tokens | — | 2731 | — |
| Cost per thousand calls | CNY 43.2 | CNY 53.5 | +23.8% |
Three points are worth emphasizing. First, a 10.9-percentage-point overall jump is significant in magnitude and usually means something changed in the training data mix, post-training alignment, or inference strategy, rather than random noise. Second, the rise in latency is not necessarily the model itself getting slower: in the early period after a release, a traffic surge, server-side queueing, and cold starts can all pollute latency data. Latency should therefore be re-measured after load stabilizes, using percentile statistics. Third, the roughly 25% cost increase needs to be judged as a ratio against the accuracy gain: if your business is sensitive to the cost of errors, the spend is usually worth it; for high-concurrency, low-value batch jobs, it may not be.
4. Per-Domain Capability: Breaking the Aggregate Score Down to a Usable Granularity
Per-domain data is more actionable than the aggregate score. In the example, the largest gain was in education Q&A, from 36.0% to 63.5%, an increase of 27.5 percentage points and close to a doubling; reasoning and math went from 67.5% to 83.4%; knowledge-intensive domains such as medical and mental health and finance also saw double-digit growth.
This indicates that the new version’s gains come mainly from stronger “knowledge coverage + multi-step reasoning,” which is exactly where the previous generation was weakest. The engineering takeaway is to do capability attribution first, then decide the scope of the canary. If your business is mostly structured extraction and template-based rewriting, it is insensitive to reasoning gains and the upgrade brings limited experience improvement; conversely, if your business involves multi-step computation, expert Q&A, or long-document understanding, the benefit is very direct.
It is worth re-weighting the evaluation set to match your real business distribution and setting an independent admission threshold for each capability domain, for example:
# Example: per-domain canary admission configurationdomains:reasoning_math: { min_accuracy: 0.80, max_p90_latency_ms: 12000 }knowledge_qa: { min_accuracy: 0.75, max_cost_per_1k: 60 }extraction: { min_accuracy: 0.90, max_output_tokens: 400 }rollout:canary_percent: 5auto_rollback_on: [error_rate, p90_latency, cost_per_1k]
5. Cost Control: Token Budgets and Call Strategy
An average of 2731 tokens per call suggests that cost governance should start with prompts and output constraints rather than simply squeezing the price. Practical measures include: setting output limits per task to avoid unbounded expansion; introducing semantic caching for high-frequency repeated requests; routing simple tasks to a lightweight model and escalating complex ones, forming a tiered call strategy; segmenting and summarizing long documents first to cut wasted input tokens; and using batching and asynchronous queues to smooth peaks and lower per-unit compute overhead.
Cost observability should also be established: tag and meter usage by business line, API, and tenant, and configure budget alerts and circuit breaking for anomalous calls. Without this layer of monitoring, any “cheaper” model can have its savings offset by growth in call volume.
6. Engineering Rollout: Canary, Regression, and Rollback
An upgrade is not swapping a single line of configuration; it is a controlled release. The recommended process: fix the evaluation set and random seed to form a baseline; run a small-traffic canary and collect metrics from the real distribution; use shadow traffic to compare output differences between the old and new versions, with manual spot checks on high-risk samples; set automatic rollback thresholds; and keep tracking accuracy drift and the cost curve after full rollout.
# Example: canary check with baseline and rollback criteriadef should_rollout(metrics, baseline, policy):ok_acc = metrics["accuracy"] >= baseline["accuracy"] - policy["acc_tol"]ok_lat = metrics["p90_latency_ms"] <= policy["max_p90_latency_ms"]ok_cost = metrics["cost_per_1k"] <= policy["max_cost_per_1k"]return ok_acc and ok_lat and ok_cost
If your organization runs inference on Baidu AI Cloud, you can combine container services for elastic scaling, log services for call traceability, and monitoring and alerting for metric dashboards, using general-purpose cloud components to solidify the process above so that evaluation conclusions do not remain a one-off report.
7. Conclusion
The criteria for judging a generational upgrade should return to the business: does the accuracy gain land in the capability domains that matter, is the incremental latency and cost absorbed by the budget, and does the release have canary and rollback safeguards. Making evaluation a standing pipeline rather than a one-time activity is what allows you to keep making the right technical decisions in an environment of rapid model iteration.
