How to Build a Scenario-Based Evaluation System for Large Language Models

    Choosing the right LLM is hard when decisions rely on public leaderboard scores. This article explains how to build a scenario-based evaluation system across four layers—cases, runner, judge, and dashboard—with case design tiers, hybrid scoring, cost and latency metrics, engineering practices, and a practical rollout plan.

    1. The Problem: Why Leaderboard Scores Cannot Guide Model Selection

    In real AI application development, teams often face an awkward situation: when a technical lead is asked “which model should we use,” the only available answers are personal experience, community reputation, or a few static leaderboard screenshots. This approach has three structural problems.

    First, the evaluation objective is misaligned. Public leaderboards typically measure general knowledge Q&A or standardized exam questions, while real business needs stable output in specific scenarios, such as structured information extraction, long-document summarization, multi-turn tool calling, and image understanding. A high general score does not mean strong performance on your business distribution.

    Second, the evaluation dimensions are too narrow. A selection decision involves at least four dimensions: quality, cost, latency, and stability. A quality score alone cannot answer critical questions such as “how much quality do we gain per unit of cost.”

    Third, there is no reproducibility. Model versions keep iterating, so a conclusion that holds today may fail tomorrow. If the evaluation process is not captured as code and a test case set, the conclusions cannot become a lasting team asset.

    The vague question “which model is better” therefore needs to be turned into a computable one: “on my case set, how are the candidate models distributed across quality, cost, and latency?”

    2. Overall Design of the Evaluation System

    A usable scenario-based evaluation platform can be split into four layers:

    1. Case Layer → Runner Layer → Judge Layer → Dashboard Layer
    • Case layer: structured files describe inputs, expected constraints, and scoring rules.
    • Runner layer: unified concurrency scheduling, retries, rate limiting, and result persistence.
    • Judge layer: a three-tier hybrid of rule checks, model review, and human spot checks.
    • Dashboard layer: an overall ranking, per-task comparison, and failure-case drill-down.

    The key design principle is decoupling cases from models. The case set is a private team asset, and the model is just a replaceable execution backend. When models iterate, you only need to rerun the evaluation, not rewrite the evaluation logic.

    3. Case Design: From “Getting It Right” to “Pushing the Boundary”

    Case design is the core of the system’s value. Cases are recommended to be grouped into three difficulty tiers.

    1. Baseline cases (about 60%): cover high-frequency business scenarios for daily regression testing to detect whether a new version has degraded.
    2. Discriminative cases (about 30%): designed so that multiple models can attempt them but not all get them right, creating separation. Examples include structured extraction from long mixed Chinese-English text and multi-turn dialogue with ambiguous references.
    3. Boundary cases (about 10%): deliberately push against the capability ceiling to observe failure modes rather than chase pass rates.

    The value of boundary cases is often underestimated. Take image generation as an example: you can design two types of extreme tasks. One is multilingual in-image rendering, requiring the same poster to accurately display text in five writing systems. The other is precise counting and occlusion reasoning, requiring accurate counts of multiple object categories in a stacked scene image. Pass rates for such tasks are often extremely low, but the differences in how models fail are highly informative: some models get the counts roughly right but ignore detail constraints, while others misidentify the object categories entirely. This difference in failure modes is the key basis for judging whether a model fits the business.

    Cases are recommended to be managed with declarative configuration for easy versioning:

    1. id: ocr_multilingual_poster
    2. category: multimodal
    3. difficulty: boundary
    4. input:
    5. prompt: "Generate an event poster with titles in five languages"
    6. constraints:
    7. - text_exact_match: true
    8. - language_count: 5
    9. scoring:
    10. rule_weight: 0.4
    11. judge_weight: 0.6

    4. Scoring Design: Rules, Model Review, and Human Spot Checks

    No single scoring method is reliable: pure rules struggle with open-ended output, while pure model review suffers from bias and drift. A three-tier hybrid is recommended:

    • Rule checks: handle decidable hard constraints, such as whether fields are complete, whether counts are correct, and whether the format is valid.
    • Model review: score open-ended output against a predefined scorecard that must spell out the observable characteristics of each score band.
    • Human spot checks: sample and review a proportion of results to calibrate model review bias.

    To reduce review bias, three things should be done: fix the review prompt and scorecard version, review the same output multiple times and take the median, and anonymize and randomly order candidate model outputs.

    5. Cost and Latency: Turning Cost-Effectiveness into a Computable Metric

    When quality is close, cost is often the deciding factor. The evaluation should record input and output token consumption, end-to-end latency, and the number of failed retries for each case, then convert them into “cost per unit of quality.”

    A simple cost-effectiveness metric can be used:

    1. Value = Score / (α * Cost + β * Latency)

    Here α and β are determined by how sensitive the business is to cost and experience. A common outcome in practice is that two models differ by less than one percentage point in overall score but by an order of magnitude in cost. Choosing the lower-cost option can often achieve higher overall quality within the same budget—because the saved budget can be invested in better data, longer reasoning chains, or multi-way voting.

    6. Engineering Implementation Essentials

    • Unified adapter layer: wrap different models behind a consistent calling interface to hide protocol differences.
    • Concurrency and rate limiting: use a queue to control concurrency and implement exponential backoff retries to avoid data gaps caused by rate limiting.
    • Traceable results: record the model version, timestamp, raw response, and scoring rationale for each case to ensure reproducibility.
    • Data and key security: desensitize sensitive data before adding it to the case library, manage keys centrally through a key management service, and prohibit hardcoding.
    • Elastic scaling: evaluation tasks are a typical batch workload, suitable for on-demand provisioning on a container platform and release after completion, combined with object storage for results and logging and monitoring services with alerting to track failure rates.

    7. Interpreting Results: Three Common Misjudgments

    1. Looking only at the overall score. An overall score hides uneven capabilities, so you must drill down to the per-task distribution.
    2. Ignoring variance. Large fluctuations across repeated runs of the same case indicate insufficient stability and high production risk.
    3. Using old conclusions for new decisions. Models iterate frequently, so evaluation should be a scheduled regression in a pipeline, not a one-off activity.

    Step one: gather 20 to 50 real business cases and get the baseline running. Step two: add discriminative and boundary cases to form a versioned case library. Step three: integrate cost and latency collection to produce a cost-effectiveness view. Step four: integrate evaluation into continuous integration so that model or prompt changes trigger automatic regression.

    After these four steps, the team’s answer to “which model to use” shifts from subjective judgment to data-backed evidence: not “I think it is stronger,” but “on my case set, here is its specific position across the quality, cost, and latency axes.” This is the fundamental value of scenario-based evaluation over general leaderboards.