6.2.9 · D3AI Agents & Tool Use

Worked examples — Autonomous agent evaluation

3,272 words15 min readBack to topic

This is the hands-on companion to Autonomous Agent Evaluation. The parent note built the formulas; here we exercise every one of them on a matrix of cases — every sign, every degenerate input, every limiting value — so that when you meet one in an exam or a real eval run, you have already seen its twin.

Before any symbol appears, we re-anchor it. Nothing below assumes you memorised the parent.


The scenario matrix

Think of every evaluation problem as living in a grid. The rows are the quantities the parent taught; the columns are the awkward situations that break naive intuition — a zero here, a limit there, a sign flip. Our job is to land at least one worked example in every cell that matters.

Cell Quantity under test The awkward situation Example
A Compounding success (product of step rates) many steps, per-step near 1 Ex 1
B Compounding success the degenerate step, rate Ex 1
C Success rate + confidence interval small (wide bars) vs large Ex 2
D Success rate CI boundary cases and (zero variance) Ex 3
E Discounted reward ordinary Ex 4
F Discounted reward limiting values and ; infinite horizon Ex 4
G Efficiency ratio actual = optimal (=1) vs actual optimal () Ex 5
H Tool precision / recall over-calling (low precision) vs under-calling (low recall) Ex 6
I Safety lexicographic score one violation wipes a "successful" run Ex 7
J Inter-rater agreement agreement vs chance-level () Ex 8
K Real-world word problem end-to-end flight-booking pipeline Ex 9
L Exam twist comparing two agents with overlapping error bars Ex 10

Each example below is tagged with the cell(s) it fills.



Example 1 — Compounding failure (cells A, B)

Forecast: guess before reading — is the whole pipeline closer to 95%, 60%, or lower than both?

Figure — Autonomous agent evaluation

Why a figure here? Because the whole point is geometric: each surviving fraction multiplies the bar down. Look at the amber bar in the figure shrinking at every stage — that shrinking is the product.

  1. Write the model. End-to-end success needs every step to succeed, and steps are independent, so the per-step probabilities multiply: Why this step? We use a product, not a sum, because "and" over independent events means multiply. A sum would let one strong step rescue a weak one, which is false — a broken parser stops everything.

  2. Plug in the good case. Why this step? Five identical factors collapse to ; then one more factor for the flaky parser.

  3. Now the degenerate case (cell B): set the parser to : Why this step? A single zero factor annihilates the whole product — this is the mathematical shadow of "if step 3 fails, step 5 is unreachable" from the parent note. There is no partial credit in a strict pipeline.

Verify: Sanity — the answer is below both and . That must be true: multiplying numbers below 1 always shrinks. And is unarguable. ✓


Example 2 — Success rate with confidence interval, small vs large (cell C)

Forecast: the point estimate is the same 60% both times — so what actually changes?

  1. Point estimate. . Why this step? is just the fraction that worked; it's our best single guess for the true rate.

  2. Standard error — how jittery that guess is: Why this step? We use the binomial SE because each episode is an independent yes/no trial with the same probability — exactly the coin-flip setup the formula was built for.

  3. 95% interval. Multiply SE by (the width that captures the middle 95% of a bell curve) and put it either side of : Why this step? We centre the interval on our best guess and reach out standard errors each way because, by the central-limit theorem, is approximately normally distributed around the true rate — and SE captures the central 95% of a normal curve, so the true rate lands inside this band 95% of the time.

  4. Large (cell C, other end): , : Why this step? sits under a square root in the denominator, so tenfold more episodes shrinks the bar by , not by 10.

Verify: width dropped from to , a factor of . ✓ This is why the parent said you need to tell 60% from 70% apart. Units: all dimensionless probabilities. ✓


Example 3 — The boundary cases and (cell D)

Forecast: the SE formula will give the same surprising number in both cases. Guess what.

  1. Case (a) estimate. .

  2. Plug into SE: Why this step? With , the factor , so the formula reports zero uncertainty.

  3. Naive CI: . Why this is wrong: the formula claims we are certain the true rate is exactly 100%. But 20 successes could easily come from a true rate of, say, 90%. The normal approximation collapses at the boundary because the bell-curve assumption fails when there is no observed variance.

  4. The fix — Rule of Three (a quick, honest bound). When you see 0 failures in trials, the true failure rate could be as high as roughly : so the honest interval is about instead of the fake . Why this step? The bound comes from asking "what is the highest true failure rate that still makes seeing zero failures believable?" The chance of zero failures in independent trials is ; we call an outcome "believable" if that chance is at least 5%. Solving gives , and since , this is very close to for reasonable . So is the honest ceiling on the failure rate that a zero-failure run can rule out — no more, no less.

  5. Case (b), the mirror : now , and giving the equally-fake . Applying the Rule of Three to the successes this time: true success could be as high as , so the honest interval is about . Why this step? Zero successes is not proof the agent never works — it just hasn't shown a win in 20 tries; the honest ceiling is .

Verify: ; the perfect run's honest floor and the zero run's honest ceiling both sit a full away from the fake boundary — exactly flagging that extreme small-sample scores are not proof. ✓


Example 4 — Discounted reward across all limits (cells E, F)

Forecast: at does the agent care about anything beyond the first step?

Recall the definition: — sum the rewards from step up to the horizon , but each later one is faded by an extra factor of .

Figure — Autonomous agent evaluation

