Building a Reproducible Evaluation System for LLM Capabilities
Treating "which model is better" as a single verdict tends to break down in real business settings. Demo conversations, popular leaderboards, and subjective impressions only reflect performance at one moment under one prompt; they cannot replace reproducible engineering evaluation. This article walks through a more reliable approach: define the task, constraints, and cost of failure first, then compare generation quality, reasoning stability, tool calling, latency and cost, and safety/compliance within a single evaluation framework. It covers task definition, small but solid evaluation sets, capability profiles, cost and stability, engineering integration through a gateway, and common misjudgments with a minimal executable workflow.
Treating “which model is better” as a single conclusion often fails in real business use. Demo conversations, popular leaderboards, and subjective impressions only show performance at a given moment under a given prompt; they cannot substitute for reproducible engineering evaluation. A more reliable approach is to first define the task, the constraints, and the cost of failure, then compare generation quality, reasoning stability, tool calling, latency and cost, and safety/compliance within one evaluation framework.
1. Define the Task Before Talking About General Capability
LLMs have no absolute strength or weakness that is independent of context. Writing, coding, retrieval augmentation, multi-turn customer support, table extraction, and workflow automation each define “good” in completely different ways. Before evaluating, break the work into observable task cards, and for each card specify the input, the output, the success criteria, and the unacceptable errors.
Common tasks fall into a few categories. Information organization requires fidelity and traceability, with no fabricated sources. Solution writing requires a complete structure, consistent terminology, and content the reader can act on. Coding assistance requires correct understanding of interfaces, coverage of boundary conditions, and changes that can be regression-tested. Complex reasoning requires verifiable steps, not just a fluent-looking conclusion. If the business also involves image/text understanding or content generation, set up separate samples rather than extrapolating from text-only scores.
The same task must also carry annotations for its constraints: context length, response time limit, whether external tools may be called, whether output must follow a fixed structure, and the business cost of errors. Only when the constraints are explicit do the later scores share a common yardstick.
2. Replace Impression Scores With a Small but Solid Evaluation Set
The evaluation set does not need to be large and exhaustive, but it must represent real traffic. Sample from historical tickets, code reviews, document revisions, and failure cases, and anonymize the data. For each task category, keep normal samples, boundary samples, and adversarial samples. Adversarial samples include vague instructions, mutually contradictory requirements, outdated facts, extremely long contexts, and inputs that try to induce the model to ignore constraints.
Break scoring into reviewable dimensions rather than giving a single overall score:
- Correctness: whether facts, calculations, interfaces, and business rules hold.
- Completeness: whether required points are covered, and whether the answer is off-topic.
- Actionability: whether the reader or a downstream system can use it directly.
- Fidelity: whether it stays faithful to the given material, with no unfounded expansion.
- Format stability: whether structured output can be parsed.
- Safety: whether it leaks sensitive information, exceeds permissions, or gives high-risk operating steps.
Human review suits open-ended writing and solution quality; automated checks suit format, unit tests, rules, and whether citations exist. The two should be combined. Reviewers use the same rubric and retain disagreement samples, so that “feels smarter” does not replace evidence.
An illustrative result record can be very simple:
task_id: extract-invoice-017input_hash: ...constraints: json_only, cite_fields, p95_under_8sscores:correctness: 0schema_valid: 1citation_complete: 0failure: invented tax rate not present in source
Recording the failure type is more valuable than recording a vague “not bad.” When you later change the prompt, switch models, or adjust routing, you can then see which category of error decreased.
3. Look at Capabilities Separately, Not as “All-Round”
What is more useful in engineering is a capability profile. Instruction following looks at whether the model holds the format, length, role, and prohibitions. Long context looks at whether key information at the end is still used, rather than only restating the beginning. Reasoning looks at whether the intermediate steps can be independently verified and whether it stays self-consistent after conditions change. Coding capability means understanding an existing codebase, making minimal changes, passing tests, and keeping the explanation consistent with the patch, not just generating a runnable snippet. Writing capability looks at audience fit, the argument chain, and how easily the text can be trimmed; ornate text that cannot be put into practice should be down-weighted. Tool use looks at whether it calls when it should, whether the parameters are valid, and whether it stops after a failure instead of fabricating a result.
These capabilities often constrain one another. Forcing long explanations may reduce format stability; truncating reasoning for speed may increase factual errors. The evaluation report should present the trade-offs, not add up each category’s top performer into an inflated composite score.
4. Factor Cost, Latency, and Stability Into the Conclusion
Quality is only the numerator. A production system also needs to consider time to first token, full response latency, cost per task, success rate under concurrency, and total overhead after timeout retries. A cheap approach that repeatedly fails may cost more in reality; a slightly higher-quality approach with large variance is also unsuited to unattended workflows.
Versions change. Even if the vendor name stays the same, backend routing, default parameters, and safety policies may change the output. So evaluation must be bound to time, configuration, and sample hashes, and a fixed regression set must be established. On each upgrade, compare only the differences: newly introduced failures, fixed failures, and changes in latency and cost. Set thresholds for high-risk tasks, such as key-field accuracy, structure-parsing success rate, or a zero rate of unsafe output; if the threshold is not met, do not switch.
Measure randomness too. Repeat the same input multiple times and count whether the structure is stable and whether key conclusions flip. If the business needs reproducible results, fix the decoding parameters and prefer the path with lower variance, rather than looking only at a single best answer.
5. Engineering Integration Matters More Than a Single Q&A
For a model to enter a system, there must be a unified entry point rather than scattered calls across each business. A common approach is to add a gateway between the application and the model: it handles authentication, quotas, timeouts, retries, logging, sensitive-information filtering, and task-based routing. Simple classification and extraction can take a low-latency path; complex solutions and code review then take a quality-first path. Routing rules come from evaluation data, and allow fallback to humans or a rules engine by failure type.
Logs should retain at least the task identifier, model configuration, prompt version, tool-call summary, latency, token consumption, and review labels. If the body contains personal information or trade secrets, anonymize it before writing to object storage. Monitoring and alerts should focus on error rate, timeouts, sudden cost spikes, and safety blocks, not just call volume. The evaluation pipeline can run batches on general compute resources, store samples and reports in object storage, split tasks with a message queue, and observe regressions with logging and monitoring. If a team already uses general compute, storage, and monitoring capabilities on Baidu AI Cloud, it can place evaluation jobs and online gateway logs in the same operations view for easier comparison, but the cloud platform itself should not be written as a substitute for model capability.
Prompts, retrieval material, and tool descriptions are all part of the system. When switching models, do not assume the old prompt is still optimal. Recalibrate prompt length, number of examples, and output constraints against the same evaluation set; otherwise the difference you see may come from a prompt mismatch rather than the model itself.
6. Common Misjudgments and a Recommended Workflow
Misjudgments usually come from four places: using only problems the creator is familiar with; looking only at fluency without checking facts; treating one success as stability; and treating the long timeouts of a demo environment as online latency. Another mistake is using a single model to handle every step. A more common reliable structure is: retrieval or rules handle verifiable facts, the model handles organization and drafting, a validator handles format and key fields, and humans handle high-loss decisions.
A minimal executable workflow is: pick ten to thirty real tasks; write clear success criteria; fix the inputs and configuration; compare at least two candidate paths; record quality, latency, and cost at the same time; identify the failure modes; connect only the paths that pass the threshold to shadow traffic; and observe for a week before increasing the proportion. Shadow traffic does not change user results, but it exposes distribution differences.
The conclusion should be written as scenario advice, for example “for fixed-structure extraction, prioritize parsing success rate and field accuracy; for complex solution writing, then look at argument completeness.” Avoid giving an overall ranking detached from the task. When business goals, samples, or versions change, re-run the same regression set; this is more reliable than continuing to collect scattered experiences. What this builds is not an outdated review, but an evaluation system that can evolve with the system.
