Evaluating and Selecting Mid-to-Large Language Models: From Leaderboard Rankings to Hallucination Quantification

    Choosing a large language model often starts with leaderboard rankings, but a higher rank rarely translates into reliable real-world performance. This article proposes a more rigorous evaluation approach that breaks "which model is stronger" into measurable, reproducible metrics—baseline task win rate, difficulty curve slope, hallucination suppression, output consistency, and unit effective cost—and combines them with business-weighted decisions. It covers a two-stage screening-and-profiling workflow, evaluation-set construction with L1–L3 difficulty tiers, inference and scoring protocols with bias-controlled judges, five hallucination metrics with trap questions, a reproducible evaluation pipeline, and task-routing strategies for cost control. Readers will find practical methods, scoring mechanisms, and reference Python code for turning a subjective sense of "stronger" into quantifiable, operational engineering metrics.

    1. Where the Problem Starts: Rank Is Not a Usable Conclusion

    In model selection, “this model ranks higher on the leaderboard” is often treated as a conclusion. In practice, two kinds of gaps frequently appear: a mediocre Q&A performer turns out to struggle on real tasks, while a seemingly smart answer becomes self-contradictory or fabricated under a little follow-up probing. This shows that a single aggregate ranking can hardly reflect a model’s reliability in real business.

    The industry typically discusses flagship and mainstream models in tiers. On ordinary tasks such as Q&A, summarization/rewriting, and information extraction, the tiers already perform quite similarly. The gap concentrates on high-difficulty tasks that require multi-step reasoning, long-chain tool calls, and professional judgment. Within the same tier, differences in hallucination control can also be pronounced: some models quickly recognize the boundaries of their own knowledge and respond with reasonable reservations, while others generate more “smoothly” but lack a sense of boundaries. These observations are based on limited personal experience—sample size and task coverage are insufficient to serve as conclusions—but they suggest a more rigorous evaluation approach: break “who is stronger” into several measurable, reproducible metrics, then weight them against the business scenario to make decisions.

    2. Evaluation Framework: From a Single Score to a Five-Dimensional Capability Profile

    2.1 Five Core Dimensions

    • Baseline task win rate: Compared against a reference model under the same distribution and scoring criteria, the win rate must include a confidence interval. With a small sample, a difference of a few dozen samples may be mere noise.
    • Difficulty curve slope: Fix the difficulty and re-evaluate, fitting how win rate changes with difficulty; the slope reflects “how fast capability degrades when facing hard problems.”
    • Hallucination suppression rate: Correct-rebuttal rate on false-premise questions, refusal rate on questions with no answer, and citation faithfulness in long-form Q&A.
    • Output consistency: Stability of results across multiple samplings of the same prompt, measuring whether answers are reproducible.
    • Unit effective cost: Combining input/output billing, retry consumption, average latency, and human review cost—not just unit price.

    2.2 Two-Stage Evaluation: Screening and Profiling

    • Stage 1 · Screening: Pick representative models in each tier, run a unified test set, and quickly eliminate obviously substandard candidates at low cost.
    • Stage 2 · Profiling: For the few finalists, expand sampling counts and run difficulty-curve fitting, long-context stress tests, tool-call stability tests, and cross-language tests to produce a profile report.

    3. Building the Evaluation Set: Define Standards First, Then Samples

    3.1 Task and Difficulty Tiers

    The evaluation set should cover three types of tasks: single-step tasks (e.g., summarization/rewriting), multi-step reasoning tasks (e.g., analysis with constraints), and long-chain tool-call tasks (e.g., multi-round retrieval plus code execution). Difficulty is best divided by expert pass rate:

    Tier Reference Standard Purpose
    L1 Most people with domain basics answer correctly and consistently Screens baseline capability; limited discrimination
    L2 Requires some domain expertise; some people make mistakes Main discrimination zone; determines tier placement
    L3 Requires expert case-by-case verification; ordinary evaluators can hardly judge correctness Profiles capability ceiling; needs reliable scoring

    In the original discussion, “research-type questions with a bit more difficulty” could be handled by only a few models on par with overseas models—essentially a rapid decay of the win-rate curve on L3 questions. Without tiered design, if L1 questions dominate, scores get quickly “inflated” toward saturation, and the differences between models get averaged out.

    3.2 Question Design Guidelines

    1. Single variable: Each question tests one core capability, avoiding multi-capability mixing that makes attribution difficult.
    2. Verifiable: Preset clear checkpoints or reference points—conclusions, key calculation steps, elements that must be covered—to avoid purely subjective scoring.
    3. Anti-contamination: Use desensitized internal business data or newly constructed questions to reduce bias from public test sets being included in pretraining or repeatedly tuned.
    4. Difficulty drift monitoring: Periodically re-annotate sampled questions with experts to prevent questions from “becoming easier” as models iterate.

    4. Inference Parameters and Evaluation Protocol

    • Temperature and sampling: For scoring tasks, set temperature to 0 or a low value to improve reproducibility, but some inference services may still produce different outputs for the same input, so results cannot be assumed fully deterministic. For generative tasks, sample multiple times and report mean and variance.
    • Prompt template and version: Templates must be version-controlled. The same prompt can behave very differently under “zero-shot,” “few-shot examples,” and “chain-of-thought guidance,” so evaluation reports must note the template version.
    • Context length alignment: Unify the maximum input length tested; set separate configurations for long-document tasks to avoid short-context models being “unfairly penalized” due to truncation.
    • Consistent tools and system prompts: For tool-call tasks, keep function definitions, return formats, and system prompts identical across models.
    • Full call-log retention: Keep original requests, responses, latency, and token consumption to support post-hoc reproduction and attribution.

    5. Scoring Mechanism: From Exact Match to Calibrated Judges

    1. Rule-based scoring first: Prioritize programmatic verification where possible—JSON Schema validation, code unit-test pass rates, exact numeric answer matching, and whether cited references actually exist.
    2. Judge-model scoring: For subjective questions, use a judge model plus a reference answer, but known biases must be controlled, including length bias (preferring longer answers), position bias (preferring earlier candidates), and self-preference (giving high scores to same-source models). Common methods:
      • Swap candidate order in pairwise comparisons and average;
      • Score against the reference answer rather than directly comparing two candidates;
      • Use multiple judge models from different sources and report their agreement;
      • Include human-model agreement rate in the calibration process.
    3. Human spot-check loop: Spot-check by level of disagreement; fully review high-disagreement samples. Human conclusions flow back to form an “error log” that continuously supplements the evaluation set.
    1. # Example 1: Tiered evaluation, judge bias control, and human spot-check feedback
    2. import json, math, hashlib
    3. import statistics
    4. from concurrent.futures import ThreadPoolExecutor
    5. SAMPLE_N = 5 # Repetitions per question, used to estimate consistency
    6. # Scoring instructions require strict adherence to reference points and explicitly suppress length bias
    7. JUDGE_TMPL = """
    8. You are a strict reviewer. Judge whether the candidate answer fully meets the following reference points:
    9. 1. The conclusion is correct and consistent with the facts in the material;
    10. 2. All key information in the reference points is covered;
    11. 3. No fabrication (facts, data, or sources not mentioned in the material);
    12. 4. The format matches the question's requirements.
    13. Reference points: {ref}
    14. Question: {q}
    15. Candidate answer: {ans}
    16. Output only JSON: {"verdict": "pass"|"fail", "reasons": ["..."]}
    17. Note: Do not raise the score because the answer is longer or more fluent.
    18. """
    19. def judge(candidate, sample):
    20. raw = llm_client.chat(JUDGE_TMPL.format(
    21. ref=sample["rubric"], q=sample["question"], ans=candidate))
    22. verdict = json.loads(raw)
    23. verdict["verdict"] = verdict["verdict"].lower()
    24. return verdict
    25. def stat(vals):
    26. # Variance cannot be estimated with fewer than two samples; return None and mark it in the report
    27. return {"mean": statistics.mean(vals), "var": statistics.variance(vals)} \
    28. if len(vals) >= 2 else {"mean": vals[0], "var": None}
    29. def evaluate_model(model_client, bench):
    30. records = []
    31. for s in bench:
    32. samples = []
    33. for _ in range(SAMPLE_N):
    34. raw = model_client.chat(s["messages"], temperature=0.3)
    35. verdict = judge(raw, s) # In a formal experiment, candidate order should be randomized
    36. samples.append({
    37. "text": raw, "verdict": verdict,
    38. "fail_type": None if verdict["verdict"] == "pass" else verdict["reasons"][0],
    39. "usage": model_client.last_usage,
    40. "latency_ms": model_client.last_latency_ms,
    41. })
    42. # Consistency: proportion of samples that disagree with the majority verdict
    43. votes = [x["verdict"]["verdict"] for x in samples]
    44. majority = max(set(votes), key=votes.count)
    45. records.append({
    46. "case_id": s["id"], "level": s["level"], "category": s["category"],
    47. "pass": majority == "pass",
    48. "consistency": sum(v == majority for v in votes) / len(votes),
    49. "tokens": stat([x["usage"]["total_tokens"] for x in samples]),
    50. "latency": stat([x["latency_ms"] for x in samples]),
    51. "samples": samples,
    52. # Content fingerprints used to detect repeated outputs
    53. "digests": [hashlib.sha1(x["text"].encode()).hexdigest() for x in samples],
    54. })
    55. return records
    56. def report(records, ref_model_records=None):
    57. groups = {}
    58. for r in records:
    59. groups.setdefault(r["level"], []).append(r)
    60. out = {}
    61. for level, items in groups.items():
    62. n = len(items)
    63. p = sum(i["pass"] for i in items) / n
    64. # 95% confidence interval for accuracy (normal approximation); the interval is wide for small samples and must be interpreted cautiously
    65. half = 1.96 * math.sqrt(p * (1 - p) / n)
    66. tok = [i["tokens"]["mean"] for i in items if i["tokens"]["var"] is not None]
    67. by_cat = {}
    68. for i in items:
    69. by_cat.setdefault(i["category"], []).append(i["pass"])
    70. out[level] = {
    71. "n": n, "pass_rate": round(p, 3),
    72. "ci95": [round(max(0, p - half), 3), round(min(1, p + half), 3)],
    73. "consistency": round(sum(i["consistency"] for i in items) / n, 3),
    74. "tokens_per_case": round(sum(tok) / len(tok), 1) if tok else None,
    75. # Paired win rate against the reference model controls better for question difficulty than absolute scores
    76. "paired_win_rate_vs_ref": round(sum(
    77. i["pass"] and not j["pass"]
    78. for i, j in zip(items, ref_model_records)), 0),
    79. "by_category": {k: round(sum(v) / len(v), 3) for k, v in by_cat.items()},
    80. "top_fail_types": most_common_fail_types(items),
    81. }
    82. return out

    6. Quantifying Hallucination: From “Will It Fabricate” to “Can It Be Traced”

    Hallucination is the most underestimated dimension in evaluation. It cannot be reflected by an aggregate score alone: a fluent, well-structured model may score well yet frequently fabricate data and sources. It can be quantified with the following metrics:

    1. Unsupported statement rate: Break the answer into verifiable factual statements and check each for support from the given material; the unsupported proportion is the unsupported rate.
    2. Citation faithfulness: In citation tasks, whether the quoted source fragments actually exist and whether they support the conclusions attributed to them.
    3. Refusal rate on hard questions: On preset unanswerable questions, the proportion where the model explicitly states “insufficient information.” Reasonable refusal is reliability, not a defect.
    4. False-premise detection rate: When a question embeds a false assumption (e.g., a nonexistent function or a wrong version number), the proportion where the model corrects rather than fabricates along with it.
    5. Confident-wrong rate: The proportion of wrong conclusions delivered in a highly confident tone, used to measure the risk of “looking right while being wrong.”

    In evaluation design, “trap questions” can be constructed separately in the dataset, for example:

    • Cite a nonexistent function interface;
    • Ask to summarize a document that was not provided;
    • Give contradictory statistics.

    Trap questions reveal that some models will cater to the asker’s assumption and continue generating, while others point out that the premise does not hold—a typical manifestation of hallucination-control differences.

    Mitigation combines engineering practices and does not rely on a single model’s capability:

    • Retrieval augmentation: Answers must be based on retrieved fragments, with traceable citation identifiers attached in the output;
    • Structured output with validation: Agree on an output format, validate fields with JSON Schema, and run rule checks on key fields;
    • Confidence threshold: Trigger a follow-up question or hand off to a human when the unsupported statement rate exceeds the threshold;
    • Secondary verification: Call a rule validator or an independent model to review high-risk outputs (numbers, dates, regulatory clauses);
    • Prompt constraints: Explicitly state “if you don’t know, say there is insufficient information,” and verify in evaluation whether this constraint actually takes effect.
    1. # Example 2: Citation faithfulness, unsupported statement rate, and threshold gating
    2. def check_grounding(answer, context_segments, threshold=0.6):
    3. """context_segments: [(segment_id, source fragment), ...] provided by retrieval or given material"""
    4. claims = extract_claims(answer) # Split the answer into factual statements
    5. hits, total = 0, 0
    6. for c in claims:
    7. if not c.is_factual:
    8. continue # Opinions, suggestions, and other non-factual content are excluded
    9. total += 1
    10. if any(overlap(c.text, seg) >= 0.5 for _, seg in context_segments):
    11. hits += 1
    12. grounded_rate = hits / total if total else 1.0
    13. return {
    14. "grounded_rate": round(grounded_rate, 3), # Faithfulness
    15. "ungrounded_rate": round(1 - grounded_rate, 3) if total else 0.0,
    16. "decision": "answer" if grounded_rate >= threshold else "abstain",
    17. }

    7. Engineering Implementation: A Reproducible Evaluation Pipeline

    Evaluation results have engineering value only when they are reproducible, comparable, and sustainable. Reference pipeline:

    1. Data layer: Version the evaluation set (question bank, reference answers, difficulty labels, sources), managed together with the code in version control.
    2. Execution layer: Use a container platform for a unified runtime environment, call model services in parallel, and log everything.
    3. Scoring layer: A three-tier pipeline of rule-based scoring, judge models, and human annotation, with disputed samples automatically routed to the human queue.
    4. Storage and visualization: Write raw responses and scoring results to object storage; feed metrics into a logging service and monitoring/alerting to form a trend dashboard.
    5. Regression layer: After each model or prompt change, automatically run the full evaluation, compare against the previous version, and block release when a key metric drops beyond a threshold.

    Taking Baidu AI Cloud as an example, a typical cloud-native combination is: evaluation data and raw responses stored in object storage, evaluation tasks scheduled and executed on a container platform, scoring results and latency metrics aggregated through a logging service, and monitoring/alerting providing real-time alerts on fluctuations in key metrics—forming an end-to-end observable evaluation loop.

    For the release stage, shadow traffic can be used: a new model first receives online requests but does not return results directly; its results are compared in parallel with the current model, and traffic is gradually ramped up after metrics such as hallucination rate, timeout rate, and user feedback stabilize.

    8. From Evaluation to Selection: Task Tiering and Cost Control

    The end of evaluation is not a ranking but a production decision. A common approach is to route by task difficulty:

    • Simple tasks: Use lightweight models for extraction, formatting, rewriting, and similar tasks to control cost and latency.
    • Complex tasks: Use more capable models for deep analysis, code generation and review, multi-round tool calls, and similar tasks, accepting higher latency and cost.
    • Fallback and retry: Automatically escalate low-confidence outputs to a stronger model or to human review.

    Cost can be estimated with the following formula:

    1. cost per request = (input tokens × input unit price + output tokens × output unit price)
    2. + average retries × cost per request
    3. + human review probability × cost per review
    4. unit effective cost = cost per request / first-pass rate

    A model with a low first-pass rate may have a higher unit effective cost even if its unit price is lower. This is directly tied to the hallucination rate and consistency metrics in evaluation.

    Selection should also consider data compliance, service stability, context window length, and ecosystem compatibility. For scenarios involving sensitive data, prefer solutions that support private or on-premises deployment.

    9. Common Misconceptions

    • Leaderboard-only thinking: Leaderboard questions may have been widely trained on or specifically optimized for, so they offer limited reference value when misaligned with the business distribution.
    • Single experience instead of systematic evaluation: Personal experience has a small sample and a narrow scenario; it can serve as a clue but not as a conclusion.
    • Ignoring consistency: Testing only once fails to reveal output fluctuation, making caching and idempotency design hard online.
    • Treating length as quality: Preferring long answers in evaluation induces models to output verbose content, increasing cost and the reader’s burden.
    • Out-of-control prompt versions: Different teams modifying templates on their own makes evaluation results incomparable and causes repeated online fluctuations.

    10. Conclusion

    The key to evaluating large models is turning “feels stronger” into quantifiable, reproducible, operable engineering metrics. Based on a difficulty-tiered question set, use a multi-metric report with confidence intervals to profile models, constrain reliability with hallucination quantification, and finally combine task tiering, retrieval augmentation, structured validation, and human-AI collaboration to land evaluation conclusions at the balance point of cost and experience. This supports long-term, stable business iteration better than chasing the short-term rank of any single leaderboard.