Why a figure? The cyan curve shows collapsing toward zero for small and staying flat at for — you can see which rewards survive.

  1. Case (a), , : Why this step? The exponent is , so the first reward () is undiscounted ().

  2. Case (b), the degenerate : every is except (we take by convention here): Why this step? means "only now matters" — a myopic agent that ignores the future entirely.

  3. Case (c), the limit : no discounting, plain sum over the horizon : Why this step? treats a reward in step 1000 as valuable as one now — fine for short finite tasks, dangerous for infinite ones.

  4. Infinite horizon , constant reward , (cell F): the geometric series Why this step? Discounting guarantees a finite sum even over infinitely many steps () — the parent's "mathematical convenience" reason, made concrete. With this same sum would blow up to infinity.

Verify: (a) sits between (b) and (c), as it must for between and . The infinite series matches by the geometric-series formula. ✓


Example 5 — Efficiency ratio at both extremes (cell G)

Forecast: which way does the ratio move as an agent dawdles — up or down?

  1. Agent A: . Why this step? Optimal-over-actual equals 1 exactly when the agent is optimal — the upper limit, a clean ceiling.

  2. Agent B: . Why this step? Five times as many steps means one-fifth the efficiency; the ratio can never exceed 1 and slides toward 0 as wandering grows.

  3. Limiting behaviour: as , efficiency . It is bounded in .

Verify: , , both in . ✓ A perfect agent gives 1; an infinitely wasteful one approaches 0. ✓


Example 6 — Tool precision vs recall, over- and under-calling (cell H)

Forecast: which agent looks better on precision, and which on recall? They disagree!

  1. Agent X (over-caller): Why this step? X hit all the needed calls (recall 1) but wasted 2 extra ones (precision drops to 0.6).

  2. Agent Y (under-caller): Why this step? Y never wasted a call (precision 1) but missed one needed call (recall 0.667).

  3. Interpretation: precision and recall trade off. A single number that balances them is the F1 score, the harmonic mean: For X: . For Y: .

Verify: each ratio lies in ; X wastes so its precision ; Y under-covers so its recall . Y's higher F1 (0.80 > 0.75) reflects that missing one call hurts less here than wasting two. ✓


Example 7 — Lexicographic safety wipes a "win" (cell I)

Forecast: should a single deletion cost 2% or 100% of the score?

  1. Naive safety score: Why this step? It treats every action equally — but a deletion is not a rounding error, it is a red line.

  2. Lexicographic score (safety first, then success): Since a hard constraint was violated, regardless of the task success. Why this step? "Delete files" was a hard constraint. Ordering safety above success means one breach zeroes the run — an agent that fails safely beats one that succeeds destructively.

Verify: naive vs lexicographic — the gap is the whole lesson of the parent's [!mistake] callout. The deletion flips the run to 0. ✓


Example 8 — Inter-rater agreement at chance (cell J)

Forecast: if raters agree only as often as random guessing would, what should be?

Recall : it compares how much raters actually disagree against how much they'd disagree by pure chance.

  1. Compute: Why this step? well below means raters agree far more than chance, so climbs toward 1. The parent's threshold is exactly met here.

  2. Degenerate case: if (raters no better than chance), . Why this step? is the "coin-flip" floor — the rubric carries no shared meaning; fix the rubric before trusting any human scores.

Verify: ; and . Both sit in the expected range: meets the reliability bar, is chance-level. Interpretation: at we may trust the averaged human scores; at we must rewrite the rubric before any evaluation number means anything. ✓


Example 9 — Real-world word problem: the flight-booking pipeline (cell K)

Forecast: will the predicted product land inside the measured error bars?

  1. Predicted success (product model). Multiply the six : Why this step? Same "and over independent steps ⇒ multiply" logic as Example 1; the 0.85 parser is the weakest link.

  2. Measured estimate: .

  3. Measured CI: Why this step? We build the honest error bar so we can ask whether the theoretical prediction is plausible.

  4. Compare: predicted lies just above the upper bound . Why this step? The prediction falls outside the CI, signalling the steps are not truly independent — real pipelines have correlated failures (a bad parse cascades). The product model is an optimistic ceiling.

Verify: product ; ; CI upper , so the model overestimates — a real, interpretable finding. ✓


Example 10 — Exam twist: are two agents really different? (cell L)

Forecast: 65% vs 72% looks decisive — but with only 100 episodes each, is it?

  1. Agent P: ,

  2. Agent Q: ,

  3. Overlap check: P's interval reaches up to ; Q's reaches down to . Since , the intervals overlap. Why this step? Overlapping 95% intervals mean we cannot confidently declare Q better at — the apparent 7-point gap is within noise.

  4. The fix: increase . To halve the bar widths and separate them, quadruple the episodes (since ).

Verify: overlap region is , non-empty ⇒ not separable; and means episodes ⇒ tighter bars. ✓ This is the parent's warning ("you need to distinguish 60% vs 70%") made quantitative.


Recall Self-check

Why does a single 0% step zero the whole pipeline product? ::: Because independent "and" events multiply, and any zero factor annihilates a product — mathematically mirroring an unreachable downstream step. Why is a perfect small-sample score misleading? ::: The binomial SE becomes , falsely claiming certainty; use the Rule of Three () for an honest bound. What does mean for an agent? ::: Total myopia — only the immediate reward counts; all future terms vanish. When can't you declare Agent Q better than Agent P? ::: When their 95% confidence intervals overlap; the gap is within sampling noise. Why does lexicographic scoring send a task-successful-but-unsafe run to 0? ::: Safety is ordered above success, so any hard-constraint breach overrides the task reward entirely.

Prerequisite threads if any step felt fast: Benchmark Design, Human Evaluation Protocols, A/B Testing, Tool Use in Language Models, Reinforcement Learning Basics, Safety Alignment.