Evaluating LLM Iterations: Balancing Accuracy, Latency, and Cost
This article explains how to evaluate successive LLM releases across accuracy, domain performance, latency, token usage, and cost. It covers why overall scores can mislead, how to measure latency percentiles and cost per 1,000 calls, how to compare models within a fixed cost tier, and how to build a repeatable evaluation pipeline with release gates and gradual rollout.
Model versions are changing faster than ever, and a single release often brings better capability, different latency, and new pricing at the same time. For developers and businesses, the real question is not whether a new version is stronger than the old one. The question is whether the new version is worth switching to under the target workload mix, cost budget, and latency constraints. Version evaluation should therefore go beyond a single accuracy score and use a multi-dimensional metric system, run through a repeatable pipeline that is monitored over time.
The following discussion uses an anonymized comparison between a lightweight preview model and its previous-generation version as a case study. The case data is used only to illustrate metric definitions and analytical approaches. It does not constitute any product recommendation or ranking.
1. Why Overall Scores Are Not Enough
The overall accuracy score is the most intuitive metric, but it hides three key problems:
- Uneven domain performance: A higher overall score may come from large gains in a few domains, while business-critical domains show no improvement or even regress.
- Changes in cost structure: Input and output token prices, average token consumption, and retry rates all affect the cost per 1,000 calls. Looking only at unit prices is not enough.
- Latency and stability risks: Early in a release, latency may be affected by traffic volume, cache hit rates, and service load. Average latency does not reflect performance during the stable period.
In the anonymized case, the preview version’s overall accuracy rose from 60.6% to 71.5%, an increase of 10.9 percentage points. Average latency increased from 40 seconds to 72 seconds. Average token consumption rose from 2,586 to 2,731, an increase of about 5.6%. The cost per 1,000 calls increased from 43.2 CNY to 53.5 CNY, an increase of about 23.8%. These figures show that capability gains often come with higher resource consumption and latency changes, so teams need to weigh them together.
| Metric | Previous-Generation Lightweight Version | Preview Version | Change |
|---|---|---|---|
| Overall accuracy | 60.6% | 71.5% | +10.9 percentage points |
| Average latency | 40s | 72s | +32s |
| Average token consumption | 2,586 | 2,731 | +5.6% |
| Cost per 1,000 calls | 43.2 CNY | 53.5 CNY | +23.8% |
| Output price | 18.125 CNY per million tokens | 21.3 CNY per million tokens | About +17.5% |
2. Domain-Level Evaluation: A Key View Beyond the Overall Score
Domain-level evaluation shows where the gains happen. In the case, education accuracy rose from 36.0% to 63.5%, a gain of 27.5 percentage points. Reasoning and mathematical computation rose from 67.5% to 83.4%, a gain of 15.9 percentage points. Healthcare and mental health, and finance, also showed double-digit improvements. This information matters for business decisions. If a business mainly serves education-related Q&A, the upgrade may deliver more value than the overall score suggests. If a business depends mostly on low-latency conversation, the added latency may cancel out the capability gains.
Teams should assign domain weights in the evaluation set and report the macro average, the weighted average, and the lowest score across key domains. For high-compliance or high-risk scenarios, set an admission rule that no key domain may regress, rather than relying only on the overall improvement.
3. Definitions for Latency, Tokens, and Cost
1. Measure Latency by Percentiles
Average latency is easily distorted by long-tail requests. In engineering practice, teams should collect P50, P90, P95, and P99 latency. They should also separate results for cold start, after warm-up, and under concurrent load. In the case, the increase in average latency from 40 seconds to 72 seconds may reflect factors such as higher load during the early release period and cache misses. A sound approach is to repeat tests within a stable time window and record the concurrency level, timeout settings, and retry policy.
2. Token Consumption Drives Cost
Cost should not be judged by price per million tokens alone. The cost per 1,000 calls can be approximated as:
Cost per 1,000 calls = retry factor × (average input tokens × input price + average output tokens × output price) / 1,000,000 × 1000
If average token consumption rises by 5.6% and the output price rises by about 17.5%, the combined effect can push the cost per 1,000 calls up by about 23.8%. Evaluation reports should therefore disclose average input tokens, average output tokens, unit prices, and retry rates together.
3. Cost Efficiency Metrics
Teams can define cost efficiency metrics to compare models within the same cost tier. For example:
Cost efficiency = weighted accuracy / cost per 1,000 callsMarginal gain = accuracy increase in percentage points / increase in cost per 1,000 calls
The first metric shows output per unit of cost. The second helps judge whether an upgrade is worth its price. Neither ratio can replace business constraints, so both must be read alongside the SLA and the cost of manual review.
4. Comparing Models Within the Same Cost Tier
The most common mistake in horizontal comparison is comparing absolute scores across different cost tiers. A better approach is to fix the cost range, the task set, the call parameters, and the timeout policy, then compare accuracy, P95 latency, and failure rate. For example, within a cost range of 50 to 100 CNY per 1,000 calls, teams can observe the cost efficiency curve of different options and check for an inflection point where cost rises but accuracy improves only slightly.
In the anonymized case, the same-tier analysis showed that cost and accuracy were not linearly related. The lightweight preview version achieved relatively high accuracy within a specific cost range. This observation is only an example of method and should not be generalized into a universal ranking. Businesses should retest with their own representative samples and report confidence intervals.
5. An Engineering Evaluation Pipeline
A practical evaluation pipeline usually includes the following components:
- Versioned datasets: fixed question sets, stratified sampling, and a held-out blind test set;
- Fixed call parameters: consistent temperature, maximum output length, timeout, and retry policy;
- Metric collection: accuracy, domain-level scores, token counts, latency percentiles, and failure rates;
- Result archiving: a comparable report generated for each release;
- Canary release and rollback: shadow traffic validation before shifting live traffic.
In a general-purpose cloud environment, teams can orchestrate evaluation tasks as batch jobs, write results to object storage, and connect metrics to a log service and monitoring with alerts. For example, Baidu AI Cloud offers general-purpose capabilities such as batch processing, object storage, log service, and monitoring with alerting, which can host this kind of evaluation pipeline.
Pseudocode example:
def aggregate(records, domain_weights):total = 0.0for r in records:w = domain_weights.get(r.domain, 1.0)total += w * (1 if r.correct else 0)return total / len(records)def cost_per_1k(avg_in_tokens, avg_out_tokens, price_in, price_out, retry=1.0):return retry * (avg_in_tokens * price_in + avg_out_tokens * price_out) / 1_000_000 * 1000release_gate = {"min_accuracy": 0.70,"max_domain_drop": 0.02,"max_p95_latency_s": 90,"max_cost_increase_pct": 30}
6. Release Gates and Rollout Strategy
Teams should turn evaluation conclusions into release rules. A version should not ship unless its overall accuracy is at or above the baseline, no key domain regresses by more than 2 percentage points, P95 latency meets the SLA, the cost increase stays within the budget threshold, and the failure and retry rates remain under control. During release, use a small-traffic canary, shadow traffic comparison, and a fast rollback mechanism, and keep tracking real business metrics. Only by combining offline evaluation, online canary testing, and cost monitoring can teams reliably gain value from rapid model iteration.
