Engineering Around a Stochastic Component

Evals: The Only Way To Change a Prompt Without Fear

Without a labelled case set you are not engineering, you are gambling: every fix for the case in front of you silently breaks three you cannot see.

A team's durable asset is not its prompts. Those get rewritten monthly and are obsolete at the next model release. The asset is the labelled set of cases that tells you whether a change was an improvement. Without it, every prompt edit that fixes the example in front of you quietly breaks three you are not looking at, and you find out from users.

Build the set from failures, not from imagination

Start at 50 to 200 cases, seeded from real traffic. The distribution of what users actually send bears little resemblance to what you would invent at a desk — they paste malformed data, ask two questions at once, write in other languages, and hit the ambiguous edge you designed around. Every production failure then becomes a permanent test case. That loop is what makes the set compound; a static set written once decays into a thing people route around.

Tag every case by category: format validity, retrieval, refusal, tone, factual accuracy, latency. Aggregate scores hide the failure that actually churns users, which is a category going from fine to broken while the mean improves. Watch per-category deltas or you are watching an average that describes nobody.

Grading, cheapest and most reliable first

  • Deterministic checks. Schema validity, required fields present, numeric range, date parses, and whether the cited source actually contains the claim. Free, instant, no judge, no ambiguity. Most teams badly underuse this tier and jump straight to a model judge.
  • Pairwise comparison. Asking which of two outputs is better is markedly more reliable than asking for a score out of ten, because absolute scores from a model drift between runs and bunch into a narrow band.
  • Model-as-judge for subjective quality, with its known biases handled: position bias (it favours one slot, so run both orders and average), verbosity bias (longer reads as better), and self-preference (a model grades its own output generously, so the judge should be a different model from the one under test).
  • Human labels on a small anchor set. You validate the judge against people once, then let the judge scale. A judge never checked against a human is an unmeasured instrument producing confident numbers.
Two errors make an eval suite worse than none. Tuning against the test set until it is memorised, which converts measurement into theatre — hold out a split you do not look at. And reading a small sample as precise: fifty cases will not resolve a two-point difference, because the sampling noise is wider than the effect. Either accept only large movements as real or grow the set.

50-200 cases

enough to catch regressions, small enough to build this week — grown from production failures, never invented at a desk

Where evals pay for themselves: migration

Vendors deprecate models, change prices, and ship cheaper or better ones. Without a suite, every migration is a blind rewrite and a month of anxiety, which is why so many products run visibly stale models. With a suite you point it at the candidate, read per-category deltas within the hour, and either ship or know precisely what needs patching. The same machinery in continuous integration turns prompt edits into normal engineering: a regression gate that fails the build on a category drop is the difference between a product that improves monotonically and one that oscillates.

  1. Log everythingprompt, output, tool calls, cost, user verdict
  2. Sample the failuresweekly, by category, not at random
  3. Label and addeach failure becomes a permanent case
  4. Gate every changeprompt edits and model swaps both run the suite

The honest limit

Model judges agree with human preference reasonably well on clearly-better-or-worse pairs and poorly on close calls — that is the state of the research and it has not been resolved. So use them for regression detection, where you care about direction and magnitude, and not as proof of a small quality claim to yourself, your team or a customer. For anything you intend to assert publicly, you need human labels.

Key takeaways

1Your eval set, not your prompts, is the asset — build it from real production failures and grow it forever
2Exhaust deterministic checks before reaching for a model judge, and never let a model judge itself
3Track per-category scores; a rising average routinely hides the regression that loses users
4An eval suite is what makes model migration a one-hour measurement instead of a month of guessing

This is one lesson of 541.

The whole Foundation is free — 16 subjects, beginner to advanced. Sign in to track what you have read, take the end-of-module quizzes, and use the terminal.