LLMModule 19 · Evaluation

Evals: how to know whether an AI system actually works

The whole eval loop, from one test case to a release gate: gold answers, reading outputs, code graders, AI judges you have checked, error bars, agents, benchmarks.

Source: Sergii Makarevych, “Evals: how to know whether an AI system actually works”, X article, 3 Oct 2026 (34 min read) · X article

Start here (no maths needed)

An eval is a test you can repeat. It tells you, with a number, whether an AI does its job, and whether your latest change made it better or worse.

Think of it like this

Your teacher marks a maths test with an answer key. Without the key she'd have to feel whether each answer looks right, and a neat, confident wrong answer would fool her. An AI is a very neat, very confident student. It never crashes. It just writes a smooth answer that is sometimes wrong. An eval is the answer key, the marking, and the final score.

How it works

  1. Questions with answers. Collect real examples and write the right answer next to each one.
  2. Run the AI on every example and keep what it says.
  3. Mark it. Use a simple rule ("did it mention the 5-day refund?"), another AI as the marker, or a person.
  4. Score it, with a "give or take". "70% right, give or take 12" is honest. "70%" alone is not.

The twist

The marker can be wrong too. If another AI does the marking, you have to test the marker first. A marker that says "well done!" to everything will make a broken robot look great.

Why robots care

A robot that says "Done! The blue block is in the bin" when you asked for the purple one is exactly this problem. You check what's actually in the bin, not what the robot says. You build this yourself in Robo-Helper week 11.

Try it

Ask a friend 10 quick quiz questions. Before you start, write the answers down. Then mark them twice: once just by how sure they sounded, and once with your answer key. How often do the two marks disagree?

Words to know

Eval
A repeatable test of your AI on your examples.
Gold answer
The right answer, written down before the AI runs.
Grader / judge
Whatever does the marking: a rule, another AI, or a person.
Error bar
The "give or take" on a score.

Going deeper: the full loop, how to check a judge (kappa), the five judge biases, error bars and paired comparisons, grading agents (pass^k), benchmarks, and how to run evals every week.

In this module
  1. Summary
  2. Why this matters for robotics
  3. Deep dive: the loop, and what to measure
  4. Deep dive: read the outputs first
  5. Deep dive: graders made of code
  6. Deep dive: an AI as the grader, and how to check it
  7. Deep dive: honest numbers
  8. Deep dive: systems with parts (RAG, agents, reward hacking)
  9. Deep dive: public benchmarks
  10. Deep dive: making it a habit
  11. Try it on Robo-Helper
  12. Playbook
  13. Self-check
  14. Glossary & further reading

1. Summary

TL;DR

An eval is input, system, grader, number. LLMs fail by being fluent and wrong, so one good demo tells you nothing. Build gold answers first, read a hundred or so outputs to find the real failure types, use code rules for anything definite, and use an AI judge only after you have measured it against human labels (report kappa or catch rate, not raw agreement). Put an error bar on every number, compare versions on the same cases, and know the smallest difference your test set can detect. Always report two numbers: how good the product is, and how good the grader is.

2. Why this matters for robotics

Track: LLM. The source is about evaluating LLM products. Robot evaluation has exactly the same shape: a set of tasks, a check of the final state of the world, several runs because physics and policies are noisy, and judges (human or AI) for the parts that have no exact check.

3. Deep dive: the loop, and what to measure

The article runs one ticket through the whole loop first. A customer angrily asks about a missing refund. Triage labels it "returns", which matches the gold label. The answer step writes a polite reply that cites the returns section and states both required facts (5 business days, a 15% restocking fee for used items). Then three graders look at it:

GraderQuestionVerdict
Code ruleDoes it cite a handbook section?pass
Code ruleDoes it contain both required facts?pass
AI judgeDoes it claim anything the handbook doesn't say?fail: it invented "up to 15 business days"

The lesson: different graders answer different questions, and a fluent reply can pass every surface check while still being wrong.

Inputs, gold answers and two piles

WordMeasuresExample
Evalyour system on your datathe assistant on 60 tickets
Benchmarka model on a public taskGSM8K, SWE-bench
Software testa function returns what it shouldthe JSON parses
Monitoringlive traffic after launchsampled real tickets graded daily

The article's analogy: a benchmark measures the engine, your eval measures the car on your road.

4. Deep dive: read the outputs first

Before writing any automatic grader, read the outputs one by one. Write a short note on each failure (open coding), then group the notes into failure types with counts (axial coding). This is error analysis. On the 60 test replies:

Failure typeCount
(replies that pass)34 of 60
missing_required_fact15
unsupported_claim12
wrong_section_retrieved8
did_not_answer5
wrong_value2
over_promise1

A reply can have more than one failure, so the counts add up to more than 26.

This list is the plan: one grader per failure type, most frequent first. The article says teams whose eval work stalls have almost always skipped this step. Expect criteria drift (Shankar et al., 2024): grading examples sharpens your rubric, which changes earlier grades. Two or three rounds is normal.

5. Deep dive: graders made of code

