How to Build an LLM Evaluation System: From Benchmark Rankings to Reliable Model Selection

    This article explains how to design and operationalize an evaluation system for Chinese large language models (LLMs), moving beyond public leaderboard rankings toward reliable, business-driven model selection. It first clarifies what benchmark scores and rankings actually mean, then walks through building a trustworthy evaluation set (capability dimensions, question mix, difficulty tiers, annotation quality control, and defenses against data contamination), scoring results reproducibly with layered methods, repeated sampling, dimension weighting, and bootstrap confidence intervals with tie rules. It then covers five common pitfalls that inflate or distort results, a five-step path to building an in-house scenario-based evaluation system (with reference Python code for the pipeline and regression gates), and a selection workflow that turns evaluation results into engineering decisions. Readers will find an actionable methodology with runnable code examples.

    Introduction: From Leaderboard Rankings to an Evaluation System

    Chinese LLM capability leaderboards are refreshed continuously, and every new round of results sparks heavy discussion. Three questions always draw the most attention: who ranks at the top, how much the scores changed, and whether any models are “tied for first.” In the benchmark round that prompted this discussion, three candidate models finished within less than one point of each other on total score; under the scoring rules, they were treated as tied for the lead. Compared with the previous version, some models gained more than ten points on the total score, which is a clear jump on this scale.

    For developers and technical decision-makers, these results are certainly worth watching. But the more valuable question is: what do leaderboard scores actually mean? How can you tell whether a gap between two models is real or just evaluation noise? And how should an organization turn “capability on a leaderboard” into “reliability in production”? This article focuses on LLM evaluation. It first clarifies the statistical meaning behind scores and rankings, then systematically covers evaluation-set construction, common pitfalls, a practical path to building an in-house evaluation system, and selection guidance, aiming to produce a reference methodology you can act on.

    1. What Rankings Tell You: From Rank to Capability Structure

    A leaderboard is a snapshot of model capability, and its value shows up in three main ways:

    • Cross-sectional positioning: Under one set of questions and one scoring standard, candidate models can be measured uniformly, which provides a basis for initial screening.
    • Longitudinal tracking: Comparing against historical versions reveals the direction of capability evolution and the gains or regressions introduced by a particular update.
    • Weakness exposure: Per-dimension results surface structural differences in knowledge, reasoning, coding, long-text handling, and other abilities.

    At the same time, you need to stay clear-eyed about the limits of a leaderboard:

    • Aggregation hides differences: The total score is a weighted summary across dimensions. A model that is strong at reasoning but weak at instruction-following and a well-balanced model can land on nearly the same total, yet behave very differently in a specific business use case.
    • Limited evaluation set: Any evaluation set is only a finite sample of the real capability space. The distribution, difficulty, and phrasing of questions all affect the result.
    • Moving versions: Top models iterate faster than ever. A leaderboard only reflects the state of a model at the moment of measurement; it does not represent the sustained behavior of the online service afterward.
    • Scores carry error: Question sampling, scoring standards, and the randomness of generation all introduce variance into every score.

    So, more important than the ranking itself is understanding three things: how the evaluation set is built, how scores are computed, and whether a difference is statistically significant. The following sections take these up in turn.

    2. Building the Evaluation Set: The Foundation of Credibility

    The credibility of any evaluation conclusion depends first on the questions themselves. A well-designed Chinese LLM evaluation set generally needs solid design across several layers.

    2.1 Breaking Down Capability Dimensions: Covering the Real Capability Space

    LLM capability cannot be captured by a single metric. Common dimension breakdowns include:

    • Language understanding and generation: semantic understanding, ambiguity resolution, summarization, rewriting and polishing, style transfer;
    • Knowledge Q&A: general knowledge, humanities and social sciences, science and technology, and domain-specific expertise;
    • Logical reasoning and math: deductive and inductive reasoning, multi-step computation, word-problem solving;
    • Instruction-following and structured output: format control under complex constraints, field extraction, generation of structured results such as JSON;
    • Coding and technical Q&A: code generation, completion, bug localization and repair;
    • Long-text and multi-turn dialogue: locating and integrating information in long documents, resolving references and maintaining context across turns;
    • Chinese-specific capabilities: idioms and allusions, classical poetry, literary Chinese, dialect expressions, and pragmatic conventions in Chinese-language contexts;
    • Safety and values: identifying harmful content, handling sensitive topics, and robustness of responses.

    The dimension breakdown should be tailored to the business scenario. A document-processing system, for example, should weight long-text handling and structured output more heavily, while a customer-service assistant should focus more on instruction-following, tone control, and factual accuracy. Ignoring this trade-off and selecting on a generic total score alone often leads to models that underperform in real applications.

    2.2 Question Mix and Difficulty Tiers

    An evaluation set is usually made up of two kinds of questions:

    • Objective questions: single-choice, true/false, fill-in-the-blank, and extractive tasks. Answers are unique or enumerable, so they suit automated grading at scale and are statistically more stable.
    • Subjective questions: open-ended Q&A, long-form writing, creative generation, and code writing. These are closer to real usage but require a scoring rubric and human or model judges.

    For difficulty, it helps to split questions into three tiers: basic, intermediate, and advanced. Basic questions check the capability floor and provide regression protection; intermediate questions correspond to typical everyday business requests; advanced questions test the model under complex, multi-constraint conditions and are used to widen the gap between candidate models. If the share of advanced questions is too low, several models tend to cluster in the same score band and become hard to tell apart; if it is too high, scores are generally low, discrimination is poor, and results are unstable. A common practice is to make basic and intermediate questions the main body, supplemented by a certain proportion of advanced questions.

    2.3 Annotation Process and Quality Control

    Question quality depends on the annotation process. The following quality-control practices are common in the industry:

    1. Write annotation guidelines: define what each question tests, the answer standard, and the scoring points, reducing interpretation differences among annotators;
    2. Cross-annotation by multiple people: have two or more annotators independently complete key questions, then review and arbitrate cases of disagreement;
    3. Consistency measurement: track inter-annotator agreement metrics to monitor whether annotation quality stays stable;
    4. Periodic review and revision: as the business evolves, continuously remove questions with outdated phrasing, disputed answers, or low discrimination;
    5. Keep a private evaluation set: do not fully publish the core questions, to avoid targeted optimization that turns evaluation into memorization.

    2.4 Guarding Against Data Contamination

    Data contamination is a prominent problem for public evaluations. Pre-training corpora are enormous, and once public questions and their answers spread widely online, they can end up “learned” into a later model’s training data, inflating its score. Common mitigation strategies include:

    • Rotating the question bank: periodically introduce new questions to replace ones a model may have memorized;
    • Generating question variants: rewrite phrasing, swap entities, or adjust values while keeping the tested point unchanged, and observe whether model performance stays stable;
    • Release-time isolation: record when the evaluation set was released and cross-reference it with the model’s training-data cutoff;
    • Private evaluation: keep the core evaluation set internal to the organization and use it as the final basis for selection and regression;
    • Contamination detection: compare evaluation questions against corpora the model may have accessed using similarity or n-gram overlap to flag high-risk questions.

    3. Scoring and Tie Determination: Making Scores Comparable and Trustworthy

    3.1 Layered Scoring: Match the Grading Method to the Question Type

    Different question types call for matching grading methods:

    • Objective questions: use exact match or rule-based matching. When answers accept synonyms and multiple equivalent phrasings, apply a predefined mapping table for normalization.
    • Structured output: first check whether the result parses correctly (for example, whether it is valid JSON), then verify field by field whether fields are present and values satisfy constraints, and score by pass ratio.
    • Open-ended questions: use blind human evaluation or a model judge. Before scoring, provide clear scoring dimensions and point allocation—for example, accuracy, completeness, organization, and Chinese-language expression, each with a set weight.

    Scoring should be as reproducible as possible: fix generation parameters (such as temperature), retain complete logs of generated outputs, and anonymize the judging process with randomized ordering to reduce position-bias effects.

    3.2 Repeated Sampling and Dimension Weighting

    LLM output carries randomness, so a score from a single sample may be affected by chance. In practice, each question is often run multiple times independently and the results averaged, which reduces variance and improves stability. For aggregation, compute the average score within each dimension first, then apply predefined weights to obtain the total, so that a dimension with many questions does not dominate the final result.

    3.3 Understanding “Differences” with Confidence Intervals and Tie Rules

    Even with repeated sampling, the total score is still an estimate with error. Common quantification methods include:

    • Bootstrap confidence intervals: treat the evaluation samples as a sample from the population, perform many resampling rounds with replacement, compute the mean each time, and derive an approximate interval for the mean distribution;
    • Reporting standard error or confidence intervals: present the total as “mean ± interval” rather than as an isolated number;
    • Tie rules: when the score gap between two models is smaller than a predefined tolerance, treat them as statistically indistinguishable and present them as tied.

    In the example that prompted this discussion, the three models scored 61.61, 61.46, and 61.01. The gap between the highest and lowest is only 0.60 points, within a 1-point tie tolerance, so they were judged as tied for the lead. This practice is worth borrowing: on a scale of roughly 100 points, 1 point is about 1% of the total, which falls within the range that question-sampling and scoring errors can plausibly affect. Forcing a ranking here easily sends users the false signal of “who is stronger.”

    It is worth adding that a more rigorous tie determination can be combined with confidence intervals. The illustrative implementation below uses the bootstrap to estimate each candidate’s total-score interval; models whose intervals overlap fall into the same tier.

    1. import random
    2. from collections import defaultdict
    3. def bootstrap_ci(scores: dict[str, list[float]], n: int = 2000, alpha: float = 0.05):
    4. """
    5. Estimate the mean confidence interval of each candidate's total score via the bootstrap.
    6. Parameters:
    7. scores: {model_name: [score per evaluation sample, ...]}
    8. n: number of resampling rounds
    9. alpha: significance level; 0.05 corresponds to a 95% confidence interval
    10. Returns: {model_name: {"mean": mean, "lo": lower bound, "hi": upper bound}}
    11. """
    12. results = {}
    13. for name, values in scores.items():
    14. if not values:
    15. continue
    16. size = len(values)
    17. means = []
    18. for _ in range(n):
    19. sample = [values[random.randrange(size)] for _ in range(size)]
    20. means.append(sum(sample) / size)
    21. means.sort()
    22. results[name] = {
    23. "mean": sum(values) / size,
    24. "lo": means[int(n * alpha / 2)],
    25. "hi": means[min(int(n * (1 - alpha / 2)), n - 1)],
    26. }
    27. return results
    28. def rank_with_ties(scores: dict[str, list[float]], n: int = 2000):
    29. """Candidates whose intervals overlap are treated as the same tier (tied)."""
    30. cis = bootstrap_ci(scores, n=n)
    31. ordered = sorted(cis.items(), key=lambda kv: kv[1]["mean"], reverse=True)
    32. tiers = []
    33. for name, ci in ordered:
    34. if tiers and ci["lo"] <= tiers[-1][-1][1]["hi"]:
    35. tiers[-1].append((name, ci))
    36. else:
    37. tiers.append([(name, ci)])
    38. return tiers
    39. if __name__ == "__main__":
    40. random.seed(42) # Fix the random seed so results are reproducible
    41. # Illustrative data: score of each model on the evaluation samples; in practice generated by the pipeline
    42. scores = {
    43. "Candidate A": [0.98, 0.76, 0.62, 0.93, 0.81, 0.67, 0.88, 0.74],
    44. "Candidate B": [0.85, 0.91, 0.57, 0.79, 0.88, 0.69, 0.92, 0.72],
    45. "Candidate C": [0.91, 0.60, 0.86, 0.77, 0.95, 0.63, 0.80, 0.66],
    46. }
    47. for idx, tier in enumerate(rank_with_ties(scores), start=1):
    48. print(f"Tier {idx}: " + ", ".join(
    49. f"{name} (mean={ci['mean'] * 100:.2f}, 95% CI=[{ci['lo'] * 100:.2f}, {ci['hi'] * 100:.2f}])"
    50. for name, ci in tier
    51. ))

    It is important to stress that a tie only means “the current evaluation cannot reliably distinguish the two models”; it does not mean they behave identically in every scenario. Engineering decisions should return to the specific scenario and be validated further with a business evaluation set.

    4. Beyond the Leaderboard: Five Common Pitfalls

    4.1 Inflated Scores from Data Contamination

    As discussed above, public questions can end up in a model’s training data. When a model performs unusually well on an evaluation set but repeatedly stumbles in real business, suspect contamination first, and verify it using question variants, a private evaluation set, and contamination detection.

    4.2 Model Version Drift

    Some model services update the underlying version without visibly changing the name, so the same API can return different behavior at different times. If evaluation results diverge from online behavior, the conclusions lose their reference value. Mitigations include: pinning the model identifier and call parameters in each evaluation record, running regression tests on every change, and continuously sampling production responses to re-check behavior.

    4.3 Prompt Sensitivity

    The same model can produce markedly different results when the prompt is phrased slightly differently. Evaluations that rely on a single prompt template easily over- or underestimate a model’s capability. It is better to include multiple equivalent prompt formats and to examine how well the model follows format constraints, role settings, and system prompts.

    4.4 Generation Randomness and Non-Reproducibility

    Even with the temperature parameter set to 0, factors such as parallel computation and server-side scheduling mean outputs are not guaranteed to be identical. Evaluations must fix parameters, retain raw outputs, and express the uncertainty of results through repeated sampling and confidence intervals, rather than reporting a “precise” single-point score.

    4.5 Leaderboard Orientation Disconnected from Capability

    If a team treats the leaderboard score as its only goal, it can drift toward “targeted optimization” or even overfitting, where score gains on the evaluation set fail to transfer to real business. The fundamental countermeasure is to build an evaluation loop centered on business scenarios, so that business metrics—not public rankings—become the basis for decisions.

    5. Building an In-House Scenario-Based Evaluation System: A Five-Step Approach

    Public leaderboards are good for initial screening, but the final selection has to land in your own scenarios. Below is a practical five-step approach.

    Step 1: Define the Scenario and Quantifiable Goals

    First, define in business terms the problem the model must solve, then turn it into measurable metrics. For example:

    • Customer-service assistant: first-turn resolution rate, answer factual-accuracy rate, human-handoff rate;
    • Document processing: field-extraction accuracy, summary key-point coverage, format-compliance rate;
    • Coding assistant: code acceptance rate, unit-test pass rate, bug-fix success rate.

    Only after the goals are clear can you decide the composition and weighting of the evaluation set.

    Step 2: Build a Scenario-Based Evaluation Set

    Sources usually fall into three categories: desensitized real business requests (covering high-frequency and long-tail scenarios), manually written boundary and adversarial samples based on business rules, and “gold answers” constructed by annotators. Each sample should include the following fields:

    1. {"id": "faq-001", "dimension": "Knowledge QA", "prompt": "...", "type": "closed_form", "answer": "...", "weight": 1.0}

    Here, type can be closed_form (rule-based grading), structured (structured validation), or open_ended (human/judge grading). Sample size must balance statistical stability against annotation cost, and core high-frequency scenarios should be guaranteed enough samples.

    Step 3: Build an Automated Evaluation Pipeline

    Put evaluation cases under version control and commit them alongside the code. Trigger an evaluation run automatically whenever the model configuration, prompt, or post-processing logic changes, produce a report, and archive it to form a traceable evaluation history.

    1. import json
    2. import statistics
    3. from collections import defaultdict
    4. from dataclasses import dataclass
    5. @dataclass
    6. class Case:
    7. id: str
    8. dimension: str
    9. prompt: str
    10. type: str # closed_form | structured | open_ended
    11. answer: str | None = None
    12. weight: float = 1.0 # Per-sample weight within a scenario; adjust by business importance
    13. def load_cases(path: str) -> list[Case]:
    14. cases = []
    15. with open(path, encoding="utf-8") as f:
    16. for line in f:
    17. if line.strip():
    18. raw = json.loads(line)
    19. cases.append(Case(**raw))
    20. return cases
    21. def call_model(prompt: str, params: dict) -> str:
    22. """Unified model-call wrapper: hides backend differences so models can be swapped for comparison."""
    23. raise NotImplementedError("Implement after wiring up the specific model service")
    24. def judge(case: Case, response: str) -> float:
    25. """Open-ended grading: human or judge-model scoring per a shared rubric, normalized to [0, 1]."""
    26. raise NotImplementedError("Implement after wiring up human scoring or a judge model")
    27. def structured_score(response: str, case: Case) -> float:
    28. """Structured-output grading: first verify parseability, then check each constraint."""
    29. try:
    30. data = json.loads(response)
    31. except json.JSONDecodeError:
    32. return 0.0
    33. checks = case.answer.split("|") # Convention: multiple constraints in answer are separated by "|"
    34. passed = 0
    35. for check in checks:
    36. if ":" in check:
    37. key, expected = check.split(":", 1)
    38. if key in data and str(data[key]).strip() == expected.strip():
    39. passed += 1
    40. elif check == "__is_dict__" and isinstance(data, dict):
    41. passed += 1
    42. return passed / len(checks)
    43. def score(case: Case, response: str) -> float:
    44. if case.type == "closed_form":
    45. pred = response.strip().lower()
    46. gold = case.answer.strip().lower()
    47. return 1.0 if gold and pred == gold else 0.0
    48. if case.type == "structured":
    49. return structured_score(response, case)
    50. return judge(case, response)
    51. def weighted_mean(pairs: list[tuple[float, float]]) -> float:
    52. total_w = sum(w for _, w in pairs)
    53. if total_w == 0:
    54. return 0.0
    55. return sum(s * w for s, w in pairs) / total_w
    56. def evaluate(cases: list[Case], params: dict, runs: int = 3) -> dict:
    57. dim_scores = defaultdict(list)
    58. for case in cases:
    59. results = [score(case, call_model(case.prompt, params)) for _ in range(runs)]
    60. dim_scores[case.dimension].append((statistics.mean(results), case.weight))
    61. dims = {dim: weighted_mean(pairs) for dim, pairs in dim_scores.items()}
    62. return {
    63. "total": weighted_mean(list(dims.items())),
    64. "dimensions": dims,
    65. }
    66. if __name__ == "__main__":
    67. params = {"model": "<model under evaluation>", "temperature": 0, "max_tokens": 1024}
    68. report = evaluate(load_cases("cases.jsonl"), params, runs=3)
    69. print(json.dumps(report, ensure_ascii=False, indent=2))

    Deployed on a container platform or a task-orchestration system, and paired with object storage for the evaluation set and historical reports plus a logging service to capture model-call inputs and outputs, the pipeline forms a complete data chain. General-purpose cloud offerings such as those from Baidu AI Cloud can serve as the technical foundation for building this kind of evaluation pipeline.

    Step 4: Set Regression Gates

    Define a score threshold for each core scenario and compare against a baseline to detect regressions. The example below shows how to block a model configuration whose score falls “significantly below baseline” inside a unit test.

    1. import json
    2. import unittest
    3. from dataclasses import replace
    4. def gate(total: float, baseline: float, tol: float = 0.02) -> bool:
    5. """Regression gate: a total score below the baseline by more than the tolerance is a regression."""
    6. return total >= baseline - tol
    7. class RegressionGateTest(unittest.TestCase):
    8. @classmethod
    9. def setUpClass(cls):
    10. cls.params = {"model": "<model under evaluation>", "temperature": 0, "max_tokens": 1024}
    11. cls.cases = load_cases("cases.jsonl")
    12. cls.baseline_path = "baseline.json"
    13. with open(cls.baseline_path, encoding="utf-8") as f:
    14. cls.baseline = json.load(f)
    15. def test_no_regression(self):
    16. report = evaluate(self.cases, self.params, runs=3)
    17. with open("report.json", "w", encoding="utf-8") as f:
    18. json.dump(report, f, ensure_ascii=False, indent=2)
    19. for dim, score in report["dimensions"].items():
    20. base = self.baseline["dimensions"].get(dim, 0.0)
    21. self.assertTrue(
    22. gate(score, base),
    23. f"Dimension [{dim}] regressed: current={score:.4f}, baseline={base:.4f}",
    24. )
    25. def test_update_baseline(self):
    26. """Update the baseline only when the total-score gain exceeds the tolerance, avoiding noise-triggered changes."""
    27. with open("report.json", encoding="utf-8") as f:
    28. current = json.load(f)
    29. if current["total"] > self.baseline["total"] + 0.02:
    30. self.baseline = current
    31. with open(self.baseline_path, "w", encoding="utf-8") as f:
    32. json.dump(self.baseline, f, ensure_ascii=False, indent=2)
    33. if __name__ == "__main__":
    34. unittest.main()

    The role of the tolerance tol mirrors the tie rules on leaderboards: when the gap is within the tolerance, it is treated as no substantive change, which avoids frequent alerts from random fluctuations and prevents a small gain from being mistaken for a real improvement.

    Step 5: Online Monitoring and the Feedback Loop

    Evaluation should not stop before launch. In production, continuously collect model-call inputs, outputs, and latency, and combine them with user feedback (acceptance, thumbs-down, handoffs to a human, etc.) to identify typical failure cases (bad cases), then periodically feed them back into the evaluation set. This creates a continuous iteration loop of “evaluate → launch → monitor → feed back → re-evaluate,” keeping the evaluation set close to the real business distribution.

    6. Selection in Practice: Turning Evaluation Results into Engineering Decisions

    Pulling the preceding points together, the following workflow is recommended for model selection:

    1. Build a candidate list: include candidate models that meet basic requirements such as compliance, data security, and on-premises deployment, and use public leaderboards only as an initial reference for screening;
    2. Score across multiple dimensions: build a scoring matrix across five dimensions—capability, cost, latency, stability, and ecosystem tooling. For example, capability at 50%, cost and performance at 30%, and ecosystem and maintainability at 20%; adjust to your own situation;
    3. Tiered routing: classify tasks by difficulty, send simple high-frequency requests to a lightweight model and complex requests to a more capable model, balancing quality and cost;
    4. Keep optimizing prompts and post-processing: prompt engineering, structured-output validation, and retrieval-augmented generation (RAG) often improve real-world results significantly at lower cost than swapping models;
    5. Re-run evaluations regularly: after a model upgrade or business change, re-execute the regression gates to ensure capability has not regressed.
    1. User request
    2. │
    3. ▼
    4. Task classification & difficulty check ──── Simple request ───▶ Lightweight model ──┐
    5. │ │
    6. └── Complex request ──▶ High-capability model ──┐ │
    7. ▼ ▼
    8. Output validation & post-processing ──▶ Output
    9. │
    10. ▼
    11. User feedback & log collection ──▶ Feed back into eval set ──▶ Next regression run

    Conclusion

    Chinese LLMs are in a phase of rapid iteration, and leaderboard rankings will churn ever more frequently, so the reference value of any single rank will keep shrinking. What can genuinely support technical decisions is an evaluation system that is “reproducible, measurable, and iterable”: an evaluation set that covers real capability dimensions and guards against data contamination, layered and reproducible scoring methods, results expressed with confidence intervals and tie determination to avoid over-interpretation, and decisions that combine business scenarios with engineering cost.

    For developers, rather than chasing ranks on a leaderboard, it is better to invest effort in building a business evaluation set and an automated pipeline. Only when evaluation truly serves the business can you make sound, sustainable choices among a sea of model options.