Module contents
Lesson 28 of 31Advanced 110 min

Agent evaluation II: trajectories, benchmark validity and time horizons

Examine trajectory evaluation, agent judges, task and outcome validity, shortcuts and broken checkers, harness sensitivity, agent-specific variance, and time horizon. Audit a benchmark and estimate local agents' horizons.

After this lesson you can

  • Evaluate trajectories by progress, tool errors, and recoveries, and validate an agent judge against human annotation.
  • Audit a benchmark with null agents and adversarial shortcuts and correct checkers that accept them.
  • Apply a task- and outcome-validity checklist to a public benchmark and your own.
  • Quantify how results change with the harness while the model remains fixed.
  • Estimate an agent's 50% time horizon with logistic regression on human task duration and a bootstrap interval.

Before you start

The checker is examined too

A success rate summarizes what a checker accepted. Numerical precision is insufficient: the task must require the capability under study and the checker must recognize correct outcomes. Benchmark validity includes both questions. Zhu et al. analyze task preparation and reward design problems in agent evaluation. Review initial state, file access, alternative solutions, and success criteria before comparing systems.

InteractiveAudit the checker

Writes an expression that agrees on the checker’s five inputs but differs elsewhere.

The shortcut’s ten acceptances correspond to the ten repair tasks. Exact checking covers only the benchmark’s limited arithmetic grammar.

Agent
Tasks accepted10 / 40
Correct reference accepted40 / 40
Choose a trivial agent and compare the previous lesson’s checker with a polynomial identity check. Figures come from running all 40 tasks in the in-house benchmark.

In the previous lesson’s benchmark, doing nothing, returning the prompt, or attempting to overwrite an unexposed test file passes none of 40 tasks. A harmless expression constructed to match all five test inputs passes the ten repair tasks despite differing on other inputs. The audit subclass checks polynomial identity in the benchmark’s restricted arithmetic grammar: it rejects that shortcut while accepting all 40 reference solutions. This does not prove correctness for arbitrary programs; outside that grammar identity needs another method. The 40 instances belong to three families, not 40 independent domains.

To repeat the local audit download audit.py and the previous lesson’s harness into one directory and run python audit.py. Each attempt creates and closes a temporary environment. Output shows tasks accepted for each policy and reference before and after identity checking. The strengthened version resides in a lab subclass; the original harness remains available to reproduce earlier results.

The benchmark card should accompany results. Its purpose is to study tool interaction on small tasks, not estimate general agent capability. There are 15 JSON file sorting instances, 15 SQLite row updates, and 10 expression repairs; each family repeats a template. The environment is recreated per attempt and exposes only temporary-directory reads and writes and defined database operations. The strengthened repair checker accepts a limited polynomial grammar and checks identity within it. It does not measure open-ended programming, behavior with production tools, or human time. Instructions and examples are part of agent access and can simplify tasks; the set was designed for teaching and may share patterns with pretraining data. Retain these limits alongside figures and do not attribute a difference to the model if the harness also changes.

Validity card: SWE-bench Verified

SWE-bench presents real issues from Python repositories and asks for a patch; the Verified variant selects reviewed tasks. The usual outcome measures whether the patch passes tests in the issue’s environment. Its construct is software issue resolution on that set of repositories and conditions, not all software engineering or production deployment.

We apply questions from the ABC checklist to that variant: task and access: are repository version, tools, and visible information fixed, and can a shortcut solve the case without the desired capability? Outcome: do tests cover requirements and edge cases, and can an incorrect patch pass? Reporting: are subset, harness, budget, costs, and execution failures published? Zhu and colleagues document incorrect patches passing insufficient tests in the studied version; in one seaborn case, missing-value tests did not cover every input combination. This is evidence of false-positive risk, not proof every accepted patch is incorrect or all later versions retain the defect. We did not run SWE-bench here: this card applies the checklist to published sources and does not attribute a public-benchmark audit to the in-house experiment.

In another audit published in 2026, OpenAI selected 138 problems o3 did not consistently solve and found material test or statement problems in 59.4%. That sample was selected for difficulty for that model: the percentage does not estimate the full-set rate. The report also documents contamination risk from prior exposure to public solutions and recommends discontinuing Verified for measuring frontier-model progress. Both warnings affect this card’s interpretation; they do not alone invalidate every task or earlier study.