A code grader is free, instant and gives the same answer every time. Use it for everything with a definite answer.

The limit, in one number: only 11.7% of replies passed every code check, yet the code checks caught none of the invented claims. Rules see form, not meaning.

6. Deep dive: an AI as the grader, and how to check it

An AI judge (LLM-as-judge) reads for meaning, so it can catch the invented 15-day allowance. It is also a language model, with all the failure modes of one. The article calls this the place where most eval programmes go wrong.

How to ask

The article cites Cho et al. (2026, "Ask, Don't Judge"): yes/no questions about specific errors beat holistic G-Eval scoring on every dataset (Spearman 0.563 vs 0.514 on SummEval). A summary with three planted factual errors got a perfect 5.0 from holistic judges and 1.57 from the question-based one. Adding more and more instructions eventually made the judge worse.

Checking the judge

All 60 replies were labelled by hand, then the judge ran. The reference passed 34; the judge passed 42. They agreed on 36 (60%). That sounds fine until you notice that a judge saying "pass" to everything would agree 57% of the time. Cohen's kappa corrects for that: it measures agreement beyond what chance would give. 0 is chance, 1 is perfect. The usual bar is about 0.6 for a judge that gates a release and 0.8 for one that runs unsupervised. This judge scored 0.15: lenient, and it caught only 10 of the 26 bad replies.

Interactive: is your judge any good?

60 replies checked by hand. Set how many are really good, and how the judge does on each kind. It starts at the article's numbers.

Agreement
–
"Always pass" agrees
–
Kappa
–
Catch rate
–

Try 54 good replies, 2 caught and 0 wrongly failed: agreement is 93%, and the judge still misses two thirds of the failures.

The fix is iteration on the dev set: add examples of the failure to the judge prompt, narrow the question, and give it the gold facts. In the article's tutorial the "missing fact" judge reached a usable level this way. The "unsupported claim" judge did not, and that question went to a specialised detector instead.

The five known biases

BiasWhat happensCheap fix
PositionIn A-vs-B comparisons the judge prefers whichever comes first (Wang et al., 2024).Judge both orders; count a win only if both agree.
LengthLonger answers win. Correcting for length raised agreement with human rankings from 0.94 to 0.98 (Dubois et al., 2024).Length-controlled scoring, or yes/no questions.
Self-preferenceJudges rate their own model family's answers higher (Panickssery et al., 2024).Use a judge from a different family than the system under test.
Satisfaction vs successThe judge rates how the chat felt, not whether the task got done.Give the judge the tool calls and the final state.
Judge identitySwapping the judge model changes which system wins.Record the judge model and version with every result.

The article gives the GAUGE audit (Bodhwani et al., 2026) its own paragraph because it tests the setup many companies use to decide releases: a simulated user chats with the agent, a judge scores the transcript, and the higher score ships. Across 25 agents and about 3,700 transcripts, this worked when one agent was clearly better (correlation 0.94 with ground truth). On near-equal pairs, which are the decisions that matter, it promoted the worse agent 31% of the time. A judge that only saw the chat and rated satisfaction was a coin flip (AUC 0.49). A judge that also saw the tool calls and whether the task was resolved reached AUC 0.73. Reliability came from the evidence the judge was given, not from how strong the judge was.

Panels, detectors and typed judges

7. Deep dive: honest numbers

Would the score be the same on a different 60 tickets? Three tools answer that.

Interactive: how wide is the error bar?

The 95% error bar for a pass rate, using the normal approximation 1.96 × √(p(1−p)/n). A bootstrap gives almost the same answer once n is more than about 30.

Give or take
–
95% range
–
Cases to halve it
–

Starts at the article's case: 60 cases at 70% gives about ±12 points. To halve the error bar you need four times as many cases. Robo-Helper's bake-off has only 12 tasks.

8. Deep dive: systems with parts (RAG, agents, reward hacking)

Retrieval systems: grade each stage

A bad reply can come from the finder or from the writer, and they need different fixes. Grade the finder against the gold sections: hit@2 = 0.93, recall@2 = 0.88. Of 18 failing replies, 1 failed in the finder and 17 in the writer. That one line redirects a week of engineering. For the writer, the RAGAS triad (faithfulness, answer relevance, context precision) needs no gold answers; in this run RAGAS gave context relevance 0.855 and faithfulness 0.737, the same "retrieval good, writing worse" story as the hand-built graders. When two different methods tell the same story, the number is easier to believe. ARES adds confidence intervals by calibrating small judges against about 150 human labels.

Agents: final state, path, and many runs

Interactive: pass@k vs pass^k

If each try succeeds with probability p, independently: pass@k = 1 − (1 − p)k, pass^k = pk.

pass@k (at least once)
–
pass^k (every time)
–

At 90% per try, "worked at least once in 3" is 99.9%, and "worked all 3 times" is 73%. The second number is what a customer, or a robot owner, actually feels.

Graders get gamed

