LLM Evaluation for Model Selection: A Reproducible Engineering Approach

    When large language models iterate rapidly and their naming and capability boundaries keep shifting, choosing a model based solely on leaderboard rankings, community reputation, or a few demo cases carries high risk. A more reliable approach is to turn model selection into a reproducible engineering evaluation problem: first define business objectives, then design metrics, datasets, prompt versions, and execution workflows, and finally make decisions under cost and risk constraints. This article does not rank any specific models. Instead, it presents a multi-model evaluation methodology suitable for enterprise teams, focusing on three practical constraints: limited budget, short timelines, and the need for explainable conclusions.

    When LLMs iterate rapidly and their naming and capability boundaries keep shifting, choosing a model based solely on leaderboard rankings, community reputation, or a few demo cases carries high risk. A more reliable approach is to turn model selection into a reproducible engineering evaluation problem: first define business objectives, then design metrics, datasets, prompt versions, and execution workflows, and finally make decisions under cost and risk constraints. This article does not rank any specific models. Instead, it presents a multi-model evaluation methodology suitable for enterprise teams, focusing on three practical constraints: limited budget, short timelines, and the need for explainable conclusions.

    1. Define the Problem First: Evaluation Is Not Replaying a Leaderboard

    Many teams start evaluations by simply “gathering a batch of questions, running a few models, and looking at total scores.” The problems with this approach: the test cases are unrelated to the business, scoring criteria are inconsistent, and failure cases cannot be attributed to root causes. The result is often nothing more than “it feels like one model is stronger.” The first step in engineering-driven evaluation is to clarify the evaluation objective.

    Common objectives fall into three categories:

    1. Selection evaluation: Comparing multiple candidate models before production deployment, focusing on overall cost, quality, stability, and compliance risk.
    2. Regression evaluation: After a model or prompt upgrade, verifying whether key scenarios have degraded, focusing on failure rates and accuracy on critical fields.
    3. Launch acceptance: Running small-traffic validation in the real business pipeline, focusing on end-to-end success rate, latency, cost, and the proportion of cases requiring manual fallback.

    Different objectives require different deliverables. Selection evaluation needs a decision matrix and a risk list; regression evaluation needs a baseline version and a diff report; launch acceptance needs monitoring metrics and rollback criteria. It is good practice to write a one-sentence objective before starting, for example: “Within a budget of roughly USD 150, select from three candidates the one best suited for invoice field extraction, requiring core-field accuracy no lower than the baseline and controllable per-case cost.”

    You should also break the business scenario into testable task units. For example, information extraction can be split into field localization, format normalization, missing-value handling, and long-document truncation handling; question answering can be split into single-hop QA, multi-hop QA, refusal, and safety responses. Only when task units are clearly defined do downstream metrics become meaningful.

    2. Metrics: Don’t Rely on a Single Overall Score

    The most common mistake in multi-model evaluation is replacing all conclusions with one average score. A sounder approach is to build a layered metric system weighted by business priorities.

    Dimension Key Question Example Metrics
    Quality Is the task completed, and is critical content correct? Task success rate, field accuracy, human preference win rate
    Stability Are repeated runs consistent? Does performance degrade on long inputs? Repeat consistency rate, failure rate, long-text truncation rate
    Performance Does it meet interactive or batch-processing requirements? Average latency, P95 latency, timeout rate
    Cost Is per-case cost acceptable? Cost per call, rerun cost, manual review cost
    Safety & Compliance Any sensitive-data leakage or inappropriate output? Sensitive-information hit rate, refusal accuracy, audit traceability
    Maintainability How easy are prompt adaptation and error diagnosis? Prompt change volume, error diagnosability rate, log completeness

    Metric design should avoid being “professional-looking but unexecutable.” For example, “intelligence” is hard to measure directly; instead, break it down into “critical-field accuracy,” “format compliance rate,” and “proportion of outputs requiring manual edits.” For generation tasks, use blind review: hide candidate sources, have two or more reviewers score against a unified rubric, and record disagreements. For extraction tasks, prefer programmatically verifiable field-level metrics.

    Weights should come from business constraints, not guesswork. For offline batch processing, latency weight can be lowered; for online customer service, P95 latency and refusal accuracy should be weighted higher. The final decision matrix should retain both raw metrics and weighted results, rather than showing only a single total score.

    3. Data and Prompts: Evaluation Assets Must Be Versioned

    Evaluation datasets and prompts are core evaluation assets. Without version control, today’s conclusions cannot be reproduced tomorrow. It is recommended to organize the evaluation set in three tiers:

    • Smoke set: 20–50 highly representative samples for quickly eliminating clearly unusable candidates.
    • Core set: 200–500 samples covering the main task branches, used for the primary evaluation.
    • Extended set: Long-tail, edge-case, adversarial, and real-world failure回流 samples, used for verification.

    (Extended set: long-tail, edge-case, adversarial, and real-world failure回流 samples, used for verification.)

    Samples should be anonymized, with source, annotator, annotation time, expected output, and tolerance rules preserved. Prompts should be templated and versioned: variable injection, system constraints, output format, and few-shot examples should each be tracked with version numbers. Every evaluation report should be bound to “dataset version + prompt version + execution parameters.”

    Here is a neutral example of an evaluation configuration:

    1. experiment:
    2. id: eval_2025_q2
    3. candidates: [candidate_a, candidate_b, candidate_c]
    4. dataset: core_v3
    5. prompt: task_extract_v7
    6. repeats: 3
    7. metrics:
    8. - success_rate
    9. - field_accuracy
    10. - p95_latency
    11. - cost_per_case
    12. budget_cap_cny: 1000

    The execution logic should also remain auditable:

    1. def run_case(case, candidate, prompt_version):
    2. prompt = render(prompt_version, case.input)
    3. result = invoke(candidate, prompt, temperature=0.2, max_tokens=1024)
    4. parsed = parse_output(result, schema=case.output_schema)
    5. return score(parsed, case.expected, case.rules)

    The point here is not any specific API, but recording the input, prompt version, execution parameters, raw output, parsed result, and score. Only with a complete evidence chain can you later explain “why this model was chosen” and “at which layer the failure occurred.”

    4. Budget and Execution: Smoke First, Then Core, Then Review

    Under a limited budget, don’t run everything at once. A three-phase execution is recommended:

    1. Smoke phase: Use the smoke set to validate the parsing, scoring, and logging pipeline, and confirm output formats and billing conventions.
    2. Core phase: Run the core set against candidates that passed the smoke phase, repeating each case 2–3 times to observe stability.
    3. Review phase: Manually review only samples with significant differences, failures, or high risk, avoiding spending budget on low-information samples.

    Cost estimation should include API call costs, manual annotation and review costs, rerun costs, and engineering maintenance costs. A simplified formula: total cost ≈ number of samples × repeats × cost per call + manual review hours × hourly rate + failure rerun cost. With a budget of roughly USD 150, prioritize core-set coverage and failure-analysis quality over blindly increasing sample size.

    During execution, keep parameters consistent: temperature, max output length, timeout, retry strategy, and concurrency should all be recorded. For latency metrics, record both the average and P95, since averages can mask long-tail issues. For generation tasks, repeat-run consistency reflects stability; for extraction tasks, field-level failure clustering is more valuable than an overall score.

    5. Result Analysis: From “Which Is Stronger” to “Which Fits Better”

    Result analysis should answer three questions: In which scenarios does each candidate perform well? Are failures concentrated in fixable prompt or parsing layers? After weighing cost and risk, is the candidate worth advancing to the next stage?

    Four types of deliverables are recommended:

    • Overview table: Distribution of each candidate across quality, stability, latency, and cost—don’t look only at means.
    • Failure clustering: Attribute failures to categories such as missing fields, format errors, long-text truncation, incorrect refusals, and parsing failures.
    • Scenario slicing: Compare candidates per business sub-scenario to avoid global averages hiding local weaknesses.
    • Decision matrix: Weighted by business priorities, with risk items attached explaining “not recommended for launch.”

    A decision matrix might look like this:

    Dimension Weight Scoring Method Data Source
    Core quality 40% Core-set field accuracy Automated scoring + spot checks
    Stability 20% Repeat consistency and failure rate Multi-run logs
    Cost 20% Comprehensive per-case cost API and manual accounting
    Latency 10% P95 latency Execution logs
    Compliance & maintainability 10% Safety checks and error diagnosability Review records

    When making the decision, don’t chase an “all-around champion”; look for the “best within constraints.” A candidate with a slightly lower average score may still be the better fit for the current business stage if its failure modes are concentrated and fixable at the prompt and parsing layers, and its cost is lower.

    6. Engineering Implementation: Turn Evaluation into a Continuous Capability

    The conclusions of a one-off evaluation expire as versions iterate, so evaluation should be built as a pipeline: data version management, prompt version management, batch execution, results stored in a database, report generation, and regression alerting. Evaluation assets can be stored in object storage, execution logs can go into a logging service, key metrics can be wired into monitoring and alerting, and batch jobs can run on a container platform. Teams using Baidu AI Cloud’s general-purpose services can combine object storage, logging, monitoring/alerting, and container platform capabilities as needed, but the specific setup should be evaluated against your existing architecture and permission system.

    Three points deserve special attention in implementation: first, permissions and anonymization—evaluation data must not contain unauthorized sensitive information; second, traceability—every conclusion must be traceable back to samples, prompts, and execution parameters; third, regression mechanisms—automatically run the smoke and core sets after any model or prompt change, and block releases when key metrics degrade.

    7. Common Pitfalls and Conclusion

    Common pitfalls include: drawing strong conclusions from tiny samples; overfitting prompts to the evaluation set; comparing stability based on a single run; ignoring manual review and failure-handling costs; and treating external leaderboards directly as business conclusions. A more reliable path is: use small-sample smoke tests for quick elimination, use the core set for explainable differences, use failure clustering to guide optimization, use a decision matrix to finalize selection, and accumulate evaluation assets into a continuous regression capability. This way, even as model versions keep iterating rapidly, teams can use a limited budget to produce selection conclusions that are reproducible, explainable, and actionable.