By contrast, the in-house benchmark fixes a fresh temporary environment per attempt and the polynomial audit detected one shortcut, but coverage includes only three templates and the strengthened checker has limited grammar. A useful card retains both results alongside open questions rather than declaring a whole benchmark valid from one negative test.

Task, access, and measurement

Before running an agent, write down which state change or answer would solve the task. Separate that criterion from means the agent may use. In a database update, reading a row differs from modifying it, and a call without error does not guarantee the correct row changed. The checker must inspect relevant final state and any restrictions on collateral changes.

Negative tests help find incomplete criteria. An agent always returning the same answer, copying the request, or taking no action should fail when the task requires a new result. If one passes, investigate whether it found a legitimate solution or the test accepts something outside the objective. In the polynomial case, passing five known points is insufficient to prove identity across the grammar. The expression matching exactly those points exploits an overly narrow success definition. The strengthened checker closes that shortcut within its declared domain without proving other domains covered.

A held-out set can reduce direct fitting to visible examples but does not replace an outcome definition. If development and evaluation tasks share a template, shared structure may facilitate generalization within that template without demonstrating transfer to new tasks. Record what the agent can access, what designs prompts, and what is reserved for reporting. Changing a prompt to favor results after seeing them makes that part development rather than blind evaluation.

State reset is another measurable property. Two attempts in the same directory without restoration may benefit from files left by the first; conversely one can damage the next. The benchmark creates temporary environments per attempt and permits comparison from the same initial state. This improves interpretation of repetitions but does not imply independent infrastructure errors: they may share process, filesystem, or inference service. Recording incidents avoids confusing service failure with agent failure.

Trajectories and judges

Trajectory evaluation can count calls until task completion, tool errors, repetitions, and recovery after failure. Define events before measurement: a call returning zero results is not necessarily an error, and a later attempt is not recovery unless it leads to verifiable progress. Final success and partial credit answer different questions. Retain traces, versions, seeds, budget, and infrastructure errors to inspect discrepancies.

An agent as judge inspects a trajectory or artifacts and issues a judgment. Agent-as-a-Judge studies this on development tasks. Validate it against an independently annotated reference, report confusion matrix and disagreements, and separate judge errors from errors of the evaluated agent. Assistant annotation must be identified as such; it is not human annotation. The judge can share biases or information with the agent it evaluates.

For exploratory review of this benchmark, 50 published trajectories were selected with seed 2828 and assistant-annotated in five categories: success, final answer without useful action, invalid format, tool error, and unfinished observation. Selection and labels are in annotated50.py, linked to original attempts. The review yields 3, 15, 22, 9, and 1 cases respectively. These are not human annotations or an independent reference; few successes make agreement for that category especially unstable.

A local judge then ran Qwen2.5-7B-Instruct Q4_K_M, revision bb5d59e06d9551d752d08b292a50eb208b07ab1f, on CPU. The judge selected the event-reading tool for all 50 cases and also received checker success before classification. All 50 responses were valid and 18 matched assistant labels: 36% agreement, not accuracy against a human standard. All three successes matched, but all 15 cases labeled “final” were classified “tool,” as were 14 of 22 labeled “format.” The complete matrix and logs allow discrepancy inspection with the analyzer. Judge and reference may share biases; seeing checker results also makes successes easier to identify, so these data do not prove independent judging ability.

The matrix matters more than one percentage when categories have different frequencies. A judge almost always choosing a common class can agree often without distinguishing others. For each category count references of that class the judge recovers and predictions of that class matching the reference. These ratios describe available labels; exploratory or dependent labels do not become truth by calculation. Three success examples do not support a stable conclusion about success detection on other benchmarks.

When designing additional review, define categories and boundary examples before labeling: a final answer without useful action differs from a failing tool call, even if both leave the task unsolved. Two reviewers can annotate separately and document disagreements and reasons; shared adjudication is useful but must not be presented as a second independent observation. If one judge sees checker success and another does not, their inputs differ too: the contrast measures judge plus available information, not the model alone.

Judge tool access needs its own contract. It may need to read a long trace or inspect final state, but calls should be read-only when evaluation must preserve artifacts. Event selection, truncation, and order can affect classification. Retain complete structured output and a sample of discrepancies; counting only valid responses measures format, not judgment quality. Transport errors should be recorded separately from wrong judgments so the denominator remains interpretable.

