How to Scientifically Evaluate Real LLM Capabilities and Select the Right Model
Public leaderboards, community opinions, and ad hoc testing each provide only a partial view of LLM capability. This article presents a practical, business-oriented evaluation system covering capability and engineering dimensions, reproducible benchmarks, layered test cases, cost accounting, scenario-based routing, and continuous evaluation automation.
As models iterate rapidly, developers often face a practical question: how can we objectively assess a large language model? Public leaderboards, community discussions, and hands-on impressions each have limitations, and relying on a single perspective can easily lead to one-sided conclusions. What is the best way to evaluate a large language model? What are the common evaluation mistakes? A more reliable approach is not to chase an abstract ranking, but to build a reproducible, regression-friendly evaluation system around business tasks and multiple dimensions. This article starts from the difficulties of evaluation and provides a practical method for developers and enterprises.
1. Why model evaluation is harder than it looks
1. Subjective impressions are heavily affected by prompts. Many judgments come from a few casual attempts. If prompts are poorly organized, the output may seem mediocre; if the prompt includes clear role settings, task constraints, and output format requirements, the same model may perform very differently. A conclusion of “good” or “bad” based on a small number of samples is difficult to generalize.
2. Models have different positioning. Some models are better at divergent association and knowledge completion, making them suitable for brainstorming, idea expansion, and creative screening. Others are more stable in complex reasoning and multi-step execution, but may generate output more slowly. Comparing them only by subjective feeling is like measuring two different tools with the same ruler.
3. Speed differences can mask quality differences. In scenarios with large differences in generation speed, users often prefer the faster model. The experience advantage brought by speed may lead to the mistaken conclusion that the model is “more capable.” Response speed is an important metric, but it cannot replace quality evaluation.
4. Quota and cost need to be considered. Under subscription quota or usage-based pricing, a difficult question that requires repeated reasoning and long output may consume a significant portion of the monthly quota. “Whether it is worth using” also depends on cost investment.
5. Public benchmark data may be contaminated. Some public test data may already be present in training corpora, causing models to score artificially high on public question sets. Real capability evaluation should avoid relying only on public question sets, especially widely circulated older questions.
Therefore, model evaluation should return to the task itself and build a dimension-based, reproducible evaluation system linked to business scenarios.
2. Building a multi-dimensional evaluation system: from capability to engineering checklist
Evaluation dimensions can be divided into capability and engineering. For practical implementation, each dimension can be broken down into “metric, sample size, pass threshold, and owner.”
| Dimension | Key metrics | Suggested sample size | Example pass threshold | Owner |
|---|---|---|---|---|
| Content quality and divergent ability | Structural completeness, novelty of ideas, factual accuracy, readability | 60 to 120 items | Usability rate >= 85%, severe factual errors < 2% | Product and algorithm |
| Complex reasoning ability | Correctness of long-chain reasoning, stability, self-verification ability | 100 to 300 questions | Verifiable correctness >= 70%, or not lower than 95% of baseline | Algorithm evaluation |
| Code and execution ability | Functional correctness rate, unit test pass rate, format compliance rate | 100 to 200 questions | Unit test pass rate >= 65%, format compliance rate >= 95% | Engineering and testing |
| Long-context handling and instruction following | Long-document extraction, multi-constraint compliance, structured output | 30 to 80 items | Critical constraint satisfaction rate >= 90% | Business expert |
| Reliability and safety | Factual errors, handling of ambiguous questions, refusal boundaries, risky content | 30 to 100 items | Zero high-risk outputs, refusal accuracy >= 90% | Security and compliance |
| Performance | Time to first token, generation speed, long-context throughput, concurrency stability | Load test scripts | Meets business P95 latency and error-rate requirements | Platform engineering |
| Cost | Cost per 10,000 effective tasks, retry rate, manual correction cost | Sampling by call volume | Below business cost ceiling | Finance and architecture |
Among capability dimensions:
- Content quality and divergent ability is suitable for writing, summarization, and first drafts of proposals.
- Complex reasoning ability is more suitable for tasks such as mathematics, logic, policy analysis, and fault localization.
- Code and execution ability should focus on unit test pass rate and tool-call success rate.
- Long-context handling and instruction following should test whether the model can produce stable structures under multiple constraints.
- Reliability and safety should focus on how the model handles ambiguous questions, leading questions, and sensitive scenarios.
Engineering dimensions are equally important. Even if a model has strong capabilities, it is difficult to bring into production if it has high first-token latency, insufficient concurrency capability, or excessive unit cost.
3. Building a layered evaluation set: auto-verifiable, semi-objective, and subjective preference
The evaluation set can be organized into three layers to balance executability and business relevance.
1. Auto-verifiable layer
This layer is mainly composed of math problems, logic reasoning problems, and programming problems with unit tests. These tasks have clear answers or executable verification logic and are suitable for large-scale regression testing.
It is recommended to prepare at least 100 questions for each core capability direction. If the model deployment decision has higher risk, the sample size can be expanded to 200 to 300 questions. The difficulty distribution can be approximately “30% easy, 50% medium, 20% hard,” and different question types should be covered to avoid conclusions being dominated by a few extreme cases.
2. Semi-objective layer
Factual question answering and data analysis tasks are suitable for semi-objective evaluation. Based on a reference answer, scoring can combine keyword matching, semantic similarity, or human spot checks.
Each category is recommended to have no fewer than 50 items. If enterprise knowledge bases are involved, desensitized real business questions should be used instead of relying entirely on public question-answer sets.
3. Subjective preference layer
Tasks such as writing, brainstorming, and copy polishing are more suitable for pairwise comparison. A “choose between Model A and Model B” approach can be used, with domain experts or a stronger model acting as the judge, supported by human spot checks for calibration.
The sample size for the subjective preference layer does not need to be large, but review rules and display order must be fixed. At least two reviewers per task are recommended to avoid conclusions being affected by one person’s preference.
4. Suggested fields for evaluation cases
Evaluation files can be placed at eval/cases/task_bench.jsonl, with one JSON object per line. Example fields are as follows:
{"id":"math_001","type":"unit_test","difficulty":"hard","tags":["math","proof"],"prompt":"Prove the statement and output the conclusion","tests":"test_math_001"}
{"id":"fact_010","type":"reference","difficulty":"medium","tags":["knowledge"],"prompt":"Answer the business question","reference":"reference answer"}
{"id":"write_020","type":"preference","difficulty":"easy","tags":["writing"],"prompt":"Write a product introduction","reference":""}
Here, type determines the scoring method: unit_test goes to the auto-verifiable layer, reference goes to the semi-objective layer, and preference goes to the subjective preference layer.
5. Preventing data contamination
For enterprise self-testing, private questions should be used as much as possible, or questions should be constructed from real business data. For frequently used public question sets, the prompt wording can be adjusted, data can be replaced, parameters can be changed, or new constraints can be introduced.
Evaluation results should also be recorded together with model version, sampling parameters, evaluation date, and prompt version, so that they can be reproduced and compared over time.
4. Reproducible evaluation method: unified protocol and revised example script
To make evaluation executable, the runtime directory, input file format, and dependencies need to be fixed. A suggested directory structure is as follows:
eval/├── cases/│ └── task_bench.jsonl├── run_eval.py└── report.json
Runtime dependencies should be kept to basic libraries only. Model-calling functions should be integrated as external interfaces and should not be hard-coded. The example below has been adjusted to read JSONL line by line and include placeholder functions so that it can run without immediate errors.
import jsonimport statisticsfrom pathlib import PathBASE_DIR = Path(__file__).resolve().parentCASES_FILE = BASE_DIR / "cases" / "task_bench.jsonl"REPORT_FILE = BASE_DIR / "report.json"def call_model_stub(name: str, prompt: str) -> str:"""Minimal placeholder: the script can run, but replace this with a real model call before formal evaluation."""return ""def call_model_a(prompt: str) -> str:"""Placeholder for external model A; replace with an API or local inference service."""return call_model_stub("modelA", prompt)def call_model_b(prompt: str) -> str:"""Placeholder for external model B; replace with an API or local inference service."""return call_model_stub("modelB", prompt)def run_unit_tests(answer: str, tests: str) -> float:"""Placeholder scoring function: execute tests and return the pass rate in a real environment."""return 0.0def semantic_similarity(answer: str, reference: str) -> float:"""Placeholder scoring function: replace with vector-based similarity, rule matching, or human rating."""return 0.0def human_or_llm_preference(task: dict, answer: str) -> float:"""Placeholder for subjective preference scoring: integrate human review or pairwise comparison."""return 0.0def load_cases():cases = []with CASES_FILE.open("r", encoding="utf-8") as f:for line in f:line = line.strip()if line:cases.append(json.loads(line))return casesCASES = load_cases()JUDGES = {"modelA": call_model_a,"modelB": call_model_b,}def judge(task, answer):"""Select the scoring method by task type and return a score between 0 and 1."""if task["type"] == "unit_test":return float(run_unit_tests(answer, task.get("tests", "")))if task["type"] == "reference":return semantic_similarity(answer, task.get("reference", ""))return human_or_llm_preference(task, answer)def evaluate(name, fn, k=3):"""Sample each question multiple times and average the scores to reduce randomness."""if not CASES:return {"model": name, "avg_score": 0.0, "samples": []}scores = []for case in CASES:task_scores = [judge(case, fn(case["prompt"])) for _ in range(k)]scores.append(statistics.mean(task_scores))return {"model": name,"avg_score": statistics.mean(scores),"samples": scores,}if __name__ == "__main__":report = [evaluate(name, fn) for name, fn in JUDGES.items()]with REPORT_FILE.open("w", encoding="utf-8") as f:json.dump(report, f, ensure_ascii=False, indent=2)
The core of this script is a reproducible protocol: fixed sampling parameters, multiple samples for the same question, and automatic scoring by task type. In actual use, teams should replace call_model_stub with real model calls and record information such as model name, version, temperature, maximum output length, and evaluation date.
5. Deep evaluation of reasoning: avoid superficially high scores with verifiable tasks
Complex reasoning is a key scenario for distinguishing model capability. Compared with simple question answering, difficult reasoning tasks are better at revealing whether a model has independent reasoning, self-verification, and resistance to perturbation.
A suggested task template is as follows:
Question: Find one zero of the function f(x) = x^3 - 2x + 0.5 in the interval [0, 1]. The model is required to output runnable Python bisection code and report the final interval or approximate root, with error controlled within 1e-5.
Expected result: The model should output executable code and provide an approximate root or interval that meets the error requirement.
Automatic verification method:
- Run the Python code generated by the model.
- Check whether the output satisfies
f(a) * f(b) <= 0. - Check whether the final interval width is smaller than
1e-5. - Check whether an approximate root is explicitly output.
- If intermediate steps are present, check whether the iteration logic is fully recorded.
Trap conditions:
- Only explaining theoretical existence without providing executable code.
- Outputting a hard-coded answer without showing the calculation process.
- Incorrect interval endpoints, causing the bisection method not to converge.
- Ignoring the error requirement.
- Failing to adjust the strategy correctly after parameters are slightly changed.
To make evaluation more credible, the following principles are recommended:
- Prioritize verifiability: Prefer tasks that can be verified by code execution, unit tests, or automated theorem-proving tools.
- Design difficulty in layers: Progress from standard questions to frontier questions, and observe how model scores change across different difficulty levels.
- Preserve intermediate processes completely: If chain-of-thought visibility is enabled, the reasoning process should be preserved and reviewed completely. A correct conclusion does not necessarily mean the process is reliable.
- Add traps and perturbations: Introduce conditions that are easy to misuse, or slightly adjust parameters to test whether the model can recognize changes in assumptions.
6. Speed, cost, and stability: use measured criteria instead of verbal conclusions
Generation speed and usage cost directly affect user experience and return on investment. Since models, hardware, context length, concurrency, and quantization precision can vary significantly, it is unreasonable to claim that “a certain model is absolutely faster” without conditions. A more reasonable approach is to specify measurement criteria: model version, hardware type, inference precision, input length, output length, batch size, concurrency level, and caching strategy.
Performance evaluation should cover the following metrics:
| Metric | Meaning | Focus |
|---|---|---|
| Time to first token | Time from request submission to return of the first token | Directly affects interaction smoothness |
| Generation speed | Number of tokens output per second | Determines waiting time for long-form generation |
| Long-context performance | Throughput changes as context length increases | Whether long-document tasks are usable |
| Concurrency stability | Latency and error rate under high concurrency | Production environment capacity |
Cost and stability should also not be ignored. Many teams only look at “price per million tokens,” but real cost also includes retries, failed tasks, manual correction, and operations investment. It is recommended to calculate based on “cost per 10,000 effective tasks.”
A practical cost formula is as follows:
cost per 10,000 effective tasks = 10000 × [(base call cost + retry cost + manual correction cost) / effective task ratio]
Where:
- Base call cost: average input token cost plus output token cost per call.
- Retry cost: additional call cost caused by failures, timeouts, or output quality below the threshold.
- Manual correction cost: average cost of manual spot checks, rewriting, fixing, or reviewing.
- Effective task ratio: proportion of tasks that ultimately pass acceptance criteria.
Example: If the average input is 800 tokens and output is 1200 tokens, the input price is 0.000001 CNY/token, the output price is 0.000002 CNY/token, the effective task ratio is 90%, and the average manual correction cost is 0.2 CNY per effective task, then:
Base call cost = 800 × 0.000001 + 1200 × 0.000002 = 0.0032 CNYManual correction cost = 0.2 CNYCost per effective task = (0.0032 + 0.2) / 0.9 ≈ 0.2258 CNYCost per 10,000 effective tasks ≈ 2258 CNY
This criterion is closer to real expenditure than simply comparing token prices.
For stability, timeout, rate limiting, and fallback strategies should be set. If output is unreliable, retry promptly or switch to a backup model to ensure business continuity.
7. Scenario-based selection and hybrid routing strategy
“Which model is the best?” is not a good question. “Which model is most suitable for this scenario?” is a better one. In practice, tiered routing can be used: simple, latency-sensitive tasks can be assigned to faster models, while complex reasoning tasks can be assigned to stronger but slower models.
| Typical scenario | Core need | Selection focus |
|---|---|---|
| Brainstorming and idea screening | Divergence and response speed | Models with fast generation and natural expression; sample multiple times and select the best |
| Complex reasoning and math proofs | Correctness and reliable derivation | Models with strong reasoning ability, supported by chain-of-thought and self-verification |
| Code generation and agent execution | Functional correctness and format compliance | Models with high unit test pass rates and tool-call success rates |
| Batch data processing | Throughput and cost | Self-hostable models or cost-effective inference services |
A routing policy example is as follows:
routing_policy:default: fast_modelescalate:- when: task_type in ["complex_reasoning", "long_document_analysis"]model: strong_modelfallback:- model: fallback_model- action: notify_and_queue
For enterprises with large traffic fluctuations and limited operations resources, using a managed inference service is more practical. Through containerized inference platforms, resources can scale elastically, and logs, monitoring, and alerting systems can continuously track latency, error rates, and quality metrics. This article does not specify any vendor; selection should comprehensively consider compliance, data boundaries, service levels, and total cost.
Self-hosted models also have value: data can remain within the enterprise domain, costs are predictable, and deep customization is possible. However, self-hosting means taking responsibility for cluster operations, capacity planning, and version upgrades. Whether it is worthwhile should be calculated based on call volume and resource budget.
8. Evaluation automation: making assessment a continuous process
Because large models iterate frequently, a one-time evaluation conclusion will quickly become outdated. The evaluation system itself also needs to be engineered.
- Version evaluation sets: Evaluation cases and scripts should be managed in code repositories and updated in sync with business requirements.
- Continuous integration: Before a new model version or prompt is released, automatically run a regression round, compare key metrics, and set thresholds. For example: “complex reasoning correctness must not be lower than 95% of the previous version” and “P95 latency must not exceed 120% of the baseline.”
- Online quality feedback: Sample online sessions for automatic scoring, then conduct regular human review, so that the evaluation set stays close to the real distribution.
- Cost monitoring: Combine token usage and call statistics to evaluate the impact of model upgrades on total cost.
In the online quality feedback process, compliance requirements must be taken seriously:
- Desensitize personal information, sensitive business fields, and secrets in logs.
- Control access to evaluation data according to the principle of least privilege.
- Establish audit logs to record who accessed which evaluation samples and when.
- Define log retention periods and comply with enterprise security standards and applicable laws and regulations.
- Train human reviewers to avoid secondary leakage of sensitive information in evaluation materials.
If evaluation automation lacks these governance measures, even if technical indicators meet requirements, it may still introduce data security risks.
9. Conclusion
Evaluating large models cannot rely only on a leaderboard or a few conversations. A more reliable approach is to build a business-aligned evaluation set across multiple dimensions, including divergent creation, complex reasoning, code execution, long-context instruction following, response speed, and cost stability, then test repeatedly under a unified protocol and make scenario-based selections with hybrid routing.
Models do not have absolute superiority or inferiority; the key is whether they match the task. For developers and enterprises, a continuously running, quantifiable, and regression-friendly evaluation system is often more valuable than any single leaderboard.
