LLM Evaluation Guide: From Capability Metrics to Production Model Selection
This guide explains how to evaluate next-generation large language models with a repeatable, business-driven process. It covers evaluation dimensions such as reasoning, multimodal understanding, code generation, instruction following, latency, throughput, and cost; shows how to build reliable evaluation sets and automate test runs; and provides practical guidance for interpreting results, avoiding common pitfalls, and supporting production model selection.
1. Why Systematic Evaluation Matters
When a new model is released, leaderboard rankings, curated demos, and subjective reviews often appear. These signals are useful, but they have three limitations. First, different leaderboards use inconsistent testing criteria and versions, so scores are difficult to compare directly. Second, public question sets may overlap with training data, which can inflate scores. Third, a single demo cannot reflect model stability under a large volume of requests.
What enterprises really care about is accuracy on their own tasks, response speed, cost per task, and risk behavior. Evaluation should therefore start from business problems, form a repeatable process, and record results for later comparison.
2. Evaluation Dimensions
2.1 General Reasoning
General reasoning covers mathematical calculation, logical judgment, common-sense understanding, and multi-step reasoning. It is recommended to divide questions into easy, medium, and hard levels and calculate pass rates separately. Looking only at the total score can easily hide weaknesses on hard samples.
2.2 Multimodal Understanding
If the business involves screenshots, charts, receipts, or product images, visual capabilities need to be evaluated separately. Focus on the following:
- Element recognition: whether the model can accurately find key elements such as text, buttons, and values in an image.
- Information extraction: whether it can convert chart data into structured fields.
- Spatial and relational judgment: whether it can correctly understand position, hierarchy, and sequence.
Aesthetic judgments are highly subjective. It is recommended to invite multiple reviewers to score independently and calculate inter-reviewer consistency, for example using simple agreement rate or correlation coefficients. If disagreement is too large, revise the scoring criteria before drawing conclusions.
2.3 Code Generation and Modification
Code capability can be divided into three metrics:
- The proportion of generated code that runs on the first attempt.
- The proportion that passes unit tests.
- Whether modifications to existing code break original functionality.
The last item is often overlooked. Good performance when generating a new function does not mean the model can safely modify a complex legacy codebase. The evaluation set should include two types of tasks: “add functionality to existing code” and “fix a known defect.”
2.4 Instruction Following and Format Stability
Many production systems require the model to output a fixed format, such as JSON, tables, or text with specific fields. Evaluation should check:
- Whether the output can be read directly by a parser.
- Whether required fields are present and field types are correct.
- Whether constraints such as word count, tone, and prohibited words are followed.
Format errors often cause production failures more easily than content errors, so format pass rate should be calculated separately.
2.5 Latency and Throughput
Latency usually includes time to first token and total response time. In concurrent scenarios, queue time and timeout rate also need to be observed. It is recommended to record median (P50), 95th percentile (P95), and timeout rate separately, because averages are easily skewed by a small number of extreme requests.
2.6 Cost
LLMs are usually billed by the number of input and output tokens. A lower unit price does not necessarily lead to lower total cost. When comparing costs, use the same batch of tasks as the baseline, calculate the total cost of completing all tasks, and include retries, manual review time, and fallback handling in the cost.
3. Building an Evaluation Set
The quality of the evaluation set directly determines the credibility of the conclusions. It is recommended to build it in the following steps:
- Sample from real business logs and complete de-identification to remove personal information and sensitive fields.
- Prepare 50 to 200 samples for each task type, covering both common cases and edge cases.
- Define scoring criteria for each sample. For tasks that can be scored automatically, prefer programmatic scoring, such as unit tests, regex matching, and format validation.
- Use double-blind review for subjective tasks, hide model identity, and record reviewer disagreement rate.
- Reserve a portion of samples that are not used for any prompt tuning and serve only as the final validation set.
4. Automated Evaluation Workflow
The following is a service-agnostic evaluation framework example. call_model is an invocation function implemented by the user and can connect to any inference interface that meets the requirements.
import jsonimport timefrom dataclasses import dataclassfrom statistics import meanfrom typing import Callable@dataclassclass Case:prompt: strchecker: Callable[[str], bool] # Takes model output and returns whether it passesdef run_suite(call_model: Callable[[str], str], cases: list[Case]) -> dict:results = []for case in cases:start = time.perf_counter()output = call_model(case.prompt)latency = time.perf_counter() - startresults.append({"passed": case.checker(output), "latency": latency})latencies = sorted(r["latency"] for r in results)return {"total": len(results),"pass_rate": round(mean(r["passed"] for r in results), 4),"p50_latency_s": round(latencies[len(latencies) // 2], 3),"p95_latency_s": round(latencies[int(len(latencies) * 0.95) - 1], 3),}def has_required_json_fields(output: str, fields: list[str]) -> bool:"""Check whether the output is valid JSON and contains all required fields."""try:data = json.loads(output)except json.JSONDecodeError:return Falsereturn isinstance(data, dict) and all(f in data for f in fields)
When using it, write a corresponding checker for each sample. For example, for format tasks, call has_required_json_fields; for code tasks, execute unit tests and return the result.
4.1 Process Essentials
The complete process can be divided into five stages:
- Prepare: fix the evaluation set version and record the label for each sample.
- Run: use a unified prompt template, temperature parameter, and maximum output length, and record the model version and invocation date.
- Repeat: generation is stochastic, so each sample should run at least 3 times; take the mean and observe variance.
- Compare: place the results of old and new models in the same table and display them by task category.
- Archive: save raw outputs and scoring results for later review.
4.2 Version and Parameter Logging
If evaluation results lack environment information, they are difficult to reproduce. Each run should record the model version, prompt version, sampling parameters, evaluation set version, and run time. This information can be stored in ordinary structured logs or data tables. The cost is low, but it is very useful after model updates.
5. Interpreting Results and Common Pitfalls
5.1 Leaderboard Scores Cannot Directly Replace Business Metrics
Leaderboards measure general capabilities, while business systems care about accuracy and stability on specific tasks. The two are related but not equivalent.
5.2 Average Scores Can Hide Long-Tail Failures
The average pass rate may be high, but a critical scenario may continue to fail. Review pass rates by task type as well as the distribution of failed samples.
5.3 Small-Sample Differences May Be Noise
If two models differ by only a few percentage points and the sample size is only a few dozen, the conclusion may be unstable. Increase the sample size or calculate confidence intervals before judging whether the difference is reliable.
5.4 Prompts Significantly Affect Results
The same model may produce clearly different results with a different prompt set. When comparing models, use the same prompt template and record all variables.
5.5 Public Question Sets May Have Been Seen
Public question sets may already be in training data, leading to inflated scores. Private business data better reflects real performance and should therefore be the primary basis for model selection.
6. Implementation Recommendations
6.1 Canary Rollout
Run the new model on a small proportion of traffic first, and compare key online metrics such as task completion rate, manual correction rate, and user satisfaction. Expand gradually after confirming there is no obvious regression.
6.2 Design a Fallback Plan
Model services may time out, rate-limit, or return exceptions. The system should prepare a backup model or rule-based fallback logic and define a clear handling path for each type of failure.
6.3 Establish Continuous Regression
Whenever the model version is updated, prompts are changed, or the evaluation set is expanded, regression tests should run automatically. This helps detect hidden regressions in time.
6.4 Pay Attention to Data Compliance
During model selection, confirm the following:
- Whether input data will be used for model training and how the relevant terms specify this.
- Whether data storage location, retention period, and transmission encryption meet internal policies.
- Whether data deletion requests are supported and whether audit logs are complete.
6.5 Selection Scorecard
Weights can be assigned to the following six items and scored: capability, stability, latency, cost, compliance, and controllability. Weights are determined by business priorities. For example, customer-facing real-time scenarios may place more emphasis on latency and stability, while offline batch processing scenarios may focus more on cost. The value of a scorecard is that it makes the decision process explainable and traceable.
7. Conclusion
New model releases bring more choices and more noise. Building a business-driven, repeatable evaluation system can turn subjective judgment into verifiable data. This system includes clear dimension definitions, a reliable evaluation set, an automated execution workflow, and rigorous methods for interpreting results. Decisions made by teams on this basis will be more robust than simply following leaderboards and easier to optimize continuously as models iterate.
