Design the exam before trusting the student:
eval sets for agents

Session 19 · Fri Nov 13 · Book sections 6.3 + 6.4

🧪

Today’s question

Monday you learned to distrust a validation score. Today’s task:

Before you delegate a task to an agent — what exam would it have to pass?

This lecture in the literature

Doing it right: before trusting a model as judge, measure its biases — verbosity, position — against human panels.

Zheng, L., et al. (2023). Judging LLM-as-a-judge with MT-Bench and Chatbot Arena. NeurIPS 2023, Datasets and Benchmarks Track.

Capability is not uniform: the same model misses facts placed mid-context that it finds at the edges — assume nothing, measure.

Liu, N. F., et al. (2024). Lost in the middle: How language models use long contexts. Transactions of the ACL, 12, 157–173.

Judges trained on human approval learn to flatter — unearned praise is a measured failure mode, not a courtesy.

Sharma, M., et al. (2023). Towards understanding sycophancy in language models. arXiv:2310.13548 (also ICLR 2024).

Three measurements of AI systems — each one an eval set somebody bothered to build.

Twelve cases, truth planted by us

Sweep every knob that changes the physics; include cases where the right answer is “nothing there”; include one at the edge of detectability.

The agent that would have shipped

3/12 cases passed — agent v1, straight-line fit + jump detector

Velocity within tolerance on 6/12; offset calls right on 9/12. On any single series, its answer looks reasonable.

Failures come in groups: velocity wrong whenever an offset is present; small offsets missed; one false alarm in low signal-to-noise.

The scorer must survive a malformed answer

The most common live-agent failure is not a wrong number — it is output that breaks the schema.

{"velocity_mm_yr": "about 12 mm/yr", "offset": False}
→ pass: False · malformed: "missing key 'offset_day';
                            'velocity_mm_yr' has type str"

A scorer that crashes on bad output cannot record the very failure it most needs to record.

Where does ±3.0 come from? We measured it

1.85 mm/yr 95th-percentile velocity error on 2-yr records — 50 fresh realizations

On 10-yr records the same measurement gives 0.28 mm/yr — the original ±1.5 was comfortable there, and never achievable on 2 years of colored noise.

Spec v3 sets ±3.0 for short records: ~1.5× the measured 95th percentile — a property of the physics, not a curve drawn after the exam.

When there is no number to check

Your stage-4 review agent outputs a judgment. Two substitutions keep the machinery:

  • Rubric as scorer — binary checks; plant defects in the papers so “found the flaw” is computable again
  • Measure the rubric itself — two raters, same output: your 6.2 partner-swap data

92% agreement, κ = 0.00 two lenient raters who pass nearly everything

Percent agreement flatters; Cohen’s kappa subtracts chance. Report both.

One run is a coin flip

0.4 ± 0.22 pass rate, planted flaw “single seed, no spread” — runs: 0 1 0 1 0

Recorded review agent, N = 5 runs per case. A sampled model does not return the same answer twice.

Report rates, not verdicts; fix N in the spec; believe a change only when the margin beats the standard error.

The examinee can read the exam

  • An agent with repo access can open the generator source — noise model, truth parameters, the twelve printed seeds
  • No intent required: if it can look, it is in context — contaminated by construction
  • Defense: truth the agent cannot reach — fresh private seeds drawn at evaluation time, never committed

Same principle as the class leaderboard’s hidden test set — an eval you iterate against is a validation set; final trust needs unseen cases.

Say what the agent did — and what you verified

  • Disclose tool + task + what you verified — the third column is the graded one
  • AI is not an author: humans own correctness; “the model made that mistake” is not a defense
  • You may be examined: any line, any number, orally, without notes — whoever wrote it

An eval set is what turns “we used an agent” into a verifiable statement. Disclosure is where you say so.

The eval-driven loop

Step This notebook Your stage-4 agent
Spec schema + tolerances, v1→v3 your quality rubric, binary checks
Cases 12 series, planted offsets ≥6 papers, planted defects + one clean
Scorer tolerance checks, survives malformed output rubric checks + two-rater kappa
Run deterministic, once sampled, N runs → pass rates ± s.e.
Failures grouped: agent, spec, or physics? grouped: agent, rubric, or genuinely hard?

Same loop as Chapter 3 model development — the eval set is the held-out test set, and you write the truth.

Now run it yourself — open 6.3

  1. pixi run jupyter lab6.3_build_an_eval_set.ipynb
  2. Run spec v1 → agent v1: reproduce 3/12 and read the failure groups
  3. Break the scorer: feed it your own malformed dict — does it record or crash?
  4. Re-derive the ±3.0: rerun the 50-realization spread with your own seeds
  5. Start your stage-4 eval: pick the agent task, draft spec v1 before Monday

Arc stage 4 assigned today, due Thu Dec 10 · Ch 6 quiz Mon–Wed · HW-CML due Fri Nov 20 · check-in #1 Monday