Lesson 07 · Grounding & Proof

Evals: Proving a Solution Works

The difference between a demo and a deployable system is evidence.

FDE skill · replace "trust me" with a number the customer can re-run
🎧 Listen to this lesson · ~6 min · narrated audiobook edition

⏱ ~7 min read · 🎧 6 min listen · ✎ 3 quizzes · 🧪 ~40 min lab

Demo day goes great. Then the customer's engineering lead asks the only question that matters: "How do you know it works?" — and "we tried a bunch of examples and they looked good" is not an answer a business bets on. This lesson is the course's center of gravity: evals — the discipline of measuring model behavior so you can prove, improve, and protect a solution. It's also the single most cited difference between AI products that ship and ones that stall.2

Why vibes fail

Three mechanisms make eyeballing worthless at scale. Sampling variance (Lesson 01): five good outputs tell you little about the distribution they came from. Unrepresentative tries: you test the inputs you think of; users supply the ones you didn't. And the killer — regressions: Lesson 03 taught you every prompt change moves the whole distribution, so the tweak that fixed ticket #4 may quietly break tickets #1 and #7. Without tests, you'd never accept that in ordinary software. This is ordinary software.

So the reframe: an eval suite is unit tests for model behavior. And exactly as in software engineering, the payoff is iteration speed — Hamel Husain, after autopsying many failed AI products, found the common root cause was precisely the missing evaluation system, because without one every improvement is a guess you can't verify.2 Your Lesson 03 lab's pass-rate checker was a tiny eval. Today it grows up.

Anatomy of an eval

Four parts, all of which you can build in an afternoon. A test set: real inputs mirroring the actual task distribution — including edge cases (empty input, hostile input, ambiguous cases). A runner that feeds each input through your system. A grader that scores each output. A score you track over time, per version — the number that answers the engineering lead.1

Before any of it: define success criteria — Anthropic's docs put this before prompt engineering itself. Good criteria are specific, measurable, achievable, and relevant. Not "the summarizer should be accurate," but "≥90% of summaries preserve all action items, on a 200-ticket held-out set, at under 2¢ each."1 Notice a criterion like that also settles the Lesson 02 model-tier debate with data.

Eval ≠ benchmark Public benchmarks (MMLU, SWE-bench) rank models on generic tasks — useful for shortlisting a model tier, useless for proving your system works on your customer's tickets. When a customer quotes a leaderboard, translate: "that's the engine spec; we still test the car on your roads."

The three graders

Code-based grading is the workhorse: exact match, string match, schema checks, numeric tolerance. Fastest, cheapest, perfectly reliable — use it for everything that has a checkable answer. Lesson 04 made this easier than it looks: structured outputs turn fuzzy prose into fields that == can grade.1

Human grading is the gold standard and the bottleneck: flexible, high-quality, slow, expensive. Use humans to bootstrap — label a seed set, define what "good" means, spot-check — not as the per-release grading engine. Anthropic's guidance is blunt: avoid it where possible.1

LLM-as-judge covers the middle: qualities code can't check and humans can't scale — tone, groundedness, helpfulness. A second model grades each output against a written rubric. Three rules make it trustworthy: give a detailed rubric, force a constrained verdict (correct/incorrect, or 1–5) after brief reasoning, and — before you rely on it — validate the judge against human labels. An unvalidated judge is just vibes with an API bill.1

Don't let the model grade its own homework Anthropic's example code carries a quiet best practice: use a different model to judge than the one that generated the output. Same-model judges share the same blind spots and flatter their own style — an independent judge is one line of code and one bias removed.

Two closing principles from the field. Volume over polish: many automatically-graded cases beat a few hand-graded ones.1 And evals compound: the same suite that proves v1 works also catches regressions on every prompt change, settles model swaps and price debates with numbers, and — as you'll see next lesson — becomes the yardstick that tells you whether fine-tuning earned its cost.2

