How to Evaluate LLMs Scientifically: From One Question to a Repeatable Method

    Vendor leaderboards often fail to match real product experience. This article walks through a small, reproducible LLM bake-off (20 questions × 2 models × 2 repeats): control variables, task dimensions, automated vs. human grading, item-design pitfalls, a minimal scoring script, and how to interpret scores without overclaiming.

    Why run your own model bake-off

    When vendors ship a new model, marketing is full of benchmarks and leaderboard ranks. In production, the feel often diverges from those scores. For developers the real questions are rarely “which model is strongest overall,” but:

    • At the same price, which model is more reliable on everyday work?
    • On which tasks does a frontier flagship actually beat a lighter daily driver?
    • Is that gap worth a several-times price difference?

    Public leaderboards are useful context; they do not answer your workload. A low-cost, reproducible, scenario-specific evaluation is infrastructure worth building for any team that uses LLMs heavily. This piece uses a real bake-off of 20 questions × 2 models × 2 repeats to cover the method and the mistakes we hit.

    Four design basics

    1. Control variables

    Fairness first. Both models must share the same entry point, system prompt, temperature, and context limit. Any mismatch contaminates the result. Put prompts and parameters in a config file instead of copy-paste:

    1. {
    2. "system_prompt": "You are a rigorous technical assistant. Answer step by step and give a final answer.",
    3. "temperature": 0.0,
    4. "max_tokens": 2048,
    5. "repeats": 2
    6. }

    Temperature 0 reduces sampling noise, but models are still not fully deterministic, so running each item twice matters. Inconsistency between runs is itself a signal of instability on that task.

    2. Scale vs. cost

    20 × 2 × 2 = 80 calls looks small; for an individual developer it is a reasonable start:

    • Enough to see large gaps: a clear split on 20 items already supports a directional conclusion.
    • Not enough for tiny gaps: with fewer than ~50 items, a few points are mostly noise—do not over-read them.
    • Budget-friendly: flagship vs. light models can differ several times in price; a small run estimates the cost of a fuller eval.

    3. Dimensions that match how you work

    This run used six axes: math/reasoning, Chinese writing, hallucination/honesty, instruction following, code generation, and information extraction—the capabilities we hit most often. Adjust weights to your product: customer support should overweight instruction following and honesty; analytics should overweight code and extraction.

    4. Split scoring tracks

    • Objective items (math, logic, code): grade with scripts. Math compares the final number; code runs unit tests and scores pass/fail. Automation removes subjective bias.
    • Subjective items (writing): human read plus a helper model. The helper can compare structure, fluency, and information density item by item; a person must still own the final call.

    The biggest pitfall: items with no discrimination

    The deepest lesson was not about models but about the questions. To save time, another model generated the whole set. After the run we found the items were too easy: both models nearly aced them, so nothing separated. Worse, the generator then produced a polished-sounding conclusion—“accuracy is tied; the real gap is how carefully they work.” That sentence can be true in general, but here it sat on undifferentiating items. A tied accuracy only means the test was too easy, not that the models are equivalent.

    Item-writing principles:

    1. Difficulty tiers: easy / medium / hard per dimension; hard items should be at least about one third, or flagship models all hit 100%.
    2. Unique, checkable answers: objective items must be script-gradable; do not mix open-ended prompts into auto-score.
    3. Avoid memorization: famous puzzles may already be in training data and test recall, not reasoning. Prefer original items or transformed classics.
    4. Human spot-check is mandatory: auto-generated items need a human pass. Fully unattended generate–answer–conclude pipelines often produce polished junk data.

    A minimal auto-grader for objective items

    The core is “extract the final answer + compare by rule”:

    1. import re
    2. def extract_final_answer(text: str) -> str:
    3. """Extract the agreed final-answer marker from model output."""
    4. match = re.search(r"最终答案[::]\s*(.+)", text)
    5. return match.group(1).strip() if match else ""
    6. def grade(question: dict, model_output: str) -> bool:
    7. ans = extract_final_answer(model_output)
    8. if question["type"] == "math":
    9. return normalize_num(ans) == normalize_num(question["answer"])
    10. if question["type"] == "code":
    11. return run_unit_tests(question["code"], ans)
    12. return ans == question["answer"]

    Requiring a fixed 最终答案: xxx (or equivalent) in the prompt raises parse success. For code, prepare tests so “does it run correctly” is a deterministic judgment.

    Interpreting results: three bad habits

    1. Totals only: a weighted sum ranking is easy and misleading. Read by dimension—models may tie on math and diverge on instruction following, which may be what your product actually needs.
    2. Reading “everyone correct” as “no gap”: if items are easy, raise the hard share and re-run instead of declaring equivalence.
    3. Ignoring stability: items that disagree across two repeats are more alarming than a wrong answer; they map to uncontrolled production output.

    Closing

    A small in-house bake-off is not an authoritative ranking. It is a judgment frame: which dimensions matter, how much data you need before concluding, and which gaps justify several times the cost. If you turn item design, calling, and auto-grading into reusable scripts, a new model can get a scenario-fit check in about half an hour—more reliable than chasing leaderboards. Treat fully unattended pretty reports as entertainment, not evidence.