GOAT EngineerPreparing your learning space…

AI Engineering · Concept Library · Free article

LLM Evaluation

An LLM eval is three things: a fixed set of real inputs, a scorer that grades each output, and one aggregate number you compare across changes. Build the scorers from the failures you actually see, gate the deploy on that number, and treat a small move as noise until your set is large enough to rule that out. The hard part is not choosing a metric, it is not being fooled by one that went up while the product quietly got worse.

An eval is three things: a set of inputs, a scorer that grades each output, and one aggregate number you can compare across changes. You build the scorers by looking at real failures, reading traces, sorting them into a handful of failure modes, and writing the cheapest check that catches each one (a code assertion where you can, an LLM judge where you can't, a human where you must). Then you treat that eval like a test suite: run it on every change and gate the deploy on the number. The hard part isn't the metric, it's trusting it. A small move is usually noise, a fifty-row set cannot see a small real improvement at all, a public benchmark measures a different distribution than your users, and any metric you optimize hard enough stops measuring what you meant. This page is how to build an eval that survives all of it.

Wrenlet ships an AI feature called Compose. It drafts the reply for you, to a teammate, to a customer, to a comment on a shared board, and you tweak and send. It works. You demoed it, the drafts read well, you shipped it. On Tuesday you decided the drafts were a touch long-winded, so you edited Compose's system prompt to be more concise. You re-read four drafts, they looked tighter, you deployed it before lunch.

Two weeks later, a pattern shows up in feedback: “the draft didn't actually answer what I asked.” Support escalations tick up. Someone asks the obvious question in standup. Did the Tuesday change cause this? The honest answer is that nobody knows. Maybe the concise prompt started dropping the part of the reply that addressed the real question. Maybe it's unrelated and the mix of incoming messages shifted. You changed one thing and shipped it on the strength of four hand-read drafts, and now you cannot separate your change from the noise. You have no way to run the tape back.

What is an LLM eval?

Strip away the tooling and every eval is the same three parts. A dataset: a fixed set of inputs, ideally the kind of messages your feature actually sees. A scorer: a function that takes one output and returns a grade, pass or fail, a number, a label. And an aggregate: you run the scorer over the whole dataset and roll the grades into a single number, a pass rate or an average score. That number is the eval. Everything else on this page is about making each of the three trustworthy.

One distinction first, because the phrase means two different things and only one of them is this page. A model eval asks which model is better in general, and it is answered by public benchmarks on somebody else's dataset. A product eval asks whether YOUR feature got better at YOUR job, and it is answered by your own dataset, your own scorer, your own number. This page is about the second. The first shows up once, in the section on why a leaderboard win does not transfer.

The reason this matters is the reason the Tuesday change went wrong. A single output can't tell you anything. A good draft on the one message you happened to check is one sample, and one sample has no error bars. The aggregate over a fixed dataset is what turns “it felt better” into a comparison: run the old prompt and the new prompt over the same inputs, and the two numbers say which one to keep. Fix the dataset, fix the scorer, and the only thing that moves the number is the change you made, which is exactly what the Tuesday deploy couldn't offer.

One caveat on “any LLM feature,” because an agent stretches the model. The three parts still hold, but the object you score gets bigger. A drafter produces one output, so a scorer reads one string. An agent produces a trajectory: a sequence of turns, tool calls, arguments and intermediate results that ends in a final answer. That gives you two different things to grade and you need both. Outcome scoring asks whether the end state is right: was the refund actually issued, does the ticket now carry the right status. Trajectory scoring asks how it got there: did it call the tools it needed, did it pass them valid arguments, did it loop, did it take eleven steps where three would do. An agent can reach the right answer down a path that will not survive the next input, and an outcome-only eval scores that as a clean pass. Code checks cover most of a trajectory for free (the tool name is in the allowed set, the arguments parse, the step count is under budget) and a judge reads the transcript for the rest. The dataset changes shape too: a case is a starting state plus the tools the agent may call, not just a prompt string.

Build the eval before you trust the change

The instinct is to build the feature, ship it, and add tests “later.” With LLM features that order is backwards, because you don't yet know what to test. The output space is open. A draft can fail by being rude, wrong, off-topic, too long, or by leaking an internal ID, and you can't write a check for a failure you haven't seen. So the work starts not with writing scorers but with looking at outputs. This is the habit that separates teams whose evals mean something from teams with a dashboard full of green numbers that don't move when quality does.

The loop is concrete. Pull a batch of real runs, a few dozen to start and more when you can. Read each one and jot what went wrong, in your own words, no categories yet. Then step back and sort those notes into a small number of recurring failure modes. For Compose you might land on “ignored the actual question,” “wrong tone for the audience,” “invented a fact,” “ran too long.” You'll know you have enough when a fresh batch stops surfacing new modes. Now, and only now, do you write scorers, one targeted check per failure mode.

Then you have to decide which mode to fix first, and the answer is not simply the tallest bar. Rank the modes by expected cost, which is how often each fires multiplied by how much damage it does when it does. Frequency alone is the right default only when the modes hurt about equally, and often they don't: four over-long drafts and four invented refund windows are not the same bill. One wastes a reader's thirty seconds, the other tells a customer something false about their money, and no aggregate that treats them as interchangeable is telling you where to spend. Read a batch of Compose failures below the way you would in practice: tag each one, watch the taxonomy assemble itself, and see what each mode is actually costing.

The interactive version of this example is available when JavaScript loads.

How should you score an LLM output?

Once you know what to check, you have three kinds of scorer, and they differ by an order of magnitude in cost and speed. The skill is matching the property you're checking to the cheapest scorer that can actually catch it, rather than defaulting to the fanciest one.

The three families, cheapest first

  • Code checks, plain deterministic assertions. Is the output valid JSON? Does it match the schema? Does the category Autotag returned exist in the allowed set? Is there no raw internal ID in the text? Did it come back under the latency and cost budget? These are near-free, instant, and run on every single case. Reach here first, and reach here often: a surprising amount of “quality” is objectively checkable this way.
  • Model grading (an LLM judge), for the properties no assertion can capture. Is the draft on-brand, does it actually address the question, is the tone right for a customer versus a teammate? A stronger model reads the output against a rubric and returns a grade. Powerful and flexible, but it costs a model call per check and it has to be kept honest (more below), so you use it where you must, not everywhere.
  • Human review, a person grading the output. Slowest and least scalable, and you can't run it on every deploy, but it's the ground truth and it's where the other two get their marching orders. Humans read the traces that build the taxonomy, and humans grade the sample that tells you whether your LLM judge can be trusted at all.

Notice they aren't rivals, they stack. Human review defines what “good” means and validates the judge; the judge scales that definition to thousands of cases; code checks catch the objective failures for free so the judge only spends its budget on the subjective ones. Walk one Compose output through the ladder below and watch which scorer each property needs.

The interactive version of this example is available when JavaScript loads.

Where do the test cases come from?

From production, mostly. The best eval set is a sample of real traffic, weighted toward the places your feature already fails, topped up with the specific cases that broke in the past so they can never break again quietly. A scorer is only as honest as the inputs you run it on. An eval set of ten cases you thought up at your desk will miss the messy, misspelled, half-sentence messages your users actually send, and pass a change that breaks on exactly those. Three sources, used together, give you a set that reflects reality.

Assembling a set that reflects your traffic

  • Mine production. Your logs are the richest source you have: real messages, real phrasing, real edge cases. Sample across the segments that matter (a terse teammate note reads nothing like an angry customer), and deliberately pull the runs that got a thumbs-down or an escalation, because a failure you've already seen is the most valuable test case there is.
  • Generate synthetically, then vet. To cover cases production hasn't thrown at you yet, a new language or a rare request type, prompt a model to generate inputs across explicit dimensions (audience × intent × length). Treat these as provisional: they lack the messiness of real traffic and inherit the generator's blind spots, so a human promotes a synthetic case to the real set, never the generator itself.
  • Stratify by difficulty. A set that's all easy cases saturates: every model version scores 0.98 and the eval can't tell them apart. Keep a spread from easy to genuinely hard so the number still has room to move when you improve, and so a regression on the hard cases can't hide behind a wall of easy passes.

Gate the deploy on the number

Here is where the Tuesday change should have died, or shipped with confidence. Once you have a dataset and scorers, you wire them into the same pipeline that runs your unit tests: on every change to the prompt, the model, or the code around it, run the eval set and compare the new number against the baseline. If it dropped, the build fails and the change doesn't merge. The “did my change regress?” question stops being a two-week mystery and becomes a red check on a pull request.

But there's a trap sitting right here, and it's the one almost every guide skips. Your eval number moved from 0.81 to 0.83. Ship it? Not yet, because LLM outputs are nondeterministic, so some of that wiggle is the model and not your change. Run the exact same eval twice with no change at all and the number moves anyway. Before you can call 0.83 an improvement, you have to know how much the number moves on its own, its noise band, and require your change to beat it.

Drag the two dials below. The candidate really is a hair better than the baseline, but the eval set is small and each case is scored only once, so the difference sits inside the noise. Watch what each dial can and cannot do. More cases shrink the whole band. Re-scoring the same cases shrinks only the part of the wobble that comes from the model re-rolling one question, and leaves a floor set by how few questions you asked in the first place.

The interactive version of this example is available when JavaScript loads.

Two numbers fall straight out of that, and both tend to surprise people. The first is how big the set has to be. To resolve a +0.03 improvement at a 0.8 baseline under the two-standard-error rule above, you need about 710 cases, not fifty. For conventional 80% power on an unpaired comparison at the same effect size it's roughly 2,600 cases per side. Pairing pulls those figures down, and so does choosing a harder set where the baseline isn't already near the ceiling. But the order of magnitude is the point: a fifty-row eval set cannot see a small real improvement, and it will cheerfully show you one that isn't there.

Two more things the gate has to account for

  • Multiple comparisons. The advice a section down is to watch several metrics at once so gaming one shows up as a drop in another, and that advice is right. It also means several chances to trip the gate by accident. Ten roughly independent metrics each tested at 5% give about a 40% chance that at least one screams on a change that did nothing at all. This is the peeking problem rotated ninety degrees: repeated looks inflate the error rate along the time axis, and extra metrics inflate it along the metric axis. Pick a small number of gating metrics and let the rest be dashboards, or hold the whole set to a stricter per-metric threshold (Bonferroni, which is 0.05 divided by the number of metrics, is crude and works).
  • Per-segment reporting. One aggregate hides a regression that lives in a single cohort. A change that lifts English drafts by 0.04 and drops Spanish ones by 0.10 still moves the overall number up if the set is mostly English, and the gate goes green. Report the number by the segments you already know matter (language, customer versus teammate, short versus long input, your largest few accounts) and gate on the worst segment as well as the mean. This is the most common way a real CI eval passes while production gets worse.

The metric went up. Did the product get better?

Suppose the move clears the noise band and the number genuinely went up, no argument. There's still a deeper way to be fooled, and it's the one that separates people who are good at this from people with a green dashboard. The number is a proxy. It stands in for the thing you actually care about, which is whether these drafts are any good, but it is not that thing, and the gap between the two is where trouble lives.

Say you can't afford a judge on every run, so you approximate “a good support reply” with a cheap keyword check: a good reply apologizes and offers a next step, so score the fraction of drafts that contain an apology and a concrete action. Reasonable at first. But now you optimize against it, tuning the prompt to lift that score, and the model learns the letter of the rule instead of the spirit. Every draft opens with a hollow “so sorry for the trouble” and bolts on a generic “let us know if you need anything.” The keyword score sails to 1.0. The drafts get worse. Push the dial below and watch the proxy and the truth pull apart.

The interactive version of this example is available when JavaScript loads.

The leaderboard says it's the best model. Your users disagree.

When a new model drops, it arrives with a scorecard: near the top on the public benchmarks. It's tempting to read that as “this model will make Compose better” and swap it in. Those benchmarks are real and useful for what they measure, but they answer a different question than the one you're asking. This is the model eval against product eval split, made expensive: a leaderboard ranks models on a general dataset, and you need to know whether this model is better at the one job your product does. Mistaking one for the other is how you ship a downgrade that looked like an upgrade.

A slice of the public-benchmark landscape, and what each actually measures
BenchmarkWhat it measuresWhat it does NOT tell you
MMLU / MMLU-ProMultiple-choice knowledge and reasoning. MMLU covers 57 subjects; MMLU-Pro is a harder successor spanning 14 domains and over 12,000 questions, with ten answer options instead of four.Whether the model writes a good support reply in your product’s voice.
GPQAGraduate-level science questions written to be hard to look up.Anything about your task, your tone, or your users’ phrasing.
HELMA living benchmark scoring many models on many axes at once, reporting seven metrics (accuracy, calibration, robustness, fairness, bias, toxicity and efficiency) to expose trade-offs.Which trade-off matters for your feature, or how it does on your data.
HumanEval / SWE-benchCode: does the generated function pass unit tests it was not shown (they ship with the dataset, they just aren’t in the prompt), and does the patch fix a real GitHub issue.Non-coding tasks, and even for code, performance on your codebase.
Chatbot Arena (LMArena)Human preference from millions of anonymous head-to-head votes, ranked by a Bradley-Terry / Elo-style model.Preference on generic chat ≠ quality on your specific, narrow task.

Four failure modes turn a leaderboard win into a product loss. Contamination: benchmark questions leak into training data, so a high score can be partial memorization rather than skill. Contamination has been demonstrated on public benchmarks, and detecting it is itself a research problem: Golchin & Surdeanu, 2023 report 92% to 100% accuracy at detecting it across seven datasets including IMDB, AG News, XSum and RTE. What no such paper gives you is a leakage figure for the specific benchmarks in the table above, which is exactly the difficulty. You cannot price the contamination on a score you are reading. Saturation: once every strong model scores in the high 0.9s, the benchmark can no longer tell them apart, which is why the field keeps building harder successors. Construct validity: a benchmark's design may not represent the ability it claims, a critique made forcefully by Raji et al., 2021 and Bowman & Dahl, 2021. And the big one, distribution mismatch: the benchmark's inputs are not your users' inputs. A model that tops a reasoning leaderboard can still write a worse Compose draft than the model below it, because drafting a warm, correct customer reply is not the task the leaderboard scored.

So use benchmarks for what they're good at, a first-pass filter to shortlist models worth trying, and never as the deploy gate. The decision of whether to swap models is made by running your eval set, on your task, with your scorers. Toggle the two rankings below: the same four models, sorted by a public leaderboard and by a Compose eval, and watch the order refuse to agree.

The interactive version of this example is available when JavaScript loads.

What that toggle measures is worth stating plainly, because the shape is not the one people expect. The two rankings disagree at the ends and agree in the middle. The leaderboard's top model, Nimbus-Pro at 0.91, comes last on Compose at 0.66. The model the board buried in fourth, Dune-mini at 0.79, writes the best Compose drafts at 0.88. Ranks two and three don't move at all. That is worse than a clean inversion, because an inversion would at least be a rule you could apply. This is the leaderboard answering a different question, so the only way to learn which of your candidates is best at your task is to run your own set. On that set, 200 cases, two standard errors on a single score runs from about ±0.05 to ±0.07, and the band on the difference between two of them is about ±0.07 even before you credit the pairing. Dune-mini's nine-point win over Aster-2 clears it. A two-point one would not have.

Offline gates the deploy, online finds what the set missed

Everything so far is offline evaluation: a fixed set, scored before you ship, fast enough to gate a deploy. Its blind spot is built in, because it can only grade the cases it contains. The eval set can be green while real users are unhappy, because the messages making them unhappy aren't in the set yet. That gap is closed by online evaluation, measuring on live traffic after the change is out.

Online eval has its own instruments. A/B tests split live traffic between the old and new versions and compare a metric that actually matters, like resolution rate, edits-before-send or escalations, rather than an offline score. Guardrail metrics run on every live response as a safety net: format validity, refusal rate, latency, cost, a check for leaked internal data, and a breach pages someone. Implicit signals read behaviour instead of asking for it, so a thumbs-down, a regenerate, a heavily-edited draft or an abandoned reply is each a quiet vote on quality. And a judge sampling live traffic scores a small percentage of real responses off the request path, so quality has a running number even where there's no gold answer. The RAG-eval page walks the full loop of harvesting these failures back into your set; the general point holds for any feature. Gate offline, watch online, feed what breaks back in.

The interactive version of this example is available when JavaScript loads.

The demo makes the point by construction: the two versions in it are identical, so every winner it crowns is false. Peek daily and the p-value dips under 0.05 on day 8, the rule fires, you stop and ship. Read once on day 14, as agreed in advance, and the answer is p = 0.42 and correctly no winner. Nothing about the data changed between those two conclusions. Only the stopping rule did. That's the lesson worth carrying: the stopping rule is part of the test, and if you didn't write it down before you started, you don't know what your 5% means.

What does running evals cost?

Evaluation is not free, and the bill is easy to under-count because it's multiplicative: a judge call per row, times rows in the set, times metrics, times every change you test, times the samples-per-case you added to shrink the noise band. A few hundred cases and several judged metrics, re-run on every pull request, can quietly cost more than serving the feature itself. The moves that keep it sane: run cheap code checks on everything and reserve the judge for the properties that truly need it; cache judge results keyed on the input, output, and rubric version so an unchanged row is never re-graded; sample the set on every commit and run the full set only at release gates; and use a smaller, cheaper judge for the easy checks, saving the expensive model for the hard calls. Spend the eval budget where a wrong grade would actually cost you.

Which LLM eval framework should you use?

None of this needs a framework. A list of rows, a scoring function and an assertion in your test suite is a real eval, and starting there teaches you more about your failures than starting with a tool does. What the tools buy you is the part that gets tedious at scale: running a matrix of prompts and models, storing runs so you can diff two of them, tracing what happened inside a failing case, and hosting the dataset somewhere a teammate who doesn't write code can add to it. A representative slice as of September 2026, and what each is actually for. This is the fastest-moving section on the page, so treat it as a snapshot rather than a standing recommendation, and check the current docs before you commit to one:

Where the common tools sit

  • promptfoo. An open-source CLI and library. You declare prompts, providers and assertions in a config file and it runs the matrix, which makes it the shortest path from “I have a prompt” to “I have a number in CI.” It runs on your machine and talks to the model directly, so the eval data doesn't have to leave your infrastructure. It also ships a red-teaming mode for adversarial and security probes.
  • DeepEval. An open-source Python library (with a TypeScript port) whose evals are written as pytest tests, so a regression fails the build like any other assertion. It ships a catalogue of ready-made metrics, including RAG metrics, safety metrics, and agent metrics over tool correctness and task completion.
  • Inspect. An open-source framework from the UK AI Security Institute. It gives an eval a fixed shape: a dataset of samples, a solver that produces the answer (a single model call, or a full tool-using agent), and a scorer. It ships a log viewer and a large library of published evaluations, and that solver seam is what makes it the most natural fit of the four when the thing under test is an agent rather than a single call.
  • LangSmith, Braintrust. Hosted platforms rather than libraries: tracing, dataset management, scoring and production monitoring in one place, with a UI your non-engineer teammates can label cases in. LangSmith works with providers and frameworks beyond LangChain. The trade is that your traces and your eval data live in someone else's system.
  • OpenAI Evals. An open-source framework plus a registry of published evals, with a hosted version in the OpenAI dashboard. Worth reading even if you never run it, because the registry shows you how other people wrote their graders.

Wiring the eval into your pipeline

Stripped to essentials, an eval harness is five moves: hold the set as data, score with the cheapest scorer that fits, aggregate, gate, and sample production back in.

The whole flow, step by step

  • Hold the eval set as versioned data. A list of { input, expected? } rows, checked into the repo and reviewed like any fixture, with expected present only for the reference-based cases.
  • Score each row with the cheapest scorer that fits. assert_valid_schema(output) and assert_no_internal_id(output) are exact and free; judge_addresses_question(output, input) spends a model call only where an assertion can't reach.
  • Aggregate into one number. Roll the per-row grades into a pass_rate (or a mean score), the single value you compare across runs, and roll it per segment as well as overall.
  • Gate in CI. assert pass_rate >= baseline - noise_band fails the build when a change regresses beyond what you've measured to be noise, in the same place your unit tests run.
  • Sample production back in. A cron job pulls thumbs-down and judge-flagged live responses into new rows, so the set tracks reality instead of the day you froze it.

Three operational questions decide whether that gate survives contact with a team, and they're worth settling before the first red build rather than during it.

The mechanics somebody has to own

  • Who owns the baseline, and where it lives. The baseline is a number in a file in the repo, reviewed like any other change, not a value some job quietly overwrites at the end of a run. Store it next to the version of the eval set it was measured on, because a baseline measured on a different set isn't a baseline.
  • When it moves. It moves in a pull request, by a person, with the run that produced it linked. An improvement raises it deliberately. A change that lowers it is either a rejected change or an accepted trade written down in the same diff. Never let the gate ratchet itself downward on a red run, which is how a suite ends up passing at a number nobody would have agreed to.
  • What happens on a failure. A failed gate blocks the merge and prints which rows flipped, not just the aggregate, because that's the first thing anyone asks. Give it an override that is a labelled, reviewed decision rather than a rerun-until-green, and keep the override count visible: a gate overridden every week has already been switched off, it just still renders.

The traps that cost the most

The ones that actually bite

  • Shipping on a handful of hand-read outputs. Four good drafts is four samples with no error bars, exactly the Tuesday mistake. Score a set, compare aggregates.
  • Writing scorers from your imagination. An eval invented at your desk grades the failures you guessed, not the ones your users hit. Read real traces first, then encode what you found.
  • Reading a metric move as a result. A 0.02 bump on 50 cases is usually noise. Know your noise band and make the change beat it before you call it a win.
  • Sizing the set by what felt reasonable. Fifty rows cannot resolve a real +0.03; that takes hundreds. A set too small to see your improvement will still hand you a false one.
  • Gating on the aggregate alone. A regression confined to one cohort hides inside a mean, and a green build over a broken segment is the commonest way this goes wrong in production.
  • Optimizing a proxy into meaninglessness. Any metric tuned hard enough gets gamed. Prefer hard-to-game scorers, hold out a slice, watch several metrics, and re-read outputs.
  • Trusting a public leaderboard as your gate. It measures a different distribution than your users, and it may be contaminated or saturated. Shortlist with it, decide with your own eval.
  • Peeking at a running A/B test and stopping on green. Repeated looks manufacture false winners. Fix the horizon, or use an anytime-valid method built for stopping whenever you like.
  • Freezing the eval set forever. It only grades what it contains, so as the product and users move, a green number goes blind. Feed production failures back in.

Habits that keep an eval honest

What senior teams wire in from the start

  • Derive scorers from read failures, not from a blank page, so every production incident becomes a new row and a new check.
  • Rank the failure modes by frequency times severity, and spend there, rather than always on the tallest bar.
  • Reach for the cheapest scorer that catches the property: code checks first, a judge only where it must, humans to define and validate.
  • Gate the deploy on the number, in the same pipeline as your unit tests, and require the move to clear the noise band.
  • Report per segment and gate on the worst one, so a regression in one cohort can't hide inside the mean.
  • Watch several metrics at once and hold out a tuning slice so no single proxy can be gamed into a false win, while keeping the list of gating metrics short so the extra ones don't manufacture false alarms of their own.
  • Use public benchmarks to shortlist, your own eval to decide. The leaderboard isn't your task.
  • Run both loops: offline to gate before shipping, online (A/B, guardrails, implicit signals, a sampling judge) to catch what the set can't see, and feed the misses back in.
  • Budget the eval bill. Cache judge results, sample on commits, run the full set at release gates.

Interview cheat-sheet, intern to principal

How would you evaluate an LLM feature?
Three parts: a dataset of representative inputs, a scorer that grades each output, and an aggregate number you compare across changes. Build the scorers by reading real failures, sorting them into a few failure modes, and writing the cheapest check for each, so a code assertion where the property is objective, an LLM judge where it's subjective, a human to define and validate. Rank the modes by frequency times severity rather than frequency alone. Then run that eval on every change and gate the deploy on the number, requiring the move to clear the metric's noise band. The single most important habit is deriving the eval from failures you've actually read, not inventing it at your desk.
Your eval score went from 0.81 to 0.83. Do you ship?
Not on that alone. LLM outputs are nondeterministic, so part of that move is noise rather than the change. First estimate the noise band: for a pass rate over N cases the standard error is roughly the square root of p(1−p)/N, so on 50 cases at 0.8 that's about 0.057 and a 0.02 move is well inside it. Then be precise about what you're testing, which is a difference of two numbers over the same inputs, so the comparison is paired and the right test is McNemar's on the discordant pairs, which is materially more powerful than treating the two runs as independent. And say the uncomfortable part out loud: resolving a real +0.03 under a two-standard-error rule needs about 710 cases, so a fifty-row set was never going to answer this. Shrink the band with more cases and by scoring each case several times, run at temperature 0 where you can (which reduces the wobble but doesn't remove it, since batching makes even temperature-0 endpoints non-reproducible), and only call it an improvement once the move clears the band.
When do you use an LLM judge versus a code-based check?
Reach for the cheapest scorer that can catch the property. If it's objectively checkable, like valid JSON, a category in the allowed set, no leaked ID, under a latency budget, use a deterministic code assertion: free, instant, run on everything. Use an LLM judge only for the subjective properties an assertion can't reach, such as whether the draft is on-brand, addresses the question, or gets the tone right, because a judge costs a model call and has to be validated against humans before you trust it.
A new model tops the public leaderboards. Do you swap it into your product?
Not on the leaderboard alone. Public benchmarks measure a different distribution than your users and can be contaminated (questions leaked into training) or saturated (every strong model scores the same), so a leaderboard win can be a product loss. Use benchmarks to shortlist models worth trying, then decide by running your own eval set on your own task with your own scorers, which is the only test that reflects whether this model makes your feature better.
Your metric hit 1.0 but users are complaining more. What happened?
You optimized a proxy until it came apart from the thing it stood for, which is Goodhart's law (the memorable phrasing, that a measure which becomes a target ceases to be a good measure, is Marilyn Strathern's). The metric measured something correlated with quality, say keyword presence, you tuned against it, and the model learned the letter over the spirit. The formal name for the question is construct validity: does the metric measure the quality you meant, or something that only travels with it until you push? Defend with hard-to-game scorers (a rubric judge over a keyword count), a held-out tuning slice, several metrics watched together, and periodic re-reading of real outputs.
What's the difference between offline and online evaluation, and why do you need both?
Offline eval runs a fixed set before you ship. It's fast, repeatable and gates the deploy, but it can only grade the cases it contains. Online eval measures live traffic after you ship, through A/B tests on a business metric, guardrail checks on every response, implicit signals like thumbs-down and regenerates, and a judge sampling real responses. It sees the true distribution but can't gate a change before it's live. You gate offline, watch online, and harvest what breaks in production back into the offline set so it stops going stale.
Why is repeatedly checking a running A/B test and stopping on significance a bug?
Significance testing assumes a sample size fixed in advance and a single look. If you peek every day and stop the moment p drops below 0.05, the real false-positive rate climbs with the number of looks: simulating a two-proportion test between two identical versions gives about 5% at one look, 19% at ten and 38% at a hundred, so you'll crown a winner from noise. Two fixes. Fix the sample size up front and look once, or use anytime-valid inference (mSPRT, e-values and e-processes, confidence sequences), which is the family that genuinely permits stopping whenever you like. Be careful with the words here: group sequential and alpha-spending designs such as Pocock or O'Brien-Fleming are also called sequential, but they need a maximum sample size and a spending schedule fixed in advance, and looking off-plan breaks their guarantee. Every one of these buys the freedom to look by giving up power, so you wait longer for the same real effect.
How do you build a good eval dataset?
Mine production for real inputs across the segments that matter, deliberately including the runs that got a thumbs-down or an escalation. Fill gaps with synthetic cases generated across explicit dimensions, but have a human vet each before it joins the real set. Stratify by difficulty so the set doesn't saturate and a hard-case regression can't hide behind easy passes. Size it for the effect you need to detect rather than for what feels reasonable. Then version it like code and keep feeding it from production, and keep it independent of the model that serves the feature so it isn't contaminated by that model's blind spots.
How do you keep the cost of evaluation under control?
The bill is multiplicative, judge calls × rows × metrics × changes × samples-per-case, so it's easy to spend more on eval than on serving. Run free code checks on everything and reserve the judge for properties that need it; cache judge results keyed on input, output, and rubric version so unchanged rows aren't re-graded; sample the set on commits and run the full set only at release gates; and use a cheaper judge model for the easy calls. Spend the budget where a wrong grade would actually cost you.

By GOAT Engineer. Back to Concept Library. Privacy Policy · Contact.