Back to course overview
Module 5Evaluating & iterating on prompts 10 min

A/B testing prompts

Comparing prompt variants like an experimenter: one variable at a time, paired comparisons on the golden set, and honest reading of small samples.

With a golden set and checks, you can finally answer the daily question of prompt work — is version B actually better than version A? — with evidence instead of adrenaline. The method is ordinary experimental hygiene, applied to prompts.

The protocol

  1. 1Change one thing. New example set OR reworded rule OR reordered sections — never all three. Bundled changes produce unattributable results, and unattributable results teach you nothing for next time.
  2. 2Run both versions on the full golden set — same cases, same settings. Because outputs vary run-to-run, run each version 3× on borderline cases (self-consistency, now serving measurement).
  3. 3Compare paired, not pooled. Don't just compare totals — list the cases where A passed and B failed, and vice versa. The flips tell the story: B fixing 3 hard cases while breaking 2 easy ones is a very different result from 'B +1 overall'.
  4. 4Read every regression. A case that flipped from pass to fail is either a real regression or a gold answer that deserves rethinking. Decide which, explicitly.

Honest statistics at golden-set scale

With 20–50 cases you're not running clinical trials — a 1-case difference is noise, and pretending otherwise is self-deception with charts. Practical significance bar: a variant wins when it fixes multiple hard cases, breaks nothing you care about, and the flips survive a re-run. For subtler differences, grow the eval set before growing your confidence.

  • Beware overfitting to the golden set. Tuning examples until exactly your 17 cases pass can memorize the set rather than learn the task. Defense: hold out 3–5 cases you never tune against, and refresh with production cases regularly.
  • Judge dimensions A/B the same way: run the judge over both versions' outputs, compare paired scores, read the worst_sentence fields — they're a map of what the variant actually changed.
  • Log every experiment — one line: date, versions, hypothesis, result, decision. Your future self will otherwise re-run this exact experiment in three months.
Prompt to try

Here are two versions of one rule from my triage prompt and my hypothesis for why B beats A: [paste]. Before I run the eval: predict which golden-set cases could plausibly flip in each direction, so I know where to look. Then critique my hypothesis — what else could explain a win for B?

Pre-registering predictions — old-fashioned scientific discipline — is startlingly effective at catching yourself rationalizing after the fact.

The vibes relapse

Under deadline, everyone's tempted to eyeball two outputs and ship the prettier one. The golden set makes rigor cheaper than vibes — running 17 cases takes minutes with tooling, about an hour by hand — still cheaper than shipping a regression, and it's the only way to know B didn't quietly break the injection defense you built in Module 1.