Any grader used to train or select a system will be gamed. Wang et al. (Qwen, 2026) catalogue coding agents reading answers from repository history, editing the tests, and patching for the evaluator. A behaviour monitor cut hacked "solutions" from 28.6% to 0.6% while genuine ones rose from 40% to 61%. Their argument: no grader is scalable, faithful and robust at once. Tests scale and resist gaming but miss intent; judges scale and capture intent but can be gamed; experts are faithful and robust but don't scale. Keep a held-out grader the system never sees, and upgrade it as the system improves. Same idea as the KL leash in Module 07.

9. Deep dive: public benchmarks

Use benchmarks to shortlist two or three models. Decide with your own eval on your own data.

10. Deep dive: making it a habit

LevelWhatWhenCost
1Code graders, schema checks, required factsevery commitfree
2Judges and detectors on the test set; human review of a sampleevery prompt, model or retrieval changecents to dollars
3A/B test on real trafficafter shippingreal users

The article also compares tools. In short: Inspect AI (complete, code-first), lm-evaluation-harness (public benchmarks), promptfoo (YAML suites and red-teaming), DeepEval (pytest-style), RAGAS (RAG triad), Langfuse / Phoenix / LangSmith / Braintrust (tracing plus evals), and small detectors for "is this supported". Its advice is to read a hand-built grader's number against a framework's: agreement is evidence, disagreement is a good question.

11. Try it on Robo-Helper

Module 18's week-11 bake-off now uses three of these ideas, with real numbers from the project (python3 lesson19_judge.py):

Homework: kappa, catch_rate and bootstrap_ci in lesson19_judge.py, checked by python3 check.py 19a. See week 11, stretch 2.

12. Playbook

  1. Collect 20–50 real inputs, awkward ones included, and write gold answers before running anything. Split into dev and test.
  2. Run the system and read the outputs. Note each failure, group the notes, count them. That list is your grader plan.
  3. Write code graders for everything definite: labels, formats, length, required facts, forbidden phrases.
  4. For meaning, write one yes/no judge question per failure type. Give the judge the context and the evidence (tool calls, final state), and ask it to quote the problem.
  5. Label a few dozen dev cases by hand. Measure the judge: kappa or catch rate plus false-fail rate. Iterate until it clears about 0.6, or hand that question to a detector.
  6. Report every score with an error bar. Compare versions paired, on the same cases, and list the cases that got worse.
  7. Work out your detection floor before comparing versions. Add cases if it's too coarse.
  8. For agents: check the final state and the path, run each task several times, report pass^k, cost per success and consistency.
  9. Keep one grader the system never trains or selects against.
  10. Automate: code checks every commit, judges every change, monitoring after launch. Cache model calls. Re-audit judges when anything changes.

13. Self-check

Your judge agrees with humans 90% of the time. Is it good?

You can't tell yet. If 90% of outputs are good, "always pass" also agrees 90%. Compute kappa, or report how many bad outputs it catches and how many good ones it wrongly fails.

v2 scores 72% and v1 70% on 60 cases. Ship v2?

Not on that evidence. With 60 cases the error bar is about ±12 points and the detection floor is about 12. Run a paired comparison, look at the interval and at the cases v2 made worse, and add cases if you need to detect small changes.

Code checks pass 100% of replies. What can still be wrong?

Meaning. Code rules see form (length, format, required words). They can't see an invented fact, like the 15-day allowance in the article's example.

Your agent succeeds 95% of the time per task. A job needs 4 tasks in a row. How often does the job succeed?

About 81% (0.95⁴). That's pass^k thinking: reliability compounds down, not up.

A judge only sees the chat transcript of a customer-service agent. What will it measure?

Mostly satisfaction: how the conversation felt. In the GAUGE audit such a judge was no better than a coin at telling working agents from broken ones (AUC 0.49). Give it the tool calls and the final state.

A model tops a public leaderboard by 2 points. Switch to it?

Use it to shortlist, then decide on your own eval. Leaderboard gaps that small are usually within noise, depend on the harness, and may reflect contamination.

14. Glossary & further reading

TermMeaning
EvalA repeatable test of your system on your data, with a grader and a number.
Gold answerThe correct output (or required facts) written down for each input.
Error analysisReading outputs, noting failures (open coding) and grouping them (axial coding).
LLM-as-judgeA model that grades another model's output.
Cohen's kappaAgreement beyond chance. 0 = chance, 1 = perfect; ~0.6 to gate a release.
Catch rateShare of truly bad outputs the grader fails (its recall on failures).
BootstrapResampling your results with replacement to get an error bar.
Paired comparisonComparing two versions on the same cases, so case difficulty cancels.
Detection floorThe smallest difference your test set can reliably detect.
pass@k / pass^kSucceeds at least once in k tries / every one of k tries.
FaithfulnessEvery claim in an answer is supported by the retrieved text.
Reward hackingA system optimised against a grader exploiting the grader's blind spots.
Contamination / saturationTest items in training data / a benchmark nearly everyone solves.

Every number on this page is quoted from the article, except the Robo-Helper numbers in section 11, which come from our own project code. The article's running-example numbers come from its author's own tutorial, which isn't linked publicly. Many of the 2026 papers it cites are arXiv preprints we haven't checked independently.