LLM Selection and Evaluation: Balancing Accuracy and Cost
This article explains how to evaluate large language models across four dimensions—accuracy, latency, token consumption, and cost—using a lightweight multimodal model preview as an example. It shows why a cheaper new version still needs testing on your own data, how a typical generational jump looks in public benchmarks, and how to calculate effective cost per successful result. It also outlines a reproducible evaluation method, a scenario-based selection framework with routing examples, and common pitfalls to avoid.
1. Why a “Cheaper New Version” Deserves a Real Evaluation
A cloud provider recently released a preview of a lightweight multimodal large model. The headline claim was “usable performance at less than a quarter of the flagship’s cost,” along with assertions that it beats the previous mid-tier generation on many public benchmarks.
Claims like this are common in the industry, but they only answer “cheaper than what.” They leave three questions that developers actually care about unanswered: Is accuracy sufficient on my business corpus? Does response latency meet interaction requirements? Has the cost per call genuinely gone down?
A complete model evaluation is essentially a trade-off in four dimensions:
| Dimension | Metric | Business Meaning |
|---|---|---|
| Quality | Accuracy by domain | Ready to ship, or does it need human review |
| Latency | Average time per call, time to first token | Suitable for real-time interaction |
| Consumption | Average tokens per call | Tied to prompt design and output length |
| Cost | Price per 1,000 calls, price per million tokens | Determines the bill at scale |
One caveat: preview-version data is time-sensitive. New model launches often come with a surge in traffic, and server queuing and rate limiting can significantly inflate measured latency. Evaluation results must therefore state the collection window and be re-measured once the service stabilizes.
2. Old vs. New: What a Typical Generational Jump Looks Like
Using public evaluation data for the previous and current generation of a lightweight model (roughly 15,000 questions, with output price converted to RMB per million tokens):
- Accuracy: 60.6% → 71.5%, up 10.9 percentage points, with the overall ranking rising from 64th to 5th;
- Average time per call: 40s → 72s;
- Average tokens: 2586 → 2731, up 5.6%;
- Cost per 1,000 calls: RMB 43.2 → 53.5, up about 23.8%.
Three signals in this data deserve a developer’s attention.
First, an overall score gain often comes from a few weak domains. In this case, “Education” rose from 36.0% to 63.5%, a 27.5-point jump that nearly doubled the score; “Reasoning and Math” went from 67.5% to 83.4%; “Medical and Mental Health” and “Finance” improved by 15.1% and 13.7% respectively. The main gains of the new generation come from filling long-tail knowledge gaps and improving reasoning-chain stability, not from uniform improvement. When selecting a model, check whether your business domain falls in the significantly improved range.
Second, latency and cost do not always move in the same direction. Higher accuracy accompanied by higher token consumption usually means longer internal reasoning and more complete output; a higher unit price directly inflates the bill. Together they produce the 23.8% increase in cost per 1,000 calls.
Third, a cost advantage must be measured per unit of effective result. If accuracy rises from 60% to 71%, fewer retries are needed to reach the same delivery quality, so the real effective cost may be lower than the headline price suggests. Evaluation should introduce an “effective cost per call” metric:
# Effective cost per call: fold retries and human review into unit costdef effective_cost(price_per_1k, acc, retry_penalty=0.0):"""price_per_1k: price per 1,000 callsacc: accuracy (0~1)retry_penalty: converted cost of human review for failed samples (per call)"""expected_calls = 1.0 / max(acc, 1e-6) # expected number of callsreturn price_per_1k / 1000.0 * expected_calls + (1 - acc) * retry_penalty
3. A Four-Dimension Evaluation Method You Can Reproduce
3.1 Quality: Stratified Sampling, Not Just a Total Score
A total score gets diluted by high-frequency easy questions. Sample in layers by business domain so each domain has enough samples, and separately track the “error type distribution” (knowledge gaps, reasoning errors, format violations, refusals). In structured-output scenarios, format violations are often more damaging than knowledge errors and deserve their own metric.
3.2 Latency: Separate Time to First Token from Total Time
For interactive applications, perceived responsiveness depends on time to first token; for batch jobs, it depends on overall throughput. Load tests should record P50/P95/P99 rather than averages, and should state the concurrency level and whether the cache was hit.
3.3 Tokens: Control the Variables
Token consumption for the same model can vary more across prompts than across versions. Fix the prompt template, temperature, and maximum output length, and count input and output tokens separately, since they are usually priced differently.
3.4 Cost: Build a Bill Model You Can Recompute
Monthly cost ≈ daily calls × 30 × (input tokens × input price + output tokens × output price)+ retry overhead + supporting service fees such as caching and storage
Supporting components are easy to overlook: usage of logging, monitoring and alerting, object storage, and message queues also lands on the bill at tens of millions of calls.
4. A Selection Framework: Mapping Conclusions to Scenarios
- Real-time interaction (intelligent customer service, code completion): prioritize P95 latency and time to first token; accuracy just needs to be adequate. Consider a tiered strategy where a lightweight model answers first and complex requests are routed to the flagship model.
- Offline batch processing (document extraction, content moderation, data labeling): prioritize accuracy and cost per token; latency is not sensitive, and queuing can smooth peaks to improve throughput utilization.
- High-rigor scenarios (finance, medical assistance): rule-based validation and human review are mandatory, model output serves only as a candidate, and full call-chain logs should be retained for auditing.
A sketch of the routing strategy:
def route(prompt, light_model, strong_model, threshold=0.75):r = light_model(prompt)if r.confidence >= threshold and r.format_ok:return r.textreturn strong_model(prompt).text # fall back to the stronger model to control overall cost
5. Common Pitfalls and Conclusion
Pitfall one: treating preview-version first-day latency as a long-term baseline. Pitfall two: substituting a single total score for per-domain evaluation. Pitfall three: comparing only unit prices while ignoring token consumption and retry rates. Pitfall four: ignoring supporting services and operational costs.
The conclusion is clear: the new lightweight generation is already capable of replacing the previous mid-tier model on most knowledge-intensive tasks, but the price is higher latency and a higher unit price. The rational approach is not either/or, but building your own tiered evaluation set and routing mechanism, letting data decide the traffic split, and re-measuring the baseline after the service stabilizes. If an organization has already built a unified model access and monitoring system on Baidu AI Cloud, it can use logging and monitoring and alerting to turn these four dimensions into a standing dashboard, making selection a continuously optimized engineering capability rather than a one-time judgment.
