Evaluating Large Language Models: Methods and Practices for Measuring Overall Capability

    This article explains why asking which large language model is "the best" is the wrong question, and offers a practical framework for evaluating overall model capability. It covers breaking performance into orthogonal dimensions, building evaluation sets from real traffic, designing hard, soft, and economic metrics with a weighted utility function, avoiding common evaluation biases, and embedding evaluation into the delivery pipeline as a release gate with online feedback. The goal is task matching rather than ranking, so selection decisions stay verifiable and repeatable despite model version drift.

    1. The Core Problem: Why “Which Is the Strongest” Is a False Question

    In engineering practice, the most common mistake when assessing a group of general-purpose large language models is expecting a single all-around winner. In reality, different models show clear unevenness across capabilities: some are more stable at long-context retrieval and structured output, some are ahead in multimodal understanding, some are more natural in creative generation and tone control, and some offer better cost-performance on reasoning and coding tasks. So the right question is not “which model is the best,” but “under my task distribution, latency budget, and cost constraints, which model delivers the highest overall utility.”

    Another real variable that must be taken into account is version drift. Model services keep iterating, and behind the same name the weights, system prompt strategy, decoding parameters, and safety policies can all change, causing the pass rate of the same test suite to fluctuate at different points in time. This means evaluation is not a one-off activity but should be a continuously running pipeline.

    2. Breaking Down Capability Dimensions: Turning “Overall Performance” into Measurable Items

    To make a rigorous judgment, first split the vague notion of “overall” into orthogonal dimensions, covering at least the following six categories:

    • Instruction following and format constraints: whether it can reliably output valid JSON and obey field naming and enum ranges.
    • Long-context handling: recall of key information under very long inputs, cross-section reasoning, and position robustness.
    • Multimodal understanding: entity alignment in mixed text-and-image layouts, chart reading, and layout structure reconstruction.
    • Code and tool calling: function signature matching, parameter extraction accuracy, and retry strategy on failure.
    • Creativity and style control: tone consistency, rewrite fidelity, and degree of de-templating.
    • Safety and compliance: whether refusal boundaries are reasonable, and whether there is over-refusal or out-of-bounds output.

    Each dimension needs an independent score, then a final weighting by business weight, rather than first giving a vague overall impression score.

    3. Building the Evaluation Set: Only Meaningful When Close to Real Traffic

    The problem with public leaderboards is that their distribution does not match your business. A more reliable approach is to sample from real traffic, then desensitize and deduplicate to form a stratified evaluation set:

    1. # Example: stratified sampling and minimum evaluable unit
    2. suites = {
    3. "format": 50, # structured output
    4. "longctx": 30, # long-text recall
    5. "mm": 20, # text-and-image understanding
    6. "code": 40, # code and calling
    7. "style": 30, # style control
    8. "safety": 20, # safety boundary
    9. }
    10. def build(samples, suites):
    11. return {k: samples.filter(tag=k).sample(n) for k, n in suites.items()}

    Three key details: first, keep a “hard set,” turning historical failure samples into regression cases; second, control the length distribution of individual samples to avoid long-text items being drowned out by short samples; third, annotate each sample with a unique judging criterion to reduce ambiguity in manual scoring.

    4. Metric Design: From Accuracy to a Utility Function

    A single accuracy figure is not enough to support decisions; a three-tier metric set is recommended:

    1. Hard metrics: format pass rate, field completeness rate, recall hit rate, all of which can be judged fully automatically.
    2. Soft metrics: semantic equivalence and style consistency, using pairwise comparison plus manual spot checks.
    3. Economic metrics: token consumption per task, end-to-end latency percentiles, and retry rate.

    Finally, converge with a weighted utility function:

    1. U = w1*FormatPass + w2*Recall + w3*StyleWin
    2. - w4*CostPerTask - w5*P95Latency - w6*RetryRate

    Weights are given by the business side; the engineering side is only responsible for ensuring the measurements are trustworthy. To keep soft metrics stable, use blind testing and random ordering, and repeat each sample three times taking the majority result to suppress single-sample noise.

    5. Common Biases and How to Avoid Them

    The place where evaluation is most easily distorted is not the model but the method. Typical biases include: prompt wording that is unfair to different models, systematically underestimating one side; decoding parameters such as temperature not being unified, so variance is misread as a capability difference; inconsistent context length settings, making long-text conclusions invalid; and raters knowing the model source, producing expectation bias. The way to avoid this is to write the evaluation configuration into a versioned file, route any change through review, and keep raw outputs for reproducibility.

    1. # Example: reproducible evaluation configuration
    2. decode: {temperature: 0.2, top_p: 0.9, max_tokens: 2048}
    3. context: {input_limit: 128000, truncation: head_tail}
    4. judge: {mode: blind, repeat: 3, order: random}

    6. Engineering Implementation: Embedding Evaluation into the Delivery Process

    Evaluation only has long-term value once it enters the pipeline. It is recommended to make it a release gate: a candidate configuration first passes a small smoke set, then enters full regression, and if metrics fall below baseline the release is blocked; on the production side, real failure samples are collected through logging services and monitoring alerts and fed back as new cases, forming a closed loop. Model services can be wrapped in a unified gateway layer that shields vendor differences, combined with object storage to save datasets and artifacts, message queues for asynchronous batch evaluation, and a container platform to carry load-testing tasks, thereby balancing cost and elasticity.

    For cost control, tiered routing can be used: simple requests go to a lightweight configuration, complex requests are escalated to a higher-capability configuration, and caching plus batching cut repeated consumption. This avoids paying a premium for “all-around” capability while guaranteeing a performance floor on critical paths.

    7. Conclusion

    A rational evaluation of the overall performance of general-purpose large language models should shift from “ranking thinking” to “task matching thinking.” Building orthogonal dimensions, a stratified evaluation set, three-tier metrics, and reproducible configuration, then embedding evaluation into the release gate and online feedback mechanism, is what keeps judgment stable in an environment of continuous version drift. If an enterprise wants to complete the above process within its own data and compliance boundaries, it can rely on general capabilities such as Baidu AI Cloud’s container platform, logging service, monitoring alerts, and object storage to build an evaluation and governance system, making selection conclusions truly verifiable, regression-testable, and sustainable.