Evaluation and Trace-Driven Development
Probabilistic systems need task success defined before iteration. This stage builds a versioned harness that separates component failures, records complete trials, calibrates imperfect graders and turns evidence into release decisions.
Section 2 of 8 · 12 units · about 52 hours
By the end you can Build a versioned evaluation harness that detects at least three seeded bad system variants, calibrates automated graders on a trusted subset, preserves item-level traces and makes one release or rollback decision with uncertainty and guardrails.
Units
- Task contracts, observable outcomes, trials, transcripts and final state4h
- Golden and representative sets from real traces, with long-tail and adversarial slices5h
- Component, trajectory and end-to-end evaluation boundaries3h
- Exact, schema, executable and state-based verifiers4h
- Rubric and pairwise model judges and their position, length and style biases5h
- Human adjudication, reviewer agreement and judge calibration on a trusted subset5h
- Repeated trials, variance, pass@k misuse and uncertainty intervals5h
- Versioned datasets, graders and harnesses with item-level artifacts4h
- A failure taxonomy and attribution to model, context, retrieval, tool, state or grader4h
- Minimum meaningful change, regression thresholds and guardrail metrics4h
- Seeded bad variants, continuous evaluation and release or rollback gates5h
- Online outcomes, feedback and stateful simulated users4h
Build it
Mini project · about 14 to 18 hours
Replayable workflow evaluator with tested release gates
Extend agentlab with evals/ for the same bounded workflow, using a resettable fake environment before durable execution exists. Verify outcomes independently of transcripts, audit graders and defend release decisions from complete trial evidence. Run deterministic fakes or your small open local model on your machine with the section's pinned libraries and no paid APIs.
- 1Define initial state, permitted effects and terminal outcomes in a resettable fake environment. Test exact, schema, executable-state and process verifiers against independently labeled fixtures; retain transcript/final-state disagreements, wrong-resource and duplicate-effect rejections, valid alternatives and evaluator errors before any model run.
- 2Build representative and challenge items from exercised workflow traces, disclosing synthetic origins. Retain long-tail, adversarial, unanswerable, unauthorized and recovery slices with source-grouped development/holdout splits. Check a boundary-to-grader map and frozen-prefix regression against independent outcome and process labels, not a canonical action sequence.
- 3Implement an Inspect task or map its task, sample, solver, scorer and log contracts explicitly. Check identity/coverage corruption and trial resets before aggregation; retain version manifests and complete per-trial artifacts. Validate first-try, at-least-one and all-attempt reducers plus source-cluster uncertainty against enumeration and synthetic oracles.
- 4Audit explicit fake or local criterion and pairwise judges using content-matched order, padded-length, style and identity controls. Retain raw verdicts and blinded reviewer labels, pre-adjudication disagreements, adjudication and frozen trusted-subset class-conditional calibration with denominators; disclose unavailable independent review rather than treating self-relabeling as agreement.
- 5Build evidence-linked model, context, retrieval, tool, state/reset and grader failure categories, using canned retrieval until retrieval exists. Check first-divergence hypotheses with frozen-prefix, single-boundary substitutions against independent oracles; retain uncertainties and repaired prefix/end-to-end regressions beside baseline-versus-baseline variance and repeated fixed-item, fixed-grader, matched-budget candidate trials.
- 6Predeclare meaningful-change margins, power assumptions and separate safety, schema, latency and resource guardrails. Test paired-interval release/hold/rollback decisions with malformed-output, fabricated-completion and unauthorized-or-duplicate-effect variants plus a passing control. Retain continuous-evaluation entry points, sentinel results and evidence showing missing items, grader crashes or version mismatches block release.
- 7Optionally add scripted stateful users with bounded knowledge, approval and termination policies. Check their policy compliance and reset behavior independently; retain synthetic delayed-outcome/feedback joins, missing observations and a reviewed feedback-to-development regression, proving favorable feedback cannot override the outcome oracle or contaminate the locked holdout.
What you hand in
- Versioned
evals/tasks, items, graders, trusted labels and source-grouped splits with an Inspect contract mapping. - Complete redacted trial records, judge audits, first-divergence replays and repeated paired uncertainty reports in
reports/. - Continuous-evaluation gate with known-bad variants, passing control, evaluator sentinels and reproducible release, hold or rollback evidence.
How to check it
- Self-grade with the rubric below
- Inspect task and sample contracts
Use the pinned Inspect package or document equivalent contracts; retain your own reset, scorer, identity and coverage regression tests.
How it's graded
Outcome and instrument correctness
Pass: Your independently labeled verifier fixtures distinguish transcript claims, authorized final state, process violations and evaluator errors. Known-bad variants fail their intended semantic checks while the valid control passes.
Great: Always-pass and always-fail grader mutations are caught by sentinels; valid alternative trajectories remain accepted, and evaluator failure cannot masquerade as model failure or a complete release result.
Judge and label validity
Pass: Your controlled bias probes retain response identities and malformed verdicts. Trusted-subset calibration reports false acceptance, false rejection and coverage; original reviewer labels, adjudication and unavailable independent validation remain explicit.
Great: Random audit items expose shared errors beyond disagreements; criteria revisions use fresh validation, and unreliable slices defer to executable or manual checks rather than judge confidence.
Replayable comparison and decision
Pass: Your oracle-tested reducers and uncertainty checks support fixed-item, fixed-grader, matched-budget comparisons retaining failures. Identity-checked artifacts reconstruct attribution and paired decisions; incomplete evidence, evaluator errors and failed guardrails block release.
Great: Source-aware power assumptions and baseline variance bound negative or inconclusive claims; a fresh scoring process reproduces evidence-linked recommendations, and post-release breach fixtures identify a known-good rollback version without real deployment.
Resources
- Demystifying Evals for AI AgentsAnthropic
Read "The structure of an evaluation" (task, trial, grader, transcript, outcome, harness, suite), "Types of graders for agents", "Capability vs. regression evals", the non-determinism section and the roadmap Steps 0 to 8. Its
0.75**3reliability example assumes independent trials at one fixed success probability; do not raise an aggregate success rate to a power. Apply it to one multi-step task with outcome checks on environment state. - AI Agents in Depth - Chapter 7Bojie Li
Read the live Chapter 7: 7.1 (anatomy of a tau2-bench telecom task), 7.2.1 Pass@k and 7.2.2 Pass^k, 7.3, 7.4 (7.4.2 verifiers, 7.4.4 contamination, 7.4.5 quality control), 7.5.1 judges, 7.5.2 first-error localization, 7.5.4 position bias, 7.7 statistical significance, 7.8 and 7.10. It has no inter-rater agreement procedure; pair it with the judge sources.
- LLM Evals FAQ and LLM-as-a-Judge GuideHamel Husain and Shreya Shankar
Read the FAQ answers "What is a trace?", "How many examples do I need for an eval?", "How do I know if I can trust my automated eval?" and "How are evaluations used differently in CI/CD vs. monitoring production?", then the judge guide (
/blog/posts/llm-judge/) Steps 2, 3, 5 and 6. Do the open and axial coding of failures on your own traces before writing any judge. - Inspect AIUK AI Security Institute
Read tasks, datasets, solvers, scorers (
match,model_graded_qa: bind the grader model explicitly, or it falls back to the model under test), metrics (Epochsreducers;pass_at_kandpass_kdiffer) and eval logs (read_eval_log).mockllm/modelruns on CPU without keys for plumbing tests. Either implement one small suite in Inspect or map an independent harness to the same contracts. - Adding Error Bars to Evals: A Statistical Approach to Language Model EvaluationsEvan Miller
Read Sections 2.2 (clustered standard errors, Equation 4), 4.2 (paired differences, Equation 7) and 5 (power, Equation 9). Compare systems on question-level paired differences from saved item scores, cluster by source item, and size the eval for the smallest effect you need to detect.
- Evaluating Large Language Models Trained on Code (pass@k estimator)Chen et al.
Read Section 2.1, Equation 1 and the numerically stable implementation in Figure 3 only. Estimate pass@k per task from n samples with c successes as
1 - C(n-c, k) / C(n, k), then average over tasks; the plug-in1 - (1 - c/n)**kis biased. Pass@k is not the all-k reliability that pass^k measures. - Judging LLM-as-a-Judge with MT-Bench and Chatbot ArenaZheng et al.
Read Sections 3.3 and 3.4 with Tables 2 and 3: position, verbosity and self-enhancement bias, and the swapped-order and randomized-position mitigations. The paper says it cannot determine whether self-enhancement exists, so treat it as a risk to test. Build swapped-order and padded-length fixtures for your judge.
- AlgoMaster AI Engineering - Evaluation UnitsAlgoMaster
The owned premium lessons
agent-evaluation-and-testingandevaluating-rag-systems(about ten minutes each) are a short application-oriented pass after the Anthropic article. Recompute anything they report in your own harness and keep item-level evidence. - AI Engineering Handbook - EvaluationHandbook Academy
Study Part 4 Eval Fundamentals and the evaluation, judge, regression, online-testing, tracing and feedback chapters in Part 8 (
/curriculum/evaluation-and-observability/). Use its taxonomies to check coverage, while keeping raw item-level artifacts as the source of truth. - Who Validates the Validators? Aligning LLM-Assisted Evaluation of LLM Outputs with Human PreferencesShankar et al.
Read Section 7.3.1 on criteria drift and the coverage and false-failure-rate idea in Appendix A.3. Define coverage and false-failure rate from an explicit confusion matrix of human labels, since the v1 appendix notation is inconsistent, and keep exploratory rubric data apart from the locked set.
- Large Language Models are not Fair EvaluatorsWang et al.
Read Section 2 (position manipulation) and Section 3.2 Balanced Position Calibration, Equation 2: average each response's scores over both placements. Use it when you implement order-balanced judging.
- AI Engineering and Agentic Systems CheckpointRoadmap-Final
Use only the evaluation and debugging clauses as an adversarial checklist. Reserve the M5 integrated pass condition for AI-8.
- Length-Controlled AlpacaEval: A Simple Way to Debias Automatic EvaluatorsDubois et al.
Read Section 3 with Equations 1 and 2 and the limitations in Section 5 after the basic swap and length tests pass. Length control changes the estimand; it is not dividing a win rate by output length.
- tau-benchSierra Research
At commit 59a200c, read README "Run", "User simulators" and "Historical trajectories", and
Env.calculate_rewardintau_bench/envs/base.py(database hash equality after replaying the reference actions, then required output substrings). The README says the tasks are not updated and points to tau2-bench. Inspect one stored trajectory instead of running the benchmark. - Cohen's Kappa (scikit-learn)scikit-learn
Use the definition
kappa = (p_o - p_e) / (1 - p_e)with per-annotator marginals for two-reviewer agreement, and keep the confusion matrix beside the scalar. Agreement is not correctness, and no kappa threshold is a universal gate. - No Magic - microerrorbars.pyNo Magic
Read this dependency-free script for the mechanics of standard errors and paired comparisons on eval scores, then implement the same checks on your own saved item-level results.