LLM Evaluation Beyond Accuracy: Cost, Latency, and Reliability in a Spreadsheet Task
When multiple language models produce equally accurate spreadsheets, output quality alone no longer provides a useful basis for selection. This article outlines a practical evaluation framework covering correctness, token costs, retries, and runtime stability, along with production strategies for reducing costs without sacrificing quality.
1. What an Apparently Identical Test Result Reveals
Many teams evaluate large language models with standardized tasks: generate a well-formatted spreadsheet from supplied data, use the correct column names, include every record, and follow the formatting requirements.
In one test, four model configurations—including an automatic routing mode—produced spreadsheets that met every requirement. All four received full marks.
The value of this result lies in what it reveals:
- Task difficulty is no longer the bottleneck for this type of workload. For small to medium-sized tasks with clear structure and explicit instructions, differences between mainstream models may be minimal. Whether a model can complete the task correctly is no longer the central selection question.
- The differences shift to less visible dimensions. Once output quality is comparable, token consumption, response latency, API costs, and retry rates become the factors that separate user experience and operating expenses.
2. Why Full Marks Do Not Mean Equal Performance
Capability vs. Cost per Task
Model capabilities improve in steps, but billing accumulates with usage. A model that consumes twice as many tokens may deliver almost no additional quality on a given task, while its token charges can still double.
A simplified estimate is:
Cost per task ≈(input tokens × input price + output tokens × output price)× (1 + retry rate)
Beyond the visible token prices, input and output volume and retries contribute to the less obvious bill. Two equally correct answers can have very different costs if one model generates lengthy reasoning or repetitive intermediate explanations.
Automatic Routing: Benefits and Trade-Offs
Many model-serving platforms offer an automatic mode that routes requests among models according to task characteristics.
Its advantage is access to a potentially cost-effective combination without manually selecting a model for every task. Its drawback is reduced control: routing changes can cause output-style drift in batch workflows that require reproducible results.
A practical approach is to:
- Use automatic mode during exploration to establish a baseline quickly.
- Select a specific model and pin its version for production.
- Maintain a second-model fallback and result-validation logic for critical workflows.
3. A Reusable Model Evaluation Framework
Stage 1: Validate Capability
Start with clearly bounded tasks and explicit acceptance criteria. For example, a spreadsheet must contain a specified number of fields, and every value must match the source data.
Use programmatic validation rather than visual inspection wherever possible. A structural comparison can look like this:
def validate_table(result, source):assert set(result.columns) == set(source.columns), "Column mismatch"assert len(result) == len(source), "Row count mismatch"for col in source.columns:assert result[col].tolist() == source[col].tolist(), f"{col} data mismatch"return True
Stage 2: Account for Costs
Once the models pass the correctness checks, inspect the usage details for all four configurations. Focus on three areas:
- Input and output token distribution. Output tokens often cost several times more than input tokens, so concise output can reduce expenses.
- Reasoning overhead. Reasoning models may generate substantial hidden reasoning. Where that usage is billed as output, include it in the cost calculation.
- Retry and failure costs. Occasional timeouts or invalid formatting can trigger retries and erode an apparent pricing advantage.
Instrument the API-calling layer consistently and aggregate costs by task:
metrics = {"model": model_name,"prompt_tokens": resp.usage.prompt_tokens,"completion_tokens": resp.usage.completion_tokens,"latency_ms": elapsed,"retry_count": retries,}cost_logger.record(metrics)
Stage 3: Measure Stability and Robustness
A single perfect result does not establish production reliability. Repeat the same task multiple times and measure:
- Format validity rate: How consistently can the generated JSON or table be parsed?
- Result consistency rate: How often do repeated runs produce consistent results?
- Tail latency: Track P95 and P99 latency rather than relying only on averages.
4. Cost-Reduction Practices for Production
- Trim prompts and use caching. Place unchanged system instructions and context in a cacheable prefix where supported. Repeated requests can then incur substantially lower input costs.
- Define output constraints upfront. Explicit formatting instructions or structured-output constraints can reduce corrective retries. Retry costs can outweigh differences in token pricing.
- Route tasks by complexity. Use lightweight models for simple work and reserve flagship models for more complex tasks. At high request volumes, tiered routing can produce meaningful overall savings.
- Build a cost dashboard. Consolidate token usage, unit prices, retry rates, and failure rates into recurring reports so that billing changes can be explained and flagged early.
5. Conclusion
When several models earn full marks on the same task, the evaluation is only halfway complete. The costs, latency, and stability behind those scores determine which model is the better engineering choice.
Rather than focusing only on which model is “smarter,” developers should establish a three-part evaluation framework: capability validation, cost attribution, and stability measurement. This approach supports low-cost, high-quality, reproducible decisions even as models and cloud platforms evolve.
For practical selection, compare model services across relevant cloud platforms—including Baidu AI Cloud where applicable—using the same evaluation criteria and a workload that reflects your expected request volume. Let measured results, rather than impressions, guide the decision.
