LLM Model Selection Beyond Leaderboards: A Reproducible Evaluation Method

    Public leaderboard scores are often poor predictors of task-specific LLM performance, especially when quality and cost must be balanced. This article outlines a reproducible evaluation method: define task boundaries, build representative and reliably annotated test sets, combine automated, model-assisted, and human scoring, incorporate token costs under a quality threshold, handle image-generation-specific dimensions, and avoid common interpretation pitfalls. It also provides code examples for weighted scoring, cost calculation, and model selection, plus a step-by-step implementation checklist.

    1. Why Leaderboard Scores Cannot Be Used Directly for Model Selection

    Public leaderboards usually provide a composite score. This single number is a weighted average of results across multiple task categories, making it easy to compare models. The problem is that the weights are chosen by the leaderboard designers and may not match your business priorities. A difference of a few tenths of a point between two models does not mean they perform similarly on your customer support Q&A, code generation, or copyediting tasks.

    More importantly, score differences and cost differences are often disproportionate. When two models have similar quality but their unit prices differ by more than ten times, the core question shifts from “which one is stronger” to “which one is cheaper while meeting the quality threshold.” This requires putting quality and cost into the same evaluation framework.

    2. Define Task Boundaries First

    Before evaluation begins, answer three questions:

    1. What real tasks exist in the business, and what proportion does each represent?
    2. What is the success criterion for each task type?
    3. Which errors are unacceptable?

    Take knowledge Q&A as an example. The cost of a factual error is far higher than that of slightly awkward language. If both types of errors are weighted equally, the conclusion will be distorted. We recommend splitting evaluation into several subsets by task type, defining metrics and weights for each subset separately, and then combining them into a total score.

    3. Build the Evaluation Set

    The evaluation set is the foundation of the assessment, and its quality depends on three aspects.

    • Coverage: Include high-frequency requests, edge cases, adversarial inputs, and multi-turn conversations. Testing only common questions will overestimate a model’s stability in long-tail scenarios.
    • Representativeness: Cases should come from de-identified real business logs, not from examples written from developers’ impressions. Manually written questions tend to be too neatly structured and differ significantly from online inputs.
    • Annotation reliability: Each case needs a clear reference answer or scoring rubric. We recommend having two people annotate independently, arbitrating disputed samples, and recording the agreement coefficient as a reference for evaluation set quality.

    Data governance is equally important. Before cases enter the evaluation set, complete deduplication, remove personal information, and perform stratified sampling by task type to avoid overrepresenting one task category.

    4. Design the Scoring Approach

    Scoring methods generally fall into three categories, which can be combined.

    Automated metrics are suitable when answers can be judged by machine, such as exact match, regex validation, JSON schema validation, and unit test pass rates for code tasks. These metrics are stable, low-cost, and suitable for large-scale regression.

    Model-assisted judging is suitable for open-ended responses, such as summarization and explanation tasks. The judge model needs a clear scoring rubric, and known biases should be addressed: a tendency to favor longer answers and a tendency to favor earlier options. Controlled checks should be performed by swapping order and controlling length.

    Human review is used for calibration. We recommend randomly sampling 5% to 10% of cases for human scoring and calculating the correlation between automated scores and human scores. If the correlation is low, revise the scoring rubric first rather than directly trusting automated results.

    The following code shows the basic data structures for cases and weights, as well as how to calculate the weighted total score:

    1. from dataclasses import dataclass
    2. @dataclass
    3. class EvalCase:
    4. case_id: str
    5. task_type: str
    6. prompt: str
    7. checker: str # "exact" | "json_schema" | "unit_test" | "judge" | "human"
    8. weight: float = 1.0
    9. def weighted_score(case_scores: dict[str, float], cases: list[EvalCase]) -> float:
    10. """case_scores ranges from [0, 1]; missing cases are counted as 0."""
    11. total_weight = sum(c.weight for c in cases)
    12. if total_weight == 0:
    13. return 0.0
    14. earned = sum(case_scores.get(c.case_id, 0.0) * c.weight for c in cases)
    15. return earned / total_weight
    16. def score_by_task(case_scores: dict[str, float], cases: list[EvalCase]) -> dict[str, float]:
    17. """Calculate scores separately by task type to surface weaknesses in specific task categories."""
    18. groups: dict[str, list[EvalCase]] = {}
    19. for c in cases:
    20. groups.setdefault(c.task_type, []).append(c)
    21. return {t: weighted_score(case_scores, cs) for t, cs in groups.items()}

    Counting missing cases as zero prevents a model from obtaining an artificially high average by skipping difficult questions. Per-task results are more instructive than a single total score.

    5. Put Cost into the Same Metric

    Cost can be calculated by token pricing, split into input and output components. For most services, the output price is higher than the input price, so the cost share in long-answer scenarios rises noticeably.

    The cost of a single call is calculated as follows:

    1. def call_cost(in_tokens: int, out_tokens: int,
    2. price_in_per_m: float, price_out_per_m: float) -> float:
    3. """Prices are per million tokens; returns the cost of a single call."""
    4. return in_tokens / 1_000_000 * price_in_per_m + out_tokens / 1_000_000 * price_out_per_m

    For model selection, a more practical approach is to set a quality threshold and then choose the lowest-cost option among eligible candidates:

    1. def pick_model(candidates: list[dict], min_quality: float) -> dict | None:
    2. """Each candidate contains name, quality (0 to 1), and cost_per_task fields."""
    3. eligible = [m for m in candidates if m["quality"] >= min_quality]
    4. return min(eligible, key=lambda m: m["cost_per_task"], default=None)

    The quality threshold should be set by business stakeholders—for example, “the critical factual error rate is below a certain threshold”—rather than by developers based on experience. Once the threshold is fixed, the comparison shifts from scores to “cost of meeting the threshold,” making the decision basis much clearer.

    6. Special Considerations for Image Generation Evaluation

    Image generation has different evaluation dimensions from text, mainly including the following.

    • Instruction following: Whether the number of elements, spatial relationships, colors, and attributes match the prompt.
    • Text rendering: Whether Chinese, English, or mixed Chinese-English text in the image is correct and complete. This can be checked with OCR tools, but human review is still required.
    • Lighting and materials: Whether details such as neon glow, mirror reflections, and wet ground on a rainy night are reasonable, and whether there are obvious structural errors.
    • Style consistency: Whether the style and subject remain stable when the same prompt is generated multiple times.

    Because generation is stochastic, each prompt should be sampled multiple times, with sampling parameters and random seeds recorded, and the mean and variance reported. Judging from a single image gives low reliability.

    7. Common Pitfalls When Interpreting Results

    1. Treating a score difference smaller than the error margin as a ranking basis. Calculate the standard deviation or confidence interval across multiple runs. If the intervals of two models clearly overlap, they should not be ranked on that basis.
    2. Evaluation set overlap with training data. This inflates scores. Use string or semantic similarity search to check whether evaluation samples appear in public corpora.
    3. Looking only at average scores and ignoring failure modes. Analyze the distribution of error types, such as refusals, format errors, factual errors, and truncation from excessive length. Their business impact differs.
    4. Ignoring latency and stability. Record P95 latency, timeout rates, and the number of rate-limiting events. For real-time interactive scenarios, latency may matter more than a small quality difference.
    5. Ignoring judge bias. When using model judges, test their preference for length and position, and validate conclusions with human samples.

    8. Implementation Recommendations

    We recommend running evaluations in the following steps:

    1. Inventory business tasks and determine the weight of each task type.
    2. Collect and de-identify samples, build a stratified evaluation set, and complete dual annotation.
    3. Write scoring rubrics and automate the parts that can be judged automatically.
    4. Run candidate models with unified parameters and prompt templates, and save raw outputs.
    5. Calculate per-task scores, confidence intervals, and per-task cost.
    6. Sample cases for human review to calibrate automated and model-judge results.
    7. Set a quality threshold, produce a model selection conclusion, and retest quarterly or when model versions are updated.

    Evaluation results are time-sensitive. Model iterations and business changes will alter the optimal choice. Turning the evaluation process into reproducible scripts has more long-term value than a one-time ranking.