LLM Model Selection: Evaluating Capability and Cost in Production
This article explains how to evaluate large language models for production use by defining task-specific success criteria, measuring accuracy, latency, token usage, and total cost together, analyzing performance by workload slice, and running reproducible comparisons and canary tests. It also covers how to interpret benchmark rankings and version improvement claims without mistaking relative gains for business value.
LLM Model Selection: Evaluating Capability and Cost in Production
Treating “which model is stronger” as a one-time leaderboard question often leads to higher costs after deployment. For developers and enterprise users, model strength depends on whether the task distribution, cost of failure, latency budget, and per-call cost are acceptable at the same time. Preview versions, traffic spikes, and changes in prompt length can all cause the same API to perform differently at different times. Model selection should therefore be based on a fixed task set, fixed scoring rules, and reproducible experiments rather than scattered anecdotes.
Define Tasks Before Discussing Strength
Before evaluation begins, specify three things: where user questions come from, what counts as a correct answer, and what impact an error would have. Customer support summarization, code completion, financial question answering, and educational explanation have different requirements for factual consistency, reasoning chains, and refusal behavior. If these tasks are mixed into a single total score, weaknesses in one area may be hidden by the average.
Break traffic into stable subsets:
- For high-frequency, low-risk tasks, prioritize latency, throughput, and unit cost.
- For low-frequency, high-risk tasks, prioritize accuracy, citation consistency, and the human review rate.
- For long-context tasks, measure separately how input length affects cost and timeouts.
- For tool-calling or structured-output tasks, check the format validity rate separately rather than looking only at whether the natural language sounds fluent.
The same prompt template, temperature, maximum output length, and timeout policy must remain constant across comparisons. Otherwise, observed differences may come from the invocation setup rather than model capability.
Four Metrics That Must Be Evaluated Together
Accuracy reflects task completion quality, but it is not enough on its own. Average latency determines interactive experience and queue buildup; token consumption determines whether context is bloated; total cost maps to the budget. All four should be recorded on the same batch of requests.
Accuracy should use task-specific scoring rules. Multiple-choice questions can use exact matching, while open-ended question answering needs coverage of key points, factual consistency, and whether refusal behavior is appropriate. Looking only at whether an answer “seems complete” will overestimate practical usability. When reporting results, include sample size and confidence intervals, or at least the number of samples per domain, so that small-sample fluctuations are not presented as a qualitative breakthrough.
Latency should distinguish between queuing, first-token time, and full generation time. An increase in average duration does not necessarily mean the model has slowed down; it may also reflect high load shortly after release, more retries, or longer outputs. Report P50, P95, and the timeout rate together. If P95 degrades significantly, an interactive product may become unusable even if average accuracy improves.
Track input and output tokens separately. Prompts, system constraints, retrieved snippets, and conversation history all count toward input; longer explanations, repeated wording, and uncompressed structured fields increase output. If an accuracy improvement comes with a significant increase in tokens, determine whether those tokens actually add useful information.
Calculate cost per 1,000 successful calls and per 1,000 calls including failures and retries. Failed retries, second requests after overly long inputs are truncated, and human review should all be included in total cost. Comparing list prices alone underestimates real spending. When pricing terms change, historical data must be recalculated on the same basis; otherwise, period-over-period comparisons are meaningless.
Use Slices to Find Real Weaknesses
Overall accuracy is useful for observing trends, but it is not suitable for launch decisions. Slicing by domain, difficulty, and input length is more valuable.
Educational questions often test concept discrimination, completeness of steps, and whether verifiable evidence is provided. Reasoning and math tasks are more sensitive to symbol errors and intermediate steps. In medical and mental health scenarios, “refuse or recommend professional help when uncertain” must be treated as part of correct behavior; fluent answers should not automatically receive high scores. In financial scenarios, check whether numbers, time ranges, definitions, and disclaimers are consistent. If a version improves only the total score but regresses on high-risk slices, it should not directly replace production traffic.
Rankings themselves should also be interpreted cautiously. Changes in task set composition, difficulty distribution, and the list of evaluated models can cause large rank fluctuations. A rise in ranking indicates a change in relative position and does not automatically translate into a benefit for your business. When the distribution of your business task set differs from that of public benchmarks, business replay results should take precedence.
Designing Defensible Comparison Experiments
A minimal reproducible pipeline can be fixed at five steps: sample, invoke, score, aggregate, and archive. Sampling should cover recent real requests and retain hard cases, rather than keeping only questions the model is likely to answer correctly. Invocation records should include request ID, model version, parameters, input length, output length, latency, timeout status, and error code. Scoring should be automated whenever possible, with disputed samples reviewed by two people. Aggregation should bucket results by domain, difficulty, and length. Archive the task set version and scoring script version for future regression testing.
An illustrative record schema is shown below. It only expresses field meanings and does not correspond to any specific vendor API:
request_id, task_type, difficulty, input_tokens, output_tokens,latency_ms, status, score, cost
When aggregating, do not report only averages. Also calculate success rate, valid-answer accuracy, timeout rate, median cost per call, and the average cost required to reach a target accuracy level. The last metric is closer to a procurement decision: how much extra spend and waiting time are required to obtain one additional correct result?
For preview or newly released versions, observe temporal stability. Latency in the first two to three days after release may be affected by traffic peaks. Sample at least once during off-peak hours and once during peak hours, and list retry counts separately. Only if latency falls over time while accuracy holds can early slowdown be attributed mainly to load rather than a capability tradeoff.
From Evaluation to Production Rollout
After evaluation passes, a full one-step switch is not recommended. Use a small-traffic comparison: split the same requests between the baseline version and the candidate version at a fixed ratio, and record user follow-up rate, human handoff rate, format failure rate, and complaint topics. These online signals are often closer to real experience than offline aggregate scores.
From an engineering perspective, general capabilities can help reduce uncertainty:
- Use caching to store stable, reusable results and reduce repeated generation.
- Use retrieval to narrow context first, rather than inserting an entire corpus into the prompt.
- Use structured output to constrain key fields, and retry only the failed fields when possible.
- Use message queues to smooth peaks and prevent launch-time timeouts from escalating into cascading failures.
- Use logging and monitoring alerts to track proxy accuracy metrics, P95 latency, tokens, and cost.
- Retain human review or rule-based fallbacks for high-risk domains rather than fully automating release.
When the candidate version is more accurate but slower and more expensive, use routing instead of a global replacement: send simple requests through the low-cost path and complex or high-risk requests through the high-quality path. Routing rules must be validated with business data and cannot be divided based on intuition. Every model or prompt change should rerun the same regression set and define rollback conditions, such as a decline in high-risk slice accuracy, a timeout rate exceeding a threshold, or unit cost exceeding budget.
How to Read Claims of “Major Improvements”
During version updates, double-digit changes in education, reasoning, medical, financial, and other slices are possible. When interpreting them, ask four questions: Are the number of questions and the difficulty the same? Did scoring become stricter or looser? Did outputs become longer, raising both cost and latency? Are improvements concentrated in questions that account for a large share of your real traffic? If gains come mainly from obscure questions with few samples, business value will be limited. If the cost increase is close to or greater than the quality benefit, and failures can be handled through retries and human intervention, calculate blended ROI instead of celebrating accuracy alone.
Avoid the reverse error as well: longer latency does not necessarily mean the model has regressed, and higher cost does not necessarily mean the model is not worth using. The key is to translate quality improvements into reduced manual handling, fewer bad decisions, and acceptable waiting time. If that translation cannot be made, keep the baseline and continue accumulating samples.
Conclusion
Scientific model comparison is not about finding an absolutely stronger name. It is about building a task set aligned with the business, observing accuracy, latency, tokens, and total cost together, and using slices, comparison traffic, and rollback conditions to control risk. Preview-period data should be treated only as a signal; regression results from a stable period are a more suitable basis for switching. With ongoing evaluation using this approach, teams can make explainable and reproducible choices among capability, experience, and budget.
