Overview
Curated: · Written: · Reviewed:
LLM Evaluation
In one line
LLM evaluation is a release control: a versioned contract that says which product change may ship, measured on a frozen, sliced, uncertainty-bounded eval set, with rollback triggers defined before results come in. Reach for it whenever an open-ended output has to be judged before it reaches users, and whenever someone quotes a single aggregate score.
Key definitions
- Evaluation contract: the decision, population, rubric, metrics, slices, baselines, thresholds, owners and review date, written before the run.
- Slice: a subpopulation (language, cohort, intent, risk class) scored separately; the gate applies to each slice that carries risk.
- Reference-anchored vs reference-free judging: the first checks claims against a gold answer and is more reliable but covers only what the references cover.
- Chance-corrected agreement (Cohen's or Fleiss' kappa): agreement after removing what raters would match by chance.
- Shadow traffic and sticky canary: replaying live requests through the candidate, and exposing a small fixed cohort to it, to test offline results against production.
- Non-compensable gate: a safety or critical-slice failure that blocks release regardless of the average.
Formulas and complexity
Cohen's kappa for two raters, where $p_o$ is observed agreement and $p_e$ is chance agreement:
Worked example: $p_o = 0.90$, $p_e = 0.50$, so $\kappa = 0.40 / 0.50 = 0.80$. Hypothetical figures, labelled as such.
Paired win-rate interval (bootstrap, $n$ frozen cases): the point estimate is $\hat{p} = \text{wins}/n$; resample cases with replacement and take the 2.5th and 97.5th percentiles. With 116 wins of 200 the interval is roughly [0.51, 0.65], which cannot separate a 58% candidate from a 55% one.
How it works
The decision and contract come first. Deterministic checks run on every case with no judge. Judge-scored and human-scored layers follow, calibrated against blinded expert labels. Safety is a separate gate. Results are read per slice with uncertainty, and the release is then confirmed by canary and rollback rules.
When to use and when not to
| Method | Use when | Avoid when |
|---|---|---|
| Exact match or schema check | A machine-checkable contract exists (JSON, IDs, dates, tool args) | Wording varies and meaning is what counts |
| ROUGE / BLEU | Constrained translation or summarization comparison against a reference | Open-ended correctness; paraphrases score low |
| BERTScore | Semantic similarity is needed and encoder limits are understood | You need a verdict on factual correctness |
| LLM judge (reference-anchored) | Claims can be checked against gold answers | Behaviors the references do not cover |
| LLM judge (reference-free) | No gold answer exists | Without human calibration and order control |
| Human expert review | High-risk factual, legal, medical, security or policy outcomes | Bulk regression runs with no adjudication budget |
| Online canary | Offline evidence is strong but production value is unproven | As the only check before any release |
Traps interviewers probe
- Trusting one aggregate. A gain on general items can hide a safety regression. Fix: gate each risk slice separately and treat critical failures as non-compensable.
- Reading raw agreement as reliability. 85% agreement may be near chance when labels are skewed. Fix: report chance-corrected kappa on blinded labels and re-measure after any judge change.
- Counting ROUGE as correctness. A paraphrase that is right can score low and a wrong answer that reuses the reference can score high. Fix: use reference-anchored claim checks or human review for open-ended outputs.
- Splitting by prompt instead of by cluster. Paraphrases of one template leak across dev and test. Fix: group near-duplicates and multi-turn conversations before splitting, and treat 50 paraphrases as about one observation.
- Treating judge output as truth. Judges prefer longer answers and the first position. Fix: randomize or swap order, count only consistent pairs or report disagreement as noise, and calibrate against experts.
Interview tips
Open with the release decision: what ships, to whom, which harm is unacceptable, and what result rolls it back. Then name the layers in order.
Likely follow-ups:
- Is 85% judge agreement good? Ask for chance-corrected agreement on blinded labels.
- Win rate rose but complaints rose too. Look for a regressed slice hidden by the average.
- How do you stop leakage? Dedup, group, hash, rotate, and investigate suspicious gains.
- Offline says ship, PM says wait. Offline bounds risk but does not prove value; a canary resolves that.
- Judge and a human disagree on a medical answer. Expert adjudication applies regardless of automated agreement.
30-second outline: "I start from the decision and the rollback trigger. I gate safety and critical slices separately with deterministic checks first, then a judge calibrated to blinded expert labels with order randomized. I report per-slice win rates with a bootstrap interval, and I canary with a pinned baseline before full rollout."
Feedback on this overview
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.