Harness sensitivity means a score characterizes model and configuration: template, tools, messages, budget, observations, and stopping policy. Biderman et al. document reproducibility difficulties in model evaluation. Change one piece at a time and use the same tasks across compared conditions; report paired difference and cost. An interval does not correct a faulty checker or make toy tasks representative.

For example, one interface may require argument to be a string containing JSON; another may directly accept an object. Both represent the same operation but require different model outputs. If a variant succeeds more often, inspect how many responses were rejected for format and how many tools were chosen incorrectly. A more explicit prompt may reduce format errors without improving action selection, and a larger budget may allow corrections at the cost of calls. To distinguish effects, retain the reference condition per task and compare each change separately.

We ran the sensitivity protocol on the same 40 tasks under four conditions, 160 trajectories total. Qwen2.5-7B-Instruct GGUF Q4_K_M, revision bb5d59e06d9551d752d08b292a50eb208b07ab1f, was pinned on llama.cpp b9354 with 29 GPU layers, temperature zero, and up to 128 output tokens per call. The baseline uses three steps and write/database arguments serialized as JSON strings; the format variant accepts objects, the system variant adds a correction instruction, and the budget variant allows six steps. In all, read directly receives the filename. Each condition changes only the indicated aspect relative to baseline. The strengthened polynomial checker is used.

The baseline solved 15/40, object format 25/40, and both extra instruction and expanded budget 15/40. In paired results, object format gained ten tasks and lost none, a 25 percentage-point difference. Breakdown explains the figure: no condition solved the 15 files, all solved the 15 SQLite tasks, and only object format solved the ten repairs. A bootstrap of 2000 family and task resamples gives [0, 100] percentage points for that difference; only three families and repeated templates make the interval extremely unstable. The other contrasts were zero for every observed pair with degenerate bootstrap interval [0, 0], which does not prove no effect in another sample.

Mean input plus output cost over all calls was 433.7 tokens per trajectory for baseline, 410.6 for object format, 457.7 for instruction, and 809.9 for six steps; resent context tokens are counted again per call. Format or tool errors averaged 0.90, 0.63, 0.95, and 1.80 respectively. A valid call after error appeared in 14, 25, 12, and 13 trajectories; this signals only a later valid interaction, not successful task completion. Times were measured on shared resources and are not isolated latency. One deterministic trajectory per condition does not estimate seed variation or generalize to other benchmarks.

Download the 160 traces and summary; each trace retains actions, observations, errors, tokens, and first success step. To reproduce the campaign also download the harness, audit.py, protocol, and analyzer into one directory. With that model’s local server on port 11441, run python sensitivity.py --output sensibilidad.jsonl --port 11441 and then python analyze_sensitivity.py sensibilidad.jsonl. The two GGUF shards had SHA-256 dfce12e3862a5283ccfb88221b48480e58745165de856439950d0f22590580db and 539cf93f78e887edea1c04e2d7d8cdaca9d01dae9c9025bcb8accbe29df3d72a. The first four-trajectory pilot found ambiguity in the read instruction; the contract was corrected before the 160 runs and the pilot is excluded from these figures.

Tasks versus attempts

Sources of variance in agent evaluation include differences between tasks, generation seeds, simulated user responses, environment variation, and infrastructure. With nn independent tasks, kk independent attempts conditional on each task, between-task variance σb2\sigma_b^2, and mean within-task variance σw2\sigma_w^2, the mean has variance

Var⁡(Xˉ)=σb2+σw2/kn.\operatorname{Var}(\bar X)=\frac{\sigma_b^2+\sigma_w^2/k}{n}.

The law of total variance separates each task mean from attempt noise. Increasing kk reduces the second term but not the first. If budget is C=n(c0+kc1)C=n(c_0+kc_1), with fixed cost c0c_0 per task and c1c_1 per attempt, minimizing this variance over continuous kk gives k∗=c0σw2/(c1σb2)k^*=\sqrt{c_0\sigma_w^2/(c_1\sigma_b^2)} when variances and costs are positive. In practice round and require at least one attempt. Shared families require an additional grouping unit.

