GuideCraft · Intermediate

Experiments and evals

Prove an AI change helps before and after it ships: cheap checks first, a golden dataset with a holdout, judges calibrated against people, small-sample statistics, CI gates, A/B tests, agent evals and today's tools.

Checked 13 Oct 202624 min read2 prompts

On this page
  1. Why evals
  2. The metric ladder
  3. Your first eval this week
  4. Members only: Build a golden dataset
  5. Members only: Run offline experiments
  6. Members only: LLM-as-judge done safely
  7. Members only: Statistics at small sample sizes
  8. Members only: Gates in CI
  9. Members only: Online evaluation and A/B tests
  10. Members only: Agent and trajectory evals
  11. Members only: Tools compared
  12. Members only: Mistakes to avoid
  13. Members only: Exercises

An eval is a test for software whose output varies. It has three parts: a set of cases, a way to score each output, and a number you compare across versions of your prompt, model or pipeline. Without evals, every prompt edit, model upgrade and new tool is a guess, and your customers do the grading.

Why evals#

1. A dataset of 120 test cases feeds two prompt variants, A and B. 2. Code checks and an LLM judge score every output. 3. Combined scores: production 80, prompt A 74, prompt B 89. 4. The CI gate requires a score above production. Prompt B passes and ships. Prompt A is a regression and is blocked. 5. Production traces flow back into the dataset as new test cases.traces become new test casesDataset120 test casesPrompt AshorterPrompt Badds examplesCode checksformat, factsLLM judgerubric scoreCombined score, 0 to 100Production80Prompt A74Prompt B89CI gatemust beat production (80)B · shipsA · blockedProductionserves prompt B

Four things go wrong without them:

  • The model changes under you. Vendors retire models on fixed dates and change defaults between versions. A Claude request that omits effort now runs one level lower on Claude Opus 5.5 than on Claude Opus 5, because the default moved from high to medium. Microsoft warns that Microsoft Copilot (formerly Microsoft 365 Copilot) moves to newer models automatically, so agent behavior shifts over time. A fixed set of cases tells you what changed.
  • Fixes break other cases. A prompt edit that fixes the case in front of you often breaks two you are not looking at. Only a fixed set of cases shows the trade.
  • Cost decisions need evidence. A cheaper model or a lower reasoning setting that scores the same on your cases saves money every day. One that scores 3 points lower may still be the right call, but you should know the number.
  • Reading outputs does not scale. OpenAI's eval guide lists "vibe-based evals" ("it seems like it's working") as an anti-pattern. You can read 20 outputs carefully. You cannot read 2,000 after every change.

The eval loop has seven steps:

  1. Read real outputs and write down how they fail. 50 to 100 is enough to start. This is error analysis, and it decides what you measure.
  2. Turn each failure mode into a check, the cheapest one that catches it (the metric ladder below).
  3. Collect cases into a golden dataset with a holdout you rarely touch.
  4. Run experiments: compare variants on the same cases, with statistics that respect small samples.
  5. Gate releases in CI so a regression cannot merge silently.
  6. Ship gradually and score production traffic with the same checks.
  7. Feed new failures back into the dataset, and go around again.

Anthropic's engineers put the starting bar low: "20-50 simple tasks drawn from real failures is a great start." They also warn that "You won't know if your graders are working well unless you read the transcripts." Expect your definition of good to change as you grade. Researchers who studied this call it criteria drift: people need criteria to grade outputs, and grading outputs is how they discover the criteria (Shankar et al., 2024).

The metric ladder#

Climb only as far as the quality you need to measure requires. Each rung is slower, costlier and noisier than the one below it.

RungWhat it checksExamplesCost and noise
1. Deterministic checksWhat code can decideJSON parses and matches the schema; label equals the expected label; required fields present; no banned phrases; SQL runs; unit tests pass; the right tool called with the right arguments; length, latency and cost limitsNear zero cost, no variance. Run on every commit
2. Reference and retrieval metricsOverlap with a known answer or sourceField-level precision and recall; retrieval recall@k (the right passage is in the top k results); context recall; numeric answers within a toleranceCheap. Needs labelled references
3. LLM judgeQualities code cannot decideFaithfulness to sources; tone; policy compliance; whether a reply resolves the issueModel cost per case. Noisy, and only as good as its calibration
4. People and productionWhat users experienceExpert review of a sample; resolution rate; escalations; edits before sending; complaintsSlowest. The ground truth the other rungs approximate

Five rules keep the ladder honest:

  • Exhaust rung 1 first. Anthropic's grading guidance ranks code-based grading as the fastest and most reliable, and says to test an LLM grader for reliability before you scale it.
  • One criterion per check. A judge asked "is this good?" returns a number you cannot act on.
  • Prefer pass or fail with a written rule to a 1 to 10 scale. Hamel Husain writes that "tracking a bunch of scores on a 1-5 scale is often a sign of a bad eval process": nobody can say what separates a 3 from a 4. Binary verdicts are also easier to calibrate against people.
  • Treat text-overlap scores as weak signals. OpenAI lists relying only on academic metrics such as BLEU as an anti-pattern for open-ended text.
  • Tie every check to a failure mode you saw in real outputs. A check that never fails, on any version, measures nothing.

Your first eval this week#

You need no tools for the first round, only a spreadsheet:

  1. Pick one task and pull 30 real inputs from it. Remove personal data first.
  2. Write the expected output or a pass rule for each case, in columns: id, input, expected, notes.
  3. Add three deterministic checks you can compute with a formula or 20 lines of code, such as "label matches", "reply under 120 words" and "no promised dates".
  4. Run your current prompt and one variant on all 30. Count the passes for each, then read every case where the two disagree.

