Back to the map

Module 16 · Evaluation · Lesson 2 of 6

Eval types: unit, LLM-as-judge, human, A/B

The four layers of evaluation and what each answers: deterministic checks on every call, a calibrated LLM judge on sets and samples, human labels as the reference, and A/B on real traffic; cost, scale, and how to combine them.

CoreMust-knowMid 12 minPro Updated Nov 2026

Why it matters

"How would you evaluate that?" has four honest answers, and most candidates give one. A string check cannot tell whether an answer is kind; a judge cannot tell whether users bought more; a human cannot read ten thousand answers; an A/B test cannot tell you why. Each layer answers a different question at a different price, and a working eval stack uses all four in the right proportions. Interviewers listen for whether you know which question you are asking before you pick the tool.

The idea

Layer one: deterministic checks

Code that reads the output and returns pass or fail. Exact match against a reference for classification and extraction. Schema validation for structured output. A regex for a required product code or a forbidden phrase. "Contains a citation" for a grounded answer. For a coding agent, the tests pass or they do not. These cost nothing, run on every call and never disagree with themselves. Their limit is reach: they check form, not meaning, and a wrong answer in a valid schema passes. Reduce every question you can to a check; a judge asked whether output is valid JSON wastes a model call.

Layer two: LLM-as-judge

A model reads the output against a rubric and scores it. Pointwise scoring grades one answer on a scale or a checklist. Pairwise scoring shows two answers and picks the better, which is more reliable for comparing versions and useless for tracking one number over time. The judge must be calibrated: a few hundred items with human labels, an agreement rate reported next to every score, re-run whenever the rubric or the judge model changes. The LLM-as-judge for retrieval lesson covers the rubric and the four biases in depth; the general point is that a judge is a second model under test, and its number means nothing until agreement is known. Cost is a model call per item, cheap for a set of hundreds and affordable for a sample of production.

Layer three: human review

Experts label items. This is the reference: judges are calibrated on human labels, and the expected behaviours in the set come from humans. It is slow, minutes per item, so it runs on hundreds rather than thousands, and it needs an annotation queue, a labelling guide and an agreement check, because two experts disagree more than teams expect. Spend human time where it compounds: labelling the set, reading the judge's disagreements, and reviewing a weekly sample of production.

Layer four: online experiments

Split real traffic between two versions and compare a product metric: resolution rate, retention, revenue, escalations to a human. This is the only layer that measures what users do rather than what a rubric says, and it is the final word on a change. It is also slow (weeks to significance), expensive (real users see the worse arm) and blind to causes: it tells you B lost, not why. Run it after the offline layers say B should win, as confirmation, never first.

volumecost per itemOnline A/Ba few experimentsweeks, real usersHuman reviewhundreds of itemsminutes per itemLLM-as-judgethousandscents per itemDeterministic checksevery callnear freecode on everything, judge on a sample, humans on the disagreements
Four layers, from cheap and everywhere at the bottom to slow and decisive at the top. Volume falls and cost per item rises as you climb.

Which layer for which question

"Is the output well formed?" is code. "Is the answer faithful to the context?" is a calibrated judge. "What does good look like for this new feature?" is humans. "Did the change help the business?" is A/B. The mistake runs both ways: a judge where code would do wastes money; code where a reader was needed passes wrong answers.

Combining them

The pattern: code on every call, in production and in CI. The judge on the whole eval set and on a one to five percent sample of production. Humans on the set when it is built, on the judge's disagreements, and on a small weekly sample. A/B on the few changes big enough to matter. Each layer feeds the next: human labels calibrate the judge, judge flags become cases, and A/B results check that the offline score still tracks the business.

 Unit checkLLM judgeHuman reviewA/B test
Cost per itemNear zeroA fraction of a cent to a few centsMinutes of expert timeReal users on the worse arm for weeks
ScaleEvery callThe full set; production sampledHundredsNeeds enough traffic for significance
ReliabilityExact for what it checksGood once calibrated; drifts with the modelThe reference, with its own disagreement rateStatistically sound, blind to causes
What it answersIs the form right?Does it read as good?What does good mean?Did users benefit?
Eval types: unit, LLM-as-judge, human, A/B · Backplane