To see where the rule comes from, substitute n=C/(c0+kc1)n=C/(c_0+kc_1) in the variance. Apart from constant factor 1/C1/C, this gives (c0+kc1)(σb2+σw2/k)(c_0+kc_1)(\sigma_b^2+\sigma_w^2/k). Terms depending on kk are kc1σb2+c0σw2/kkc_1\sigma_b^2+c_0\sigma_w^2/k. Setting their derivative to zero yields the indicated root; the second derivative is positive when parameters are positive. This is not a universal constant: changing the task population or task setup price changes optimal allocation.

For example, with c0=4c_0=4, c1=1c_1=1, and equal variances, the continuous optimum is two attempts per task. If fixed cost drops to one with all else unchanged, the continuous optimum drops to one: under that cost model broader task coverage is preferable. These figures are hypothetical and assume each new task comes from the target population, variances are known, and each attempt costs the same. With an integer budget compare nearby feasible allocations and consider that some tasks or attempts take longer.

Running two agents on the same tasks permits within-task difference analysis. However, the same numerical seed does not guarantee equivalent responses if models consume randomness differently. The relevant pair is usually task and condition, with attempts and seeds documented. If one condition has more time or calls, its result also reflects that budget. Choosing in advance whether to match maximum steps, tokens, time, or monetary cost avoids calling budgets equal when they match only one dimension.

The formula assumes known variances to explain allocation. In a real study estimate them, for example using a pilot sample with several tasks and repetitions. Estimates can be very unstable with few tasks or identical outcomes across all attempts in one family. Record an allocation chosen from the pilot and do not interpret it as optimal for every other population. If the same data choose the design and evaluate the result, state that dependence.

The mean also depends on task weighting. Equal weight for each of 40 instances gives more weight to the two families with 15 cases than the family with ten. Equal family weights answer another question and change the estimand. Neither choice automatically makes three templates representative of all agent tasks. Before calculating an interval, state the unit to generalize and weights applied.

InteractiveMore tasks or more attempts

Variance of the mean = (between-task variance + within-task variance / k) / n. Width is 3.92 times its square root under a normal approximation and known variances.

This calculation ignores uncertainty in estimated variances, shared families, and proportion bounds. Comparing budgets requires including task-preparation and attempt costs.

40
3
0.12
0.16
Variance of the mean0.0043
Approximate 95% normal width0.258
Total attempts120
Adjust tasks, attempts, and variance components. Displayed width is a normal approximation with known parameters, not a benchmark measurement.

The 50% horizon

The 50% time horizon is the human duration associated with fitted success probability 0.5 for the studied task distribution and protocol. Kwa et al. use durations from people with relevant experience, not model execution times. An evaluator’s imagined duration must not be presented as human measurement. With p(t)=σ(a−blog⁡2t)p(t)=\sigmoid(a-b\log_2 t) and b>0b>0, the horizon is t50=2a/bt_{50}=2^{a/b}. Slope and logistic relationship are fitting assumptions; a curve with few long points may extrapolate far beyond observations.

InteractiveThe horizon depends on tasks

The lower band shows the horizon interval, clipped to the visible axis. It discards resamples without a finite fit or with non-decreasing slope; the discarded proportion signals instability. The horizon may lie outside the observed range.

50% horizon (min)11.31
95% conditional bootstrap< 0.01 to 3077.46
Retained decreasing fits147 / 200
Change or exclude synthetic observations and inspect the fit. The figure does not represent agents or real human durations; it discards resamples without a finite fit or decreasing slope and shows how many were retained.

A hierarchical bootstrap resamples tasks and, within each selected task, attempts. If tasks belong to correlated families, grouping may need another layer. With perfect separation, all successes fall on one side and failures on the other, so logistic maximum likelihood may not be finite. Explicitly discard or handle such fits and report their frequency: an interval computed only from convergent fits is conditional, not a coverage guarantee.

The 50% threshold is obtained by solving the model equation, not finding a particular trajectory’s duration. If bb approaches zero, small coefficient changes can move a/ba/b and thus the horizon substantially. When the threshold lies outside the observed duration range, the logistic form is extrapolated; a visually smooth curve adds no data there. Show observed points or groups, duration range, and fitting conditions.

Durations also define the estimand. A two-minute task for someone familiar with the tools may take longer for another; measurement protocol, population, and experience matter. This lab’s subjective estimates explore calculation sensitivity, not the distribution of human times. Uniform rescaling can shift a finite horizon by the same factor, but does not fix absence of an identifiable fit. The difficulty here is not choosing minutes or seconds: separation prevents a finite maximum from observed data.

