Evaluation Harnesses and Reproducibility › Uncertainty with the Task as the Sampling Unit
Language AI HandbookAll chapters When the target is an expectation over independently sampled tasks, each task is one sample. Repeated calls can reduce uncertainty about a given task. They do not increase the number of sampled tasks. The eight-item local fixture is a fixed demonstration; the coverage experiment uses a separate synthetic population.
A concrete analogy helps. Suppose you want to know the average height of adults in a city. You can measure each person in your sample more precisely by measuring them twice and averaging, but that does not tell you any more about the city than measuring them once did; the precision of your individual measurements improves, but your knowledge of the population is limited by how many distinct people you measured. Running more model calls per task is measuring the same person twice. Drawing a bigger benchmark is measuring more people. Only the latter reduces task-level uncertainty.
For a binary-correctness benchmark, the natural estimator is the fraction correct (the number of graded tasks answered correctly divided by the total number of graded tasks). Under task-level Bernoulli sampling, where each task is an independent draw with success probability , the standard error of that fraction is
where:
- : the observed accuracy, that is, the fraction of graded tasks the model answered correctly
- : the number of graded tasks (the sampling unit, not the number of model calls)
- : the estimated standard error of under task-level Bernoulli sampling
The Wald normal approximation uses for a nominal 95% interval. For independent binary tasks, Wilson generally has better coverage near the boundaries or with small samples. A Clopper–Pearson interval gives conservative binomial coverage. Task-level bootstrapping can estimate uncertainty for other statistics when resampling tasks mirrors the sampling design. The percentile helper below accepts binary scores and can collapse to a point when every observed score matches.
The single most important number to not do: divide the standard error by the number of model calls. If you sample responses per task and average them, the call-level standard error shrinks by roughly , but that is the error of estimating that task's per-call success rate, not the error of estimating the model's performance on the task population. The task population is what the benchmark claims to represent, so it is what the interval must reflect.
Compute sample intervals for the local records. The coverage experiment below uses independent Bernoulli draws with a stated probability. That simulation is separate from the curated task fixture and its configured mock probabilities.
PythonIn [23]Expand
def binary_scores(scores):
values = np.asarray(scores, dtype=float)
if (
values.ndim != 1
or not len(values)
or not np.isin(values, (0.0, 1.0)).all()
):
raise ValueError("Expected a nonempty vector of binary task scores.")
return values
def proportion_ci_wald(scores, alpha=0.05):
values = binary_scores(scores)
p = float(values.mean())
z = NormalDist().inv_cdf(1 - alpha / 2)
half = z * math.sqrt(p * (1 - p) / len(values))
return max(0.0, p - half), min(1.0, p + half), p
def proportion_ci_wilson(scores, alpha=0.05):
values = binary_scores(scores)
p, n = float(values.mean()), len(values)
z = NormalDist().inv_cdf(1 - alpha / 2)
denom = 1 + z * z / n
center = (p + z * z / (2 * n)) / denom
half = z / denom * math.sqrt(p * (1 - p) / n + z * z / (4 * n * n))
return max(0.0, center - half), min(1.0, center + half), p
def bootstrap_ci(scores, B=2000, alpha=0.05, rng=None):
values = binary_scores(scores)
rng = rng if rng is not None else np.random.default_rng(0)
if B < 1:
raise ValueError("Bootstrap needs at least one resample.")
draws = rng.choice(values, size=(B, len(values)), replace=True).mean(axis=1)
lo, hi = np.quantile(draws, [alpha / 2, 1 - alpha / 2])
return float(lo), float(hi), float(values.mean())Let's compute the intervals for model A on our fixture.
PythonIn [24]Expand
def interval_report(scores, label):
wl, wh, p = proportion_ci_wald(scores)
sl, sh, _ = proportion_ci_wilson(scores)
bl, bh, _ = bootstrap_ci(scores, B=4000, rng=np.random.default_rng(0))
return {
"label": label,
"n": len(scores),
"p": p,
"wald": (wl, wh),
"wilson": (sl, sh),
"bootstrap": (bl, bh),
}
rep_a = interval_report(scores_a, "A")
rep_b = interval_report(scores_b, "B")ConsoleOut [25]Expand
Model A n=7 p=0.714 Wald 95%: [0.380, 1.000] Wilson 95%: [0.359, 0.918] Bootstrap95%: [0.429, 1.000] Model B n=7 p=0.857 Wald 95%: [0.598, 1.000] Wilson 95%: [0.487, 0.974] Bootstrap95%: [0.571, 1.000]
The three methods return visibly different bounds for the same seven tasks. Use the method specified for the study design and document it in the report. For independent Bernoulli tasks with a small sample, Wilson or an exact binomial interval is preferable to the ordinary percentile bootstrap. For example, at the probability of observing seven successes is . Every resample from those seven ones is also all successes, so the interval misses the true value in that entire event.
Coverage: Do the Intervals Mean What They Say?
Coverage is the fraction of repeated experiments whose interval includes the known parameter. Generate independent binary tasks with probability 0.72 in each simulated run. Compare the observed Wilson coverage with its nominal level; finite sample size and Monte Carlo error can both affect the comparison.
The number that comes out of this experiment, the coverage rate, is the interval's track record. A nominal 95% interval that covers the truth 95% of the time is calibrated; one that covers 80% of the time is overconfident and will mislead anyone who relies on it. Coverage is the property that makes a confidence interval more than a decorative annotation.
PythonIn [26]Expand
def simulate_runs(capability, n_items, n_runs, base_seed=1000):
rng = np.random.default_rng(base_seed)
return rng.binomial(1, capability, size=(n_runs, n_items))
true_p = 0.72
sim_runs = simulate_runs(true_p, n_items=len(scores_a), n_runs=3000)
coverage = np.mean(
[lo <= true_p <= hi for lo, hi, _ in map(proportion_ci_wilson, sim_runs)]
)ConsoleOut [27]Expand
Observed Wilson 95% interval coverage over 3000 synthetic runs: 0.980 Tasks per simulated run: 7
The simulated result applies to this number of independently generated tasks and this success probability. It does not certify coverage for a curated test set, for dependent tasks, or for other population assumptions.
What Changes When Calls Repeat
To see the call-level trap concretely: suppose we call the model three times per item and average. The call-level standard error treats each of the calls as an independent trial:
where:
- : the observed accuracy over tasks
- : the number of graded tasks
- : the number of calls per task (here ), so is the total call count
- : the estimated standard error if calls were the sampling unit
If the extra calls are identical copies of the same outcome, the naive standard error shrinks by the square root of the copy count while the task-level standard error stays fixed. More generally, fresh repeated calls can reduce within-task variation without creating new independent tasks. The simulation deliberately uses identical copies to isolate the error.
The practical consequence is easy to state and hard to overstate: if you report a call-level interval, you will routinely claim precision you do not have, and your "significant improvement" may be an artifact of having averaged noise on too few tasks. An interval that under-covers is worse than no interval, because it looks rigorous while being wrong.
PythonIn [28]Expand
def call_level_coverage(capability, n_items, n_calls, n_runs, base_seed=2000):
rng = np.random.default_rng(base_seed)
task_outcomes = rng.binomial(1, capability, size=(n_runs, n_items))
task_coverage, naive_coverage = [], []
for run in task_outcomes:
lo, hi, _ = proportion_ci_wilson(run)
task_coverage.append(lo <= capability <= hi)
repeats = np.repeat(run, n_calls)
lo, hi, _ = proportion_ci_wilson(repeats)
naive_coverage.append(lo <= capability <= hi)
return float(np.mean(task_coverage)), float(np.mean(naive_coverage))
cov_task, cov_call = call_level_coverage(
true_p, n_items=40, n_calls=3, n_runs=3000
)The figure uses a fixed Bernoulli population probability of 0.72 and 40 independent tasks. Counting each outcome k times as though the copies were independent shrinks the naive normal half-width by a factor of . The task-level width stays fixed because the copied outcomes add no independent information.
PythonIn [29]Expand
_n_tasks_for_width = 40
_z_width = NormalDist().inv_cdf(0.975)
_calls_grid = [1, 2, 3, 5, 10, 20]
_se_task = math.sqrt(true_p * (1 - true_p) / _n_tasks_for_width)
_se_by_calls = [(k, _z_width * _se_task / math.sqrt(k)) for k in _calls_grid]
_se_task_anchor = _z_width * _se_taskVisualizationOut [30]Expand

ConsoleOut [31]Expand
Task-level coverage with 40 independent outcomes per run: 0.940 Naive coverage when each outcome is counted three times: 0.780
The experiment compares the same Wilson procedure applied once per independent task and after counting each outcome three times. Repeating the same outcomes changes the denominator while adding no independent information. If several tasks come from one shared scenario, consider that scenario when defining the independent unit.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!