That is an eval. While you read outputs, write a one-line note on each failure, then turn the notes into failure modes with this prompt:

Prompt

Turn reviewer notes into failure modes

Level 3Any assistant
Below are notes a reviewer wrote while reading [NUMBER] outputs from our [TASK, FOR EXAMPLE SUPPORT REPLY DRAFTS]. Each note starts with the case ID.

<notes>
[ONE NOTE PER LINE, FOR EXAMPLE: sr-0042 promised a refund date the policy does not give]
</notes>

Group the notes into failure modes.
- Name each failure mode in five words or fewer and define it in one sentence a new reviewer could apply.
- List the case IDs in each mode and count them. A case can belong to more than one mode.
- Put notes that fit no mode under "Unclear" instead of forcing them in.
- Sort the modes by count, highest first.

Then suggest the cheapest check that could catch each mode: a code check (say exactly what it tests), a comparison with a reference answer, or a one-sentence judge rubric. Prefer code checks.

Return a table with columns: failure mode, definition, count, case IDs, suggested check.

Warning

Outputs from production often contain customer details. Paste only your notes and redacted cases into a consumer chat app, never raw transcripts. For raw transcripts, use an enterprise plan that does not train on your data.

Build a golden dataset

The rest of this guide turns that spreadsheet into a system you can trust: a golden dataset with provenance and a holdout, experiments with paired statistics, an LLM judge calibrated against human labels, a CI gate that runs on every pull request, production scoring with ...

Members only below this line

Get the rest of this guide free

What you get on this page:

  • 1 prompt

Free. You also get Stratiflux Weekly: one email a week, unsubscribe anytime.

Also in the members part

  1. Run offline experiments
  2. LLM-as-judge done safely
  3. Statistics at small sample sizes
  4. Gates in CI
  5. Online evaluation and A/B tests
  6. Agent and trajectory evals
  7. Tools compared
  8. Mistakes to avoid
  9. Exercises

Sources

Checked against these on 13 Oct 2026.

  1. Define success criteria and build evaluations (Claude docs) (opens in a new tab)platform.claude.com
  2. Demystifying evals for AI agents (Anthropic Engineering, January 2026) (opens in a new tab)anthropic.com
  3. Adding Error Bars to Evals: A Statistical Approach to Language Model Evaluations (Miller, 2024) (opens in a new tab)arxiv.org
  4. A statistical approach to model evaluations (Anthropic) (opens in a new tab)anthropic.com
  5. Evaluation best practices (OpenAI API docs) (opens in a new tab)developers.openai.com
  6. OpenAI API deprecations, Evals platform and reusable prompts (opens in a new tab)developers.openai.com
  7. Moving from OpenAI Evals to Promptfoo (OpenAI Cookbook) (opens in a new tab)developers.openai.com
  8. Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena (Zheng et al., 2023) (opens in a new tab)arxiv.org
  9. LLM Evaluators Recognize and Favor Their Own Generations (Panickssery et al., 2024) (opens in a new tab)arxiv.org
  10. Replacing Judges with Juries: Evaluating LLM Generations with a Panel of Diverse Models (Verga et al., 2024) (opens in a new tab)arxiv.org
  11. Who Validates the Validators? Aligning LLM-Assisted Evaluation of LLM Outputs with Human Preferences (Shankar et al., 2024) (opens in a new tab)arxiv.org
  12. Using LLM-as-a-Judge For Evaluation: A Complete Guide (Hamel Husain) (opens in a new tab)hamel.dev
  13. tau-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains (Yao et al., 2024) (opens in a new tab)arxiv.org
  14. SWE-bench: Can Language Models Resolve Real-World GitHub Issues? (Jimenez et al., 2023) (opens in a new tab)arxiv.org
  15. A Careful Examination of Large Language Model Performance on Grade School Arithmetic (Zhang et al., 2024) (opens in a new tab)arxiv.org
  16. Diagnosing Sample Ratio Mismatch in A/B Testing (Microsoft Experimentation Platform) (opens in a new tab)microsoft.com
  17. CI/CD integration for LLM eval and security (promptfoo docs) (opens in a new tab)promptfoo.dev
  18. Assertions and metrics (promptfoo docs) (opens in a new tab)promptfoo.dev
  19. Command line reference (promptfoo docs) (opens in a new tab)promptfoo.dev
  20. Promptfoo is joining OpenAI (promptfoo blog, 9 March 2026) (opens in a new tab)promptfoo.dev
  21. ClickHouse welcomes Langfuse (ClickHouse blog, 16 January 2026) (opens in a new tab)clickhouse.com
  22. Block regressions in CI (Langfuse docs) (opens in a new tab)langfuse.com
  23. Using secrets in GitHub Actions (GitHub Docs) (opens in a new tab)docs.github.com
  24. Evaluate systematically (Braintrust docs) (opens in a new tab)braintrust.dev
  25. Arize Phoenix documentation (opens in a new tab)arize.com
  26. Inspect AI documentation (UK AI Security Institute) (opens in a new tab)inspect.aisi.org.uk
  27. DeepEval quickstart (Confident AI) (opens in a new tab)deepeval.com
  28. Ragas repository (opens in a new tab)github.com
  29. openai/evals repository (opens in a new tab)github.com
  30. agentevals repository (LangChain) (opens in a new tab)github.com
  31. Write effective instructions for declarative agents (Microsoft Learn) (opens in a new tab)learn.microsoft.com
  32. Effort (Claude docs) (opens in a new tab)platform.claude.com