How to Evaluate Large Language Models: Benchmark Design, Agent Coding, Hallucination Control, and Cost Analysis

    As leading Chinese LLMs converge to within a single point of each other on general capability benchmarks, composite rankings alone are no longer enough to guide model selection. This article breaks down how modern LLM benchmarks are designed, why agent coding metrics like task pass rate and timeout rate matter, how hallucination control is measured and mitigated in production, and why per-task total cost is a more reliable selection metric than per-token pricing. It closes with a practical multi-dimensional evaluation framework for enterprises choosing models for real-world workloads.

    How to Evaluate Large Language Models: Benchmark Design, Agent Coding, Hallucination Control, and Cost Analysis

    Introduction

    A recent public benchmark of general capabilities for Chinese large language models showed several leading domestic models clustered in the same tier, with composite scores separated by less than 1 point — close enough to be declared joint leaders under the benchmark’s rules. This sends an important signal: competition at the top of the Chinese LLM landscape has shifted from generational gaps to razor-thin margins, and the capability boundaries between models are increasingly blurred.

    For developers and enterprise users, composite rankings alone no longer support sound selection decisions. What matters more is understanding how benchmark systems are designed, what the sub-metrics actually mean technically, and how cost and capability trade off against each other. This article systematically breaks down the methodology and engineering practices behind LLM evaluation.

    1. The Design Logic Behind Benchmarks

    A trustworthy LLM evaluation system typically consists of three components: the question set, the scoring rules, and the statistical methodology.

    Question set design must cover multiple capability dimensions, commonly: commonsense and knowledge QA, logical and mathematical reasoning, code generation and understanding, long-context reading and summarization, instruction following, and safety and alignment. A high-quality question set should be contamination-resistant — its questions must not appear in the models’ public training corpora, otherwise results are severely distorted. The industry generally addresses this with dynamically updated private question banks.

    Scoring rules determine comparability of results. Objective questions (multiple choice, fill-in-the-blank) can be graded automatically; subjective questions (open-ended answers, code tasks) rely on human review or on LLM-as-a-Judge approaches. The latter requires attention to biases in the judge model itself; in practice, multi-judge voting and position-swapping debiasing are commonly used to reduce variance.

    Statistical methodology includes a rule worth noting: ties. When the score gap between models falls below a threshold (for example, 1 point), they are treated as statistically tied. This reflects rigor — the noise and variance inherent in benchmarking mean tiny score gaps carry no real discriminating power. When reading benchmark reports, developers should look at confidence intervals rather than single-point scores.

    2. Agentic Coding: From “Writing Code” to “Completing Tasks”

    The most notable change in the recent benchmark is the sharp jump in leading models’ agentic coding scores. Unlike earlier static evaluations where a model was given a requirement and asked to generate a code snippet, agentic coding benchmarks require models to complete end-to-end tasks in a real engineering environment: reading an existing codebase, locating issues, modifying code across multiple files, running tests, and iteratively fixing problems until the task is done.

    Two quantitative metrics in this category are highly valuable for engineering decisions:

    Task pass rate measures a model’s ability to actually solve the problem. Leading models scored significantly higher than the previous generation, improving by more than 15 points in a single iteration — evidence of real progress in multi-step planning, tool calling, and error recovery.

    Timeout rate reflects engineering reliability. In earlier rounds of the benchmark, some models had timeout rates approaching 70%, meaning most tasks failed to complete due to timeouts or infinite loops. The new generation of leading models brought this down to 0% — every test completed normally. For enterprise adoption, improving timeout rate is arguably more meaningful than raising scores: a mid-tier agent that completes tasks reliably is often more valuable in production than a brilliant-but-unpredictable one.

    Common engineering techniques for reducing agent timeout rates include: capping the maximum number of iterations per task, introducing subtask decomposition and checkpoint mechanisms, applying structured validation to tool call results, and dynamically allocating reasoning depth within a fixed inference budget.

    3. Hallucination Control: The Baseline for Trustworthy Output

    Hallucination — a model confidently generating content that contradicts facts — is one of the biggest obstacles to deploying LLMs in production. Hallucination control is now scored as an independent dimension, and the score spread among leading models on this dimension is noticeably wider than on composite scores, making it a key differentiator.

    From an application perspective, common practices for reducing hallucination risk include:

    1. Retrieval-Augmented Generation (RAG): anchor model responses in verifiable knowledge sources, and attach citations to generated content for human verification.
    2. Citation verification and consistency checks: run a second pass over factual claims in model outputs, using an independent verification model or rule engine.
    3. Calibrated refusal: train or prompt the model to explicitly express uncertainty outside its knowledge boundaries rather than fabricating answers. The benchmark’s “better to abstain than to answer wrongly” scoring philosophy reinforces this direction.
    4. Structured output constraints: use constrained decoding techniques such as JSON Schema to reduce the room for factual drift in free-form generation.

    It’s worth emphasizing that hallucination control is a probabilistic goal, not a deterministic one. Any claim of “zero hallucination” should not be trusted, and engineering systems must assume all outputs require verification.

    4. Inference Cost: The Underrated Selection Metric

    The recent benchmark released a frequently overlooked but business-critical figure: when actual token consumption is converted at list pricing, the average cost per task for leading models dropped from the tens-of-yuan range in the previous generation to around 2 yuan — a reduction of nearly 90% at best. Behind this is systematic progress in inference efficiency: more efficient attention implementations, computation allocation strategies during inference, and compression techniques such as distillation and quantization.

    For enterprise users, cost evaluation should use “total cost per successfully completed task” rather than “price per 1K tokens”. Here’s why:

    • Stronger models often complete tasks in fewer turns, so total token consumption may actually be lower;
    • Output tokens and “thinking” tokens must both be counted — thinking tokens can account for a large share in models with deep reasoning capabilities;
    • Cache hit rates (such as prompt prefix caching) significantly affect actual billing in long-session scenarios.

    A practical cost estimation sketch:

    1. def estimate_task_cost(input_tokens, output_tokens,
    2. price_in, price_out, retry_rate=0.0):
    3. """
    4. Estimate the cost of a single task, with a retry amplification factor.
    5. price_in / price_out: price per million tokens (in yuan)
    6. retry_rate: task failure and retry rate
    7. """
    8. base = (input_tokens * price_in + output_tokens * price_out) / 1_000_000
    9. return base * (1 + retry_rate)
    10. # Example: 8K input, 2K output, 10% retry rate
    11. cost = estimate_task_cost(8000, 2000, price_in=40, price_out=120, retry_rate=0.1)
    12. print(f"Cost per task: ~{cost:.2f} yuan")

    As shown, the retry rate is a direct cost multiplier — which brings us back to the conclusion that timeout rate and stability matter more than single-point scores.

    5. A Comprehensive Evaluation Framework for Enterprise Model Selection

    Based on the analysis above, enterprises should build a multi-dimensional evaluation framework rather than relying on a single leaderboard:

    1. Capability: focus on sub-scores closely tied to your business (e.g., coding, long-context, hallucination control); use composite rankings only as an initial screen.
    2. Reliability: examine task completion rate, timeout rate, and output format compliance; where necessary, build a private evaluation set from your own business data.
    3. Cost: calculate using the “total cost per task” metric, factoring in discounts from caching, batch inference, and similar mechanisms to estimate real spend.
    4. Engineering support: evaluate the model service’s concurrency capacity, latency profile, logging, and monitoring/alerting coverage, as well as how supporting cloud products (object storage, message queues, etc.) underpin the overall architecture.

    For implementation, enterprises can use model services and developer toolchains offered by platforms such as Baidu AI Cloud to quickly set up evaluation and canary testing environments, validate models against real business traffic, and then gradually expand adoption.

    Conclusion

    The tie at the top of the Chinese LLM landscape marks a shift: the question “is there a usable LLM at all” is largely settled, and competition has moved to “whose model is more stable, cheaper, and more trustworthy”. For developers, understanding the technical meaning behind benchmark methodology — the statistical logic of tie-breaking, the engineering value of timeout rates, the true definition of per-task cost, and systematic approaches to hallucination control — has more lasting value than memorizing any single score. Only by turning leaderboard information into your own evaluation framework can you make sound selection decisions in a fast-moving technology landscape.