LLM Model Selection Guide: Reproducible Evaluation Beyond Public Leaderboards

    This guide explains why public leaderboard scores do not directly predict business performance. It covers how to define measurable metrics, build a representative evaluation set, run reproducible tests, measure cost and latency, assess output stability and compliance, roll out a new model gradually, and monitor it after launch.

    1. Why Public Leaderboards Cannot Be Applied Directly to Business

    Public leaderboards usually rely on fixed datasets, standardized prompt templates, and uniform scoring rules. These settings make horizontal comparison easy, but they differ significantly from real business conditions.

    First, the task distribution differs. Leaderboard questions are mostly academic Q&A, math reasoning, or code completion. Enterprise workloads may involve ticket classification, contract field extraction, or multi-turn customer service. The two sets of tasks overlap only partly in the abilities they require.

    Second, the input format differs. Business requests often include long, templated system instructions, conversation history, and retrieved passages. Their average context length can differ greatly from leaderboard samples. A model’s performance on long context may differ completely from its performance on short text.

    Third, the constraints differ. Business systems care about time to first token, concurrent throughput, cost per call, output format stability, and compliance requirements. Leaderboards usually report only accuracy and do not reflect these engineering metrics.

    Therefore, leaderboards are useful for narrowing the list of candidates, but the final decision must rely on your own data.

    2. Breaking Requirements Down into Measurable Metrics

    Before selecting a model, teams should first define the task type and acceptance criteria for each business scenario. Common task types include:

    • Classification and tagging: Focus on precision and recall. The output is usually a fixed set of enumerated values.
    • Information extraction: Focus on field-level accuracy and format compliance. The output must be directly parseable by a program.
    • Code generation and modification: Focus on unit test pass rate and compilation success rate.
    • Long-document Q&A: Focus on consistency between the answer and the source text, and on the ability to locate key information in long context.
    • Multi-turn dialogue: Focus on intent retention, refusal boundaries, and tone consistency.

    For each scenario, define at least three categories of metrics:

    Dimension Example Metrics Description
    Quality Field accuracy, pass rate, human rating Determines whether the output can be used directly
    Engineering P95 time to first token, throughput, structured output parse failure rate Determines whether the system can meet its online SLA
    Economics Effective cost per call, retry rate Determines total cost at scale

    The clearer the metric definitions, the easier it is to draw conclusions from comparisons. For example, “the answer quality is good” cannot be tested, but “the proportion of extracted contract amount fields that match human annotations is at least a given threshold” can be checked directly.

    3. Building a Business Evaluation Set

    The evaluation set is the core asset of model selection. It should closely resemble real production traffic and cover both high-frequency and long-tail scenarios.

    3.1 Sample Sources

    Give priority to anonymized historical requests. For a new business, domain experts can write seed samples, which are then expanded through manual rewriting. Samples must be desensitized to remove personal information, trade secrets, and sensitive fields. Teams should also confirm that the data use complies with internal compliance rules.

    3.2 Quantity and Stratification

    For each task type, start with 200 to 500 samples. Stratify samples along the following dimensions:

    • Difficulty: The ratio of easy, medium, and hard samples should roughly match the production distribution.
    • Length: Short, medium, and long inputs should each have enough samples.
    • Edge cases: Empty input, noisy text, out-of-scope requests, and requests that should be refused.

    Stratification prevents results from being inflated by a few simple samples. It also exposes model weaknesses in long-tail scenarios.

    3.3 Annotation and Scoring Methods

    Scoring methods fall into three broad categories:

    1. Rule-based scoring: Suitable for structured outputs such as classification labels, enumerations, and JSON fields. It is low-cost and produces stable results.
    2. Human scoring: Suitable for open-ended answers. It is expensive, so teams need to write detailed scoring guidelines and sample-check annotation consistency.
    3. Model-assisted scoring: Can be used for large-scale initial screening. However, the scoring model also has biases, so key conclusions must be verified by sampling and human review.

    We recommend having two annotators label the same batch of samples independently, then calculating an inter-annotator agreement coefficient. If agreement is too low, the scoring guidelines need revision.

    4. Building a Reproducible Evaluation Pipeline

    The goal of the evaluation pipeline is to ensure that every comparison runs under the same conditions. Key requirements include: fixing the prompt template version, fixing sampling parameters, recording inputs, outputs, and latency, and saving the version of the evaluation dataset.

    The following is a general evaluation pipeline in pseudocode. It is platform-agnostic:

    1. for each candidate in candidate_models:
    2. for each sample in eval_set:
    3. start = now()
    4. response = call_model(
    5. model = candidate,
    6. prompt = prompt_template_v(version),
    7. input = sample.input,
    8. temperature = fixed_value,
    9. max_tokens = fixed_limit
    10. )
    11. latency = now() - start
    12. score = judge(response, sample.reference)
    13. record(candidate, sample.id, score, latency, token_usage)
    14. report = aggregate(records, group_by = [candidate, task_type])

    When implementing this pipeline, keep the following points in mind:

    • Record the prompt template, sampling parameters, and evaluation dataset version in the evaluation report so the results can be reproduced.
    • Count failures caused by network fluctuations separately. Do not include them in the model quality score.
    • Keep the evaluation script decoupled from business code. Connect to different models through a unified calling abstraction, so you do not need to rewrite the logic for each candidate.

    5. Measuring Cost and Latency

    5.1 Cost per Call

    The cost of a single call depends on the number of billable input and output tokens. You can estimate it with the following formula:

    1. Cost per call = input tokens × input price + output tokens × output price

    Note that the number of output tokens varies with each model’s output style. For the same task, one model may give a more concise answer while another gives a longer one. The actual cost difference between the two can far exceed the difference in unit prices. Therefore, use the average values measured on the evaluation set, not estimates.

    5.2 Effective Cost

    When a call fails and must be retried, the cost of the retries also counts toward the total. Effective cost can be calculated with the following formula:

    1. Effective cost = cost per call ÷ single-attempt success rate

    If the parse failure rate for structured output is high and multiple retries are needed to get a usable result, the actual cost can be high even when the unit price is low.

    5.3 Latency Distribution

    Average latency can hide long-tail problems. Track both P50 and P95, and measure them separately at different concurrency levels. Time to first token strongly affects the experience of streaming interactions. Total completion time matters more for throughput in batch tasks.

    6. Stability, Accuracy, and Compliance

    6.1 Output Format Stability

    For outputs that must be parsed by a program, format errors are the most common source of failure. During evaluation, measure the parse success rate for structured outputs, and check for missing fields, type errors, and extra text.

    Some platforms support specifying an output structure in the request or using constrained decoding, which can significantly reduce format errors. Whether to enable these features should be decided based on evaluation results.

    6.2 Hallucination and Refusal

    For Q&A and summarization tasks, measure the hallucination rate separately. This is the proportion of answers that contain information not present in the source text. For requests that should be refused, measure refusal accuracy and the false refusal rate. These two kinds of metrics usually involve a trade-off. The more cautious the refusals, the fewer the hallucinations, but the higher the chance that legitimate requests are wrongly refused.

    6.3 Data Compliance

    When selecting a model, confirm the following: whether your data will be used for model training, how long the provider retains your data, whether data storage locations meet regulatory requirements, and whether private deployment or dedicated connectivity is supported. Legal and security teams should review these terms. Do not rely on technical evaluation results alone.

    7. Gradual Rollout and Rollback

    Even after an evaluation meets expectations, do not switch all traffic at once. The recommended rollout path is as follows:

    1. Shadow traffic: The new model receives live requests in parallel, but its responses are not returned to users. They are used only for comparison and logging.
    2. Small-percentage canary: Gradually increase traffic by user or request percentage. Start with a small share, then increase it step by step.
    3. Full cutover: Complete the switch after key metrics have met their targets for a sustained period. Keep a fast rollback path to the previous version.

    In implementation, we recommend adding a routing layer between business code and the models. The routing layer selects the model based on configuration, records call logs, and executes fallback strategies. With this design, switching models only requires a configuration change, not a business code release, and rollback is faster.

    8. Continuous Monitoring and Periodic Re-evaluation

    After a model goes live, its online performance can still drift as the input distribution changes. We recommend setting up the following mechanisms:

    • Sampled re-evaluation: Periodically sample online requests and re-evaluate them with the same scoring rules.
    • Drift detection: Monitor input length distribution, output length distribution, parse failure rate, and user feedback rate. Trigger re-evaluation when any indicator is abnormal.
    • Version records: Save the model version, prompt version, and evaluation report for each change. This creates a traceable change history.

    If your business runs on Baidu AI Cloud, you can reuse its log service and monitoring and alerting capabilities. You can connect parse failure rate, latency percentiles, and cost metrics to your existing alerting pipeline, which reduces the need for additional infrastructure.

    9. Practical Recommendations for Teams

    1. Maintain a model registry: Record each candidate model’s capability boundaries, suitable use cases, unit prices, compliance terms, and owner.
    2. Set a fixed re-evaluation schedule: Whenever a new model version is released, compare it against the established evaluation set. Do not make ad hoc decisions.
    3. Manage the evaluation set as code: Keep it under version control. Require a stated reason for every change.
    4. Involve business stakeholders in defining metrics: The technical team handles measurement. The business team defines what a good result looks like.
    5. Limit switching frequency: Frequent switching increases the cost of prompt tuning, monitoring adaptation, and team learning. Switch only when evaluation results show a clear improvement.

    Key Takeaways

    Model selection is an ongoing engineering process. Teams should start from business tasks, decide based on measurable metrics and their own evaluation sets, make explicit trade-offs among cost, latency, quality, and compliance, and protect production stability through gradual rollout and continuous monitoring. With a disciplined process, selection decisions can be updated in time as business needs and model versions change.