Evaluating LLMs: A Practical Guide to Accuracy, Latency, and Cost
When comparing large language models (LLMs), businesses often fall into the trap of relying on a single benchmark score. However, determining which model is better is fundamentally a business definition problem. This guide explores how to comprehensively evaluate LLMs by breaking down capabilities into measurable metrics: accuracy, latency, token consumption, and cost per successful task. It covers strategies for building credible evaluation sets, ensuring fair comparisons, interpreting performance improvements, and transitioning from offline benchmarks to production engineering.
1. “Which Model is Better?” is a Business Definition Problem
When comparing LLMs, the most common pitfall is searching for a single overall score that summarizes all capabilities. While convenient for ranking, overall scores cannot directly answer the questions enterprises truly care about: Can the model consistently complete tasks? Is the user wait time acceptable? Will errors cause financial loss? And is the long-term operational cost controllable?
For example, a knowledge Q&A system prioritizes factual accuracy and source integrity; an information extraction system focuses on field correctness, omission rates, and format stability; an AI coding scenario emphasizes functional correctness, edge case handling, and maintainability; while a complex decision-support system requires additional checks for logical consistency and risk warnings.
Therefore, being “better” is not an absolute conclusion divorced from the context, but rather the model’s comprehensive performance under specific tasks, constraints, and data distributions.
A professional evaluation should first clarify three questions:
- What is the task goal? Is it content generation, information extraction, question answering, or multi-step operation?
- What is the cost of failure? Can errors be easily spotted by users, or is manual review required?
- What are the resource constraints? Are there response time limits, budget caps, and concurrency requirements?
Only by clarifying these conditions does the trade-off between accuracy, speed, and cost have practical meaning.
2. Breaking Down Model Capabilities into Four Measurable Metrics
2.1 Accuracy: Not Just How Many are Right, But Where the Errors Are
For tasks with standard answers, you can use:
Accuracy = Number of Correct Samples ÷ Number of Valid Evaluation Samples
However, this metric is suitable for multiple-choice questions, deterministic calculations, and structured judgments, but does not directly cover all open-ended tasks. For instance, a generated text might contain the correct conclusion but omit key constraints; it might also be fluent but lack factual basis.
Therefore, a tiered scoring standard should be established based on the task:
- Are the conclusions or core fields correct?
- Are key facts complete?
- Does it comply with user constraints?
- Are there ungrounded statements?
- Does the output structure meet downstream processing requirements?
- Does it include content that should be rejected or flagged as risky?
For information extraction tasks, precision and recall should be checked separately. The former reflects how much of the output is correct, while the latter reflects how much of the target information was successfully retrieved. Looking at a single overall score might mask the difference between “sparse but accurate” and “comprehensive but mixed with errors.”
2.2 Response Time: Focus on the Tail Beyond the Average
The total duration of an API call typically includes request transmission, queuing, input processing, generation, and response return. The time recorded by the client does not equal the model’s computation time, nor does it necessarily equal the wait time perceived by the user.
It is recommended to record at least:
- Time to First Token (TTFT): How quickly the user sees the initial content.
- Full Response Time: How long it takes for the entire result to be returned.
- P50, P95, and P99 Latency: To observe typical requests and tail requests respectively.
- Timeout and Failure Rates: To determine if the system can deliver stably.
A system with low average latency can still degrade user experience due to a few extremely slow requests. For real-time interactions, tail latency is often more critical than the average; for offline batch processing, the number of tasks completed per unit time should also be monitored.
Streaming output can improve the waiting experience, but it does not guarantee that the entire task finishes faster. If downstream processes must wait for the complete result before proceeding, a fast TTFT cannot substitute for full response time.
2.3 Token Consumption: Measuring Resource Usage, Not Direct Quality
Tokens are the unit of measurement for how models process text, and they do not equate to the number of Chinese characters or English words. Different tokenization methods can result in different token counts for the same text, so when comparing across models, token count should not be treated as a uniform scale for output length or capability.
It is necessary to distinguish between:
- Input Tokens: Task instructions, conversation history, reference materials, etc.
- Output Tokens: The final returned content.
- Other Billable Usage: Whether it exists and how it is calculated should be verified against the official billing documentation.
Longer outputs are not necessarily more accurate. Verbose answers can increase reading burden and introduce unverified details. Conversely, overly restricting output might cause the omission of key information.
A more practical approach is to simultaneously observe task success rate, character length, structural integrity, and actual billing usage to determine if the extra consumption brings verifiable quality benefits.
2.4 Cost: Shifting from Per-Call Pricing to Cost per Successful Task
In scenarios where input and output are billed separately, the cost of a single call can be summarized as:
Call Cost = Input Usage × Input Unit Price + Output Usage × Output Unit Price
When calculating, unify the measurement units to avoid mixing “per thousand tokens” with “per million tokens.” If billing rules include caching, batch processing, or other items, they should be calculated separately according to actual rules.
However, what enterprises truly need to manage is usually not the per-call cost, but the total cost of successfully completing a task:
Cost per Successful Task = Total Relevant Costs During Evaluation ÷ Number of Tasks Meeting Acceptance Criteria
“Total relevant costs” should include retries, retrieval, external operations, manual review, and failure remediation based on the business scope. A model with a lower call price might not be more economical if it requires constant corrections.
3. How to Build a Credible Evaluation Set
3.1 Let Samples Represent the Business, Not Just a Question Bank
General benchmarks can provide a baseline reference, but business selection requires data that approximates real-world inputs. It is recommended to divide the evaluation set into three tiers:
- Base Capability Set: Used to check common sense, reading comprehension, calculation, and logical judgment.
- Business Task Set: Derived from authorized and desensitized real requests, used to verify if common workflows can be completed.
- Boundary and Risk Set: Covers missing information, ambiguous expressions, contradictory materials, overly long inputs, false premises, and requests that should not be executed.
The evaluation set should also retain a certain proportion of difficult samples. If the test content is too simple and multiple models score near perfect, it becomes difficult to distinguish actual capabilities.
3.2 Avoid Test Set Contamination
If developers repeatedly modify prompts based on the same batch of questions, the final high score might merely indicate adaptation to the test set rather than generalization to new tasks.
A safer approach is to split the data into a development set, a validation set, and a holdout test set. Prompt and workflow optimization primarily uses the development set; solution selection references the validation set; final conclusions are confirmed on the holdout test set that was not involved in tuning.
Simultaneously, record data versions, scoring rules, and modification history. Otherwise, even if scores improve, it is hard to tell if the gain came from model updates, prompt adjustments, or easier questions.
3.3 Clarify Failure and Retry Metrics
Timeouts, empty responses, format errors, and content errors should be recorded separately; failed samples should not be deleted just to boost scores.
If the business allows retries, the following should be reported:
- Initial call success rate;
- Final success rate after retries;
- Average number of calls per task;
- Extra latency and cost generated by retries.
This helps distinguish between “the model completed it well in one go” and “the system completed it well after multiple remediations.”
4. Unifying Experimental Conditions for Fair Comparison
Model output depends not only on the model itself but is also influenced by task instructions, context length, output constraints, sampling settings, and external resources.
Before evaluation, business requirements should be fixed, and the following conditions should be unified as much as possible:
- Identical task inputs and reference materials;
- Identical output acceptance criteria;
- Identical tool access scope;
- Identical timeout and retry rules;
- Similar test timeframes and concurrency loads;
- Traceable model versions and configuration records.
Here, it is necessary to distinguish between two comparison methods.
- Capability Comparison Experiment: Emphasizes unifying prompts and workflows, suitable for observing changes brought by model replacement.
- Business Solution Evaluation: Allows optimizing prompts and workflows for different models, but should provide similar tuning budgets and fully disclose workflow differences.
Both are reasonable, but they answer different questions. The former compares model performance under identical conditions, while the latter compares the overall deliverable solutions. The results of these two should not be mixed to form a seemingly precise ranking.
5. How to Interpret Performance Improvements and Latency Changes
5.1 Percentage Point Increase ≠ Relative Improvement
When comparing two accuracy rates, direct subtraction yields the percentage point change; dividing by the original accuracy yields the relative increase.
Both expressions have their uses but cannot be mixed. Especially when the baseline is low, the relative increase might appear large, but it does not mean the final result meets business requirements.
For model upgrades, error types should also be analyzed: Have existing errors decreased? Have new formatting issues appeared? Have difficult tasks truly improved? An overall score increase does not mean every business subset is better.
5.2 Domain Improvements Must Combine Weights and Sample Sizes
A significant improvement in a specific domain only holds high selection value if that domain is relevant to the target business.
Furthermore, scores in low-sample domains are more prone to fluctuation. The sample size for that domain should be reported alongside, and uncertainty evaluated based on task characteristics. For comparisons on the same set of questions, checking the number of “was wrong, now right” versus “was right, now wrong” is often more explanatory than looking at the total score alone.
The total score can use business weights, but weights should be determined before viewing the results to avoid post-hoc adjustments to fit a specific conclusion.
5.3 Slower Response ≠ Deeper Reasoning
A slower model response might be related to output length, queuing, input size, service load, or compute strategy. Based solely on increased latency, one cannot assert that the model performed more effective reasoning.
The relationship between quality and time should be observed after controlling for input length, output requirements, and concurrency. If the extra wait significantly reduces high-risk errors, the latency increase might be acceptable; if it mainly produces repetitive content, output constraints or processing workflows should be optimized.
6. From Offline Scores to Production Engineering
6.1 Validate with Shadow Traffic First
After passing offline evaluation, a candidate solution can be allowed to process a portion of real requests without delivering the results to users. This checks stability, latency, cost, and error distribution under real inputs.
When sensitive data is involved, authorization, desensitization, access control, and log protection must be implemented. Evaluation needs should not be an excuse to expand data exposure.
6.2 Phased Rollout with Clear Rollback Conditions
Gradually expand the usage scope while monitoring task success rates, manual takeover rates, complaint rates, timeout rates, and budget consumption.
Rollback conditions should be defined before going live, such as a significant increase in critical task errors, latency exceeding business limits, or cost per successful task consistently exceeding the budget. You should not wait until problems occur to temporarily discuss whether to roll back.
6.3 Replace “One Model for All Requests” with Task Routing
Different tasks have varying capability and latency requirements. Simple classification, field extraction, and complex analysis can adopt different processing paths.
However, routing strategies also carry judgment costs and misclassification risks. You should not rely solely on the model’s self-reported confidence to decide whether to upgrade processing; rather, combine input features, rule validation, historical performance, and sampling review.
The goal of routing is not to make every call as cheap as possible, but to reduce overall waste under quality constraints.
7. Establishing a Sustainable Evaluation Loop
Evaluating LLMs is not a one-time procurement test, but an engineering process spanning development, deployment, and iteration.
A sustainable loop should include:
- Collecting compliantly processed failure cases from real tasks;
- Categorizing cases into knowledge, logic, format, latency, or workflow issues;
- Updating the evaluation set while retaining independent test data;
- Conducting regression tests on prompt, workflow, and model changes;
- Validating benefits in a small scope before deciding to expand rollout;
- Saving results and configurations to support reproducibility and rollback.
Ultimately, “which is better” should translate into an actionable judgment: Under explicit task and resource constraints, which solution can more stably meet acceptance criteria with acceptable latency and total cost.
Accuracy measures result quality, latency measures delivery experience, token consumption reveals resource usage, and cost per successful task reflects economics. Placing these dimensions within a single reproducible evaluation system prevents being misled by single leaderboards or isolated highlights, leading to technical choices truly suited for the business.
