How to Evaluate Large Language Models: Key Metrics and Reproducible Methods
This article explains how to turn LLM evaluation into a measurable, reproducible engineering process. It breaks down four core metric categories—accuracy, average latency, average token usage, and average cost per 1,000 calls—and shows how to read each one correctly, including why averages hide long-tail behavior and why normalized cost figures must be decomposed back into price and token volume. It also covers the coupling between metrics, a simple weighted scoring model, a five-step reproducible evaluation workflow with controlled concurrency, four practical cost-optimization levers, and the general cloud capabilities needed to run evaluation and deployment as a closed loop. The reported figures should be treated as configuration-bound snapshots rather than absolute conclusions.
1. Why You Need a Reproducible Evaluation Method
In the early stages of adopting large language models, teams often choose a model based on a “feeling” from a few isolated examples. Only after deployment do they discover large performance swings and uncontrollable costs. The only way to solve this is to turn “is this model good?” into an engineering problem that is measurable, reproducible, and comparable.
A sound evaluation plan must answer at least four questions: how many answers are correct (effectiveness), how long you wait (latency), how many resources are consumed (resources), and how much money is spent (cost). Together these four dimensions define a model’s overall cost-performance ratio, and no single metric is enough to support a decision.
It is worth stressing that evaluation data is not transferable across scenarios. A 71.5% accuracy measured on a set of roughly 15,000 questions only describes performance under that specific question set, that prompt, and that parameter configuration. Change the question bank or rephrase the questions, and the number will inevitably drift. For this reason, an evaluation report must be archived together with its configuration.
2. The Engineering Meaning of Four Core Metric Categories
2.1 Accuracy: The Primary Effectiveness Metric, but Check the Denominator
Accuracy is the number of correct answers divided by the total number of questions. With roughly 15,000 questions and 71.5% accuracy, about 10,700 questions passed. In real projects, it is advisable to break this down further: overall accuracy, per-capability accuracy (reasoning, code, extraction, multi-turn), and refusal rate and format compliance rate. The last two are often overlooked, yet they directly affect downstream parsing success.
2.2 Average Latency: 96 Seconds Signals a Heavy Reasoning Workload
An average of 96 seconds per call is a typical signature of a “long-thinking” workload, usually corresponding to complex reasoning or long-context scenarios. Note that the average hides the long tail, so you should also track P50, P90, and P99. If P99 reaches more than three times the mean, an asynchronous redesign is more cost-effective than switching models.
2.3 Average Tokens: 3,922 Is the Basis for Cost Estimation
This value includes both input and output. For capacity planning, you can estimate total throughput as “question volume × average tokens,” then apply an amplification factor for retries and multi-turn interactions (empirically 1.2–1.5x).
2.4 Average Cost: How to Read 52.5 CNY per 1,000 Calls
This is a normalized composite metric that makes horizontal comparison easy, but it already couples unit price with token usage. When you actually build a budget, you should decompose it back into “unit price × token volume”; otherwise you cannot tell whether the optimization direction should be compressing prompts or switching tiers.
3. How the Metrics Interact
The four metrics are not independent. Increasing reasoning depth usually raises both latency and token consumption at the same time; compressing prompts can lower cost but may also reduce accuracy. You can use a simplified cost-performance model to rank options:
# Illustrative: composite cost-performance score; weights must be calibrated per business scenariodef score(acc, p90_latency, tokens, cost_per_1k, w=(0.4, 0.2, 0.15, 0.25)):return (acc * w[0]- min(p90_latency, 120) / 120 * w[1]- min(tokens, 8000) / 8000 * w[2]- min(cost_per_1k, 200) / 200 * w[3])
The weights must be determined by the scenario: online customer service prioritizes latency, while offline batch processing prioritizes cost and accuracy.
4. A Reproducible Evaluation Workflow
- Freeze the question set and its version number, and store the questions, reference answers, and scoring rules together.
- Fix the inference parameters (temperature, maximum output length, context window) and record them in the report.
- Use concurrency-controlled invocation to avoid rate limiting distorting latency statistics.
- Classify and attribute failed samples, distinguishing insufficient capability, unclear prompts, and format errors.
- Produce a structured report containing means and percentiles, a cost breakdown, and failure examples.
# Illustrative: metric collection skeleton under controlled concurrencyresults = []for batch in chunked(dataset, size=8):with ThreadPoolExecutor(max_workers=8) as pool:futures = [pool.submit(call_model, item) for item in batch]for f in futures:r = f.result() # includes output, latency, token usageresults.append(r)report = summarize(results) # accuracy, P50/P90/P99, cost
5. Four Levers for Cost Optimization
- Prompt slimming: remove repeated background and replace long descriptive paragraphs with structured templates.
- Tiered routing: send simple requests to a lightweight tier and complex requests to a heavy-reasoning tier.
- Cache reuse: build a semantic cache for high-frequency repeated questions.
- Output constraints: cap the maximum output length and enforce structured formats to reduce wasted tokens.
6. General Capability Combination for Cloud Deployment
Evaluation and deployment typically require a set of general cloud product capabilities working together: object storage to hold question sets and reports, a message queue to smooth peaks and fill valleys for batch calls, a container platform to host the evaluation harness and inference gateway, a logging service to retain call details, and monitoring with alerting thresholds on latency and failure rate. Baidu AI Cloud offers the general capability categories above, on which such a closed loop can be built.
7. Conclusion
The 71.5% accuracy, 96-second average latency, 3,922 average tokens, and 52.5 CNY per 1,000 calls should be treated as a set of “snapshots with configurations” rather than absolute conclusions. What developers need to build is an evaluation system in which question sets are reproducible, metrics are decomposable, and costs are attributable. Only on top of such a system do model selection and optimization gain engineering certainty.