The FDE's demo-day flex Hamel's Rechat case study shows what mature looks like: failure modes found by evals, fixes verified by evals, and eventually fine-tuning decisions driven by eval data. When you hand a customer a dashboard where they can re-run your eval suite, "how do you know it works?" becomes a button they can press.

🧪 Lab: build the eval, then audit the judge

The lab file is labs/0007-evals.py. Part 1 is a code-graded eval: ten labeled support tickets, two competing prompts, exact-match grading — and a verdict on which prompt wins, with the per-case failures printed. It's your Lesson 03 loop, formalized into a reusable harness.

Part 2 adds an LLM judge for something code can't grade — whether an answer is fully grounded in a provided policy — using a rubric, forced correct/incorrect verdicts, and reasoning before judgment. Part 3 is the step most teams skip: the file ships human labels for every case, so you measure your judge's agreement with humans and decide whether it's trustworthy enough to scale.

🤖 Get your work reviewed

No chat here — this box replaces it. Copy the prompt into any AI assistant (Claude, ChatGPT, Gemini…), then paste your work after it.

You are a senior AI engineer reviewing my work: the output of my evals lab (labs/0007-evals.py) plus a success criterion I wrote for a feature of my choice and my judgment call on whether my LLM judge is trustworthy.

Grade each item as Strong / Adequate / Missing, with one sentence of evidence:
- My success criterion is specific, measurable, achievable and relevant — a number on a defined test set, not an adjective.
- My Part 1 output shows a code-graded comparison of two prompts with per-case failures, and my winner claim is backed by the scores.
- My Part 2 judge uses a written rubric, constrained verdicts, and reasoning before judgment — and I used a different model (or can say why not).
- My Part 3 agreement analysis leads to an explicit trust decision: at what agreement rate I'd rely on this judge, and what I'd do if it fell below.

Be skeptical — challenge my weakest number first. Then ask me 2–3 follow-up questions a customer's engineering lead would ask before accepting my eval as proof. Finish with the single highest-leverage improvement.

My work follows below.

Check yourself — design the measurement

Three teams, three measurement problems. Don't scroll up — reason from the grader trade-offs. Wrong picks stay live.

Scenario A

A team "improved" their support bot's prompt for politeness; a week later, refund-eligibility answers broke and nobody noticed until customers complained. What practice was missing?

Scenario B

A customer wants weekly quality reports on 20,000 chatbot answers. Their plan: a rotating human panel reads them all. Your recommendation?

Scenario C

Your LLM judge rates 96% of outputs "good," but users keep reporting bad answers. The judge prompt says: "Rate the answer's quality from 1–5." What's the highest-leverage fix?

Primary source — read this
The complete method in one page: SMART success criteria, eval design principles (task-specific, automated, volume over polish), and worked code for every grader type including LLM-judge rubrics. Your lab is a compressed version of this doc.
Your one tangible win Next time anyone — customer, teammate, you — says an AI change "seems better," you can ask on what test set, graded how, versus what baseline? and build the missing harness in an afternoon: criteria → labeled cases → the cheapest trustworthy grader → a number that survives demo day. That question, asked early, is worth more than any prompt trick in this course.
Questions? Not sure whether something is code-gradable? Judge agreeing with humans only 70% of the time and unsure what that means? Paste the relevant lesson section — or your eval output — into any AI assistant (Claude, ChatGPT, Gemini…) and ask. For a structured review of your lab, use the box above.

Recommended learning

Hand-picked follow-ups on evals. None are required — the primary source above comes first.

References

  1. Anthropic, "Define success criteria and build evaluations" — criteria, eval design principles, and the three grading methods (verified July 2026).
  2. Hamel Husain, "Your AI Product Needs Evals" (2024) — eval systems as the root cause separating successful AI products from failed ones.
  3. Chip Huyen, AI Engineering (O'Reilly, 2025) — evaluation methodology and AI-as-judge chapters.