How to Run Rigorous Side-by-Side LLM Evaluations

    A rigorous side-by-side LLM evaluation is a reproducible evidence chain, not a leaderboard of chat impressions. This article covers writing an acceptance spec, building a complete sample set, versioning prompts, logging the exact model that was called, scoring by dimension with bounded conclusions, and feeding results into engineering practice.

    In software engineering and applied AI, teams often need to compare several large language models side by side: the same tasks and the same inputs, judged on understanding, reasoning, code, structured output, and stability. A rushed evaluation easily treats the feel of one conversation as a ranking of model capability. A quieter failure is version mismatch: the name used in marketing, the console default, and the model identifier actually called do not match, and the team only notices after the run that the comparison was not of the same generation of capability. The goal of a rigorous evaluation is not to manufacture a leaderboard. It is to produce a reproducible evidence chain: a clear task definition, controlled inputs, explainable scoring, and conclusions limited to a stated scope.

    Write the evaluation question as an acceptance spec

    Before calling any API, write down what is being compared as a specification, not as a sentence like “see which model is smarter.” At minimum, make four things explicit.

    First, task boundaries: short-form Q&A, long-context extraction, multi-turn rewriting, code completion, or constrained JSON generation. These tasks place very different demands on instruction following, context window, and hallucination control.

    Second, success criteria: correctness, completeness, valid format, compilable, executable, or consistent with a given document. Decide which items are hard gates and which are bonuses.

    Third, failure types: refusal, going off topic, fabricated citations, format drift, and silent truncation. Encode these in advance; otherwise scoring later rests on impression.

    Fourth, constraints: temperature, maximum output length, whether a system prompt is allowed, whether tools are enabled, and whether a follow-up turn is allowed. If these conditions are not fixed, the comparison has no common ruler.

    For enterprise use, the spec should also reflect business risk. Customer support cares more about refusal policy and leakage of sensitive information. Engineering cares more about runnable code and error localization. Knowledge-base use cases care more about faithfulness to the given material. Conclusions must be written as relative performance on a named task under named constraints, not as a blanket “strongest model.”

    A sample set should be more complete than a few showcase prompts

    Many public evaluations rely on a small set of flashy prompts. That tends to select models that perform well, not models that fit production. A usable sample set usually includes routine items that cover the main flow, boundary items such as very long input, missing fields, and contradictory constraints, adversarial items that induce over-privilege or fabrication, and regression items that replay real historical failures. Each class should have a reference answer or an acceptance script, so scoring does not depend only on whether the text “reads smoothly.”

    Distribution matters. A set made only of algorithm-contest problems overrates reasoning and underrates business writing. A set made only of polite rewrites overrates style and underrates fact checking. Build a table by capability: instruction following, factual consistency, structured output, multi-turn state retention, code correctness, and consistency of domain terminology. Give each dimension several independent samples. If one item mixes too many variables, a failure cannot be attributed to misunderstanding versus a vague format constraint.

    Version prompts; do not edit them ad hoc in the chat window

    In a side-by-side evaluation, the prompt itself is an experimental variable. Adding one sentence to the system prompt—“must output valid JSON”—can change results sharply. Store prompts: task statement, input placeholders, output schema, prohibitions, and scoring notes, all fixed. During the run, change only the model identifier and the necessary decoding parameters. Do not “improve the prompt” while watching results. That confuses prompt-engineering skill with model capability.

    Prefer a layered prompt. The system layer states role and hard constraints. The user layer carries only this task’s data. When needed, use a separate scoring prompt so another model or a rules engine grades the output, instead of letting the same generation act as both candidate and examiner. For structured tasks, explicit field names, types, enum values, and a placeholder strategy on failure work better than a pile of adjectives. A sketch:

    1. System: Answer only from the given material. If the material does not cover the question, output {"status":"unknown"}. Do not invent sources.
    2. User: Material: {{doc}}
    3. Question: {{q}}
    4. Output: strict JSON with fields answer, evidence, and status.

    After the run, archive the prompt together with the samples, parameters, and model identifier. Otherwise, three months later, there is no way to explain where the scores came from.

    Calls and logs must prove that the same object was compared

    Version mismatch is one of the most common hard failures in side-by-side evaluation. The console display name, the marketing name in the docs, and the actual model field may not share one naming scheme. Record the model identifier returned by the request, the API version, and key response headers in the evaluation log. Do not treat an article title or a verbal habit as the source of truth. If the identifier does not match what was intended, discard that batch. Do not swap a few cases and keep writing conclusions.

    Logs should at least include sample ID, full prompt, decoding parameters, raw output, parsed structure, rule-check results, human-review notes, latency, and whether the output was truncated. With that record, “the model was not capable enough” can be separated from “the output was cut by a length limit.” For code tasks, run tests in a fixed sandbox rather than judging whether the code “looks runnable.” For knowledge tasks, check alignment with the source material: whether key entities appear in the given document and whether citations can be traced back.

    Decompose scores, and bound the conclusion

    A single total rank travels well and decides poorly. Itemized scores plus a failure profile are more useful: valid-format rate, key-fact hit rate, rate of harmful or over-privileged output, and rate of instruction forgetting after multiple turns. Human scoring should use a rubric and require the reviewer to point at evidence sentences, which reduces the bias of giving high scores for fluent prose. If automatic scoring is used, calibrate it with a small human-labeled set so the scoring model’s preference for a writing style does not dominate.

    Avoid absolute wording. State sample size, task type, whether tools were allowed, whether the run was multi-turn, the evaluation date, and the model identifier. Leading on short Q&A does not mean leading on long-document compliance review. What helps a business team more is which error types are fatal on their use case, and therefore whether to add retrieval, rule checks, or human confirmation—not merely to swap the generation backend.

    Connect the evaluation to engineering, not to impressions

    The output of a side-by-side evaluation should enter the development process. Prompts and schemas go into configuration. High-risk failure cases go into the regression set. Monitoring should track format-failure rate, refusal rate, latency, and truncation, not only one manual chat. A common cloud setup stores samples and logs in object storage, runs evaluation jobs asynchronously through a message queue, executes isolated code checks on a container platform, and follows production drift with logging and alerts. These are general capability combinations; they do not depend on a particular display name.

    If the team ships coding assistants or knowledge Q&A, the evaluation should also cover whether tool calls stay inside permissions and whether retrieved passages are restated faithfully. High generation quality still amplifies production risk if the system calls tools beyond its authority or departs from the source material. Object storage, containers, and monitoring on a cloud platform such as Baidu AI Cloud can turn an evaluation that lives on a personal notebook into a repeatable pipeline. What still matters is that the spec, the samples, and the identifiers stay consistent.

    Common mistakes and corrections

    Treating a marketing alias as the call identifier, comparing models with different prompts, publishing an overall ranking from too few samples, showing only successes, letting the same model grade itself, ignoring truncation and timeouts, and treating fluent style as factual correctness—these leave the evaluation as “money spent, judgment worse.” The corrections are straightforward: take the identifier from the request, freeze the prompt, stratify the samples, split the score by dimension, and write the boundary of the conclusion. Budget spent on evaluation should go first to reproducible records and acceptance scripts, not only to more conversation turns.

    A rigorous side-by-side evaluation is quality control of an uncertain component. With a clear spec, controlled variables, and traceable evidence, the conclusion can guide model choice and architecture instead of starting another round of impressions that cannot be reviewed.