Regularization or a prior distribution can yield finite coefficients even with separation. This adds assumptions: result and uncertainty may depend on regularization strength or chosen prior. If using that alternative, report those parameters and reasonable sensitivity rather than presenting the number as determined by data alone. This lesson retains the diagnosis without adding a regularized horizon that might appear to be an empirical measurement.

We applied this check to the 400 attempts published in the previous lesson, five per task and adapter. To illustrate the procedure, the author assigned subjective estimates, not human measurements: 4 minutes to sort a file, 2 for SQLite update, and 8 to repair a function. Under those assumptions all observed successes for both agents are in the shortest SQLite family; it also contains failures and other families have no successes. Separation is quasi-complete and logistic maximum likelihood is not finite. No identifiable finite fit appeared in 1000 hierarchical resamples per agent. Multiplying all three durations by 0.5 or 2 preserves separation. No meaningful horizon or interval can be reported with this fit and data, nor compared with another study’s human measurements.

To inspect the full fit download horizon.py and agent-runs.json into one directory. With NumPy and SciPy installed, python horizon.py checks separation before optimization and records how many resamples have a decreasing slope and identifiable fit. Duration estimates are declared in code and can vary; result sensitivity is part of reporting.

The cell reproduces the diagnosis from published per-task successes. Binary attempts within each task are resampled with replacement; a binomial with probability equal to observed fraction gives the same distribution as resampling its five values. Variants share only three templates and assigned durations, so neither this uncertainty nor the hypothetical scale supports generalization to real tasks.

[ ]Hierarchical diagnosis with m23-l27 attemptsBrowser
import numpy as np

react_db = [0,0,0,1,0,0,0,0,0,0,0,0,0,1,0]
single_db = [2,1,0,0,1,1,3,1,1,0,1,2,0,1,1]
durations = np.array([4]*15 + [2]*15 + [8]*10, dtype=float)

def estimable(times, successes, trials):
    positive = times[successes > 0]
    negative = times[successes < trials]
    if not len(positive) or not len(negative):
        return False
    # Separación completa o cuasicompleta en una covariable.
    return not (positive.max() <= negative.min() or negative.max() <= positive.min())

rng = np.random.default_rng(28)
for name, db in [('ReAct', react_db), ('una llamada', single_db)]:
    counts = np.array([0]*15 + db + [0]*10)
    indices = rng.integers(0, 40, size=(1000, 40))
    sampled = rng.binomial(5, counts[indices] / 5)
    valid = sum(estimable(durations[ind], row, np.full(40, 5))
                for ind, row in zip(indices, sampled))
    print(name, 'aciertos:', int(counts.sum()), '/200; ajuste estimable:',
          estimable(durations, counts, np.full(40, 5)), '; remuestras estimables:', valid, '/1000')
[ ]Horizon for known parametersBrowser
a, b = 4.0, 0.8
horizonte = 2 ** (a / b)
print('horizonte al 50 %:', horizonte, 'minutos')

Exercises

Numeric
If p(t)=sigmoid(4 − 0.8 log₂(t)) and t is in minutes, calculate the 50% horizon.
Proof
Prove: With n independent tasks and k independent attempts conditional on each task, the variance of the mean is (σ_b² + σ_w²/k)/n.
0
Let μ_i be task i’s mean with variance σ_b², and assume mean residual variance σ_w² per attempt.

Step 1 of 3. What is the variance of the mean of k attempts conditional on a task?

Quiz
Two reports give 45% and 52% for the same model. What do you need to interpret the difference?
Quiz
The fit uses few long tasks and its horizon falls outside the observed range. What conclusion is justified?
Code
Implement null_agent_audit(tasks, run_fn, null_agents). Each task has an id; null_agents maps names to agents; run_fn(task, agent) returns True or False, or None for infrastructure failure. Return a dictionary mapping task id to sorted accepted names, only for tasks with at least one acceptance. Raise RuntimeError on None: do not count infrastructure failure as agent failure.
def null_agent_audit(tasks, run_fn, null_agents):
  pass
Shift+Enter to run

Summary

Key idea
Evaluation requires an audited checker, a described harness, and uncertainty respecting task grouping; a logistic horizon does not replace those conditions.