Evaluation Harnesses and Reproducibility
Build a versioned evaluation harness that pins prompts, graders, and configs. Measure replay agreement, task-level uncertainty, and paired model differences.
Language AI HandbookAll chapters Evaluation Harnesses and Reproducibility
Two evaluations can use the same model and get different scores because they use different prompts, graders, or task versions. To explain the change, retain what each run received, what it returned, and how those responses were scored.
An exact-string grader can distinguish 2/3 from 0.67 even when a task permits a rounded equivalent. Keep the reference and grader revision so the next reviewer can explain such a discrepancy.
An evaluation harness assembles the inputs, runs the evaluation, and archives the outputs and reporting choices. We will build one around a small local fixture, then check repeatability and compare two mock systems on shared tasks.
The previous chapter covered live and continuously refreshed benchmarks, where the evaluation data keeps changing. This chapter covers the complementary problem: even with fixed data, the procedure must be pinned down. Building on Evaluation Fundamentals and Evaluation Challenges, we will construct a small but complete harness from scratch, then use it to confront three things that trip up most teams:
- A seed is not a guarantee of identical execution.
- For population performance over independent tasks, use the task as the sampling unit.
- On shared items, compare per-task differences to account for paired outcomes.
We will also see why confidence intervals must be computed over the right sampling unit, and why leaderboard tables that report a single number invite misreading. Along the way we foreshadow the judge calibration problems that the upcoming Judge Calibration and Meta-Evaluation chapter treats in depth, and the governance questions that Evaluation Governance takes up later.
What a Harness Has to Pin Down
Record the inputs and rules that determined the score. The checklist below covers what this chapter’s local harness records.
The Seven Versioned Surfaces
The fixture separates seven parts of the evaluation record. Each part can matter when rerunning or comparing scores.
- Dataset snapshot. The exact items, in the exact order, with a content digest. Pin the dataset bytes and item order. A mutable URL or tag alone cannot identify the snapshot. Item order matters more than people expect, because harnesses that shuffle, truncate, or batch items can behave differently depending on the order in which items arrive, and because some statistical procedures (like early stopping on a stream of items) are order-sensitive by design.
- Prompt template. The system message, the instruction, the few-shot exemplars, the answer-format constraints, and the exact whitespace and delimiters. Prompt wording changes behavior measurably; the Evaluation Prompt Engineering chapter showed how much. A stored template artifact makes those bytes auditable, including when the template originated in code. This includes the boring parts: a trailing newline, a capitalization change, or a swapped delimiter between the question and the answer format can all move a score, and none of them will show up in a diff of a config that only records "the prompt."
- Model identity and settings. The model name, the exact checkpoint or revision, temperature, top-p, max tokens, stop sequences, penalties when used, and any seed parameter. "GPT-class model, defaults" is not a specification. Defaults in particular are a trap: they are provider-defined, can change between API versions, and are usually not documented at the granularity an evaluation needs. If you rely on a default, you are outsourcing part of your specification to a vendor you cannot audit.
- Grader. The code or model that turns a raw response into a score, plus its version. A regex change is a grader change. A change to a judge prompt is a grader change. A change to the judge model is a grader change. Graders are the surface most often forgotten and most often responsible for silent drift, because grader code frequently lives in a helper module that nobody thinks of as part of the evaluation.
- Harness code. The orchestration logic: how prompts are assembled, how responses are parsed, how retries and truncation are handled, how items are batched. A parsing change can alter the measured score without changing model outputs. Truncation policy is a subtle case: if a response exceeds
max_tokens, does the harness score whatever was produced, retry with a larger budget, or drop the item? Choose and record the policy. For an affected item, these choices can change its score or whether it enters the denominator. - Environment. Library versions, the tokenizer version, the inference engine and its build, the hardware. Tokenization differences alone can change scores (Tokenization Challenges). A tokenizer revision that splits a number into different subword units can change how a model completes a numeric answer, without any change to the model weights.
- Reporting convention. What a "score" is (accuracy over items? mean over seeds?), what uncertainty is reported (none? standard error? bootstrap interval?), and what the sampling unit is. Two teams can compute the same per-item scores and still report incompatible headline numbers because one averages over seeds and the other pools items, or because one reports a standard error and the other a full interval.
Record the exact bytes where you can. When a service exposes only a model or backend identifier, retain it alongside the request and compare output behavior on repeat runs.
An evaluation harness is the versioned, executable bundle of a dataset snapshot, prompt template(s), model configuration, grader, orchestration code, environment specification, and reporting convention, together with the code that executes the bundle and archives its outputs. "Harness" refers to both the specification and the runner; the point is that they travel together and are archived together.
Why Digests, Not Version Strings
Teams naturally reach for version strings: prompt: "v3", grader: "v2". Version strings are necessary for humans but insufficient for machines, because a version string can be reassigned, mis-copied, or silently diverge between the config file and the code. A content digest is computed over canonicalized bytes. Anyone with a trusted expected SHA-256 digest can recompute it and compare the two values.
A SHA-256 mismatch proves the canonical bytes differ. A match is evidence that they agree, assuming SHA-256 remains collision-resistant and the expected digest came from a trusted source. This catches a changed template even when the human version label stays at v3.
A run manifest lists input identities, so readers can compare the declared settings. If results differ under the same manifest, the execution may use stochastic draws or depend on state the manifest does not record. Testing repeated execution is how you find that difference.
The Seed Is Not the Guarantee
A seed controls the random draws it is wired to. Other runtime changes can still affect execution. Record the changes you can observe and use a replay check to measure what repeats.
- Sampling nondeterminism at the model. When temperature is greater than zero, the model samples. A seed may be accepted by the API or framework, but seeds are not a portable contract. Providers change sampling implementations, batch sizes, and kernels; the same seed can yield different tokens across model revisions or even across replicas of the same model. For hosted APIs, treat the seed as a best-effort hint, never a guarantee.
- Numeric differences. Floating-point reductions can depend on operation order. Runtime kernels and batch layout can change that order. If two logits are close enough, a numeric change can alter a greedy choice.
- Batch layout. Changes to execution batches can change runtime behavior. Record the serving and batching settings when an evaluation depends on them.
- Grader variation. An LLM judge can sample responses or vary across execution environments. You can repeat judgments on the same stored responses to measure this variation separately. A fixed regex policy is deterministic for a given input.
A replay audit reruns the same tasks and compares their output bytes. State which settings you held fixed. Report that agreement separately from task-level uncertainty; byte-level disagreement and score variation measure different things.
A Local, Versioned Fixture
To make all of this concrete and runnable without network access or API keys, we build a completely local fixture. It has three parts:
- A tiny task dataset of math word problems with a deterministic reference answer. Each item is a task instance.
- A local mock model that answers correctly with a per-item probability determined by its "capability," and otherwise returns a plausible but wrong answer. The fixture uses a deterministic hash draw for each task. The two models share the draw for paired comparison.
- A grader that parses a final numeric answer and compares it to the reference, with a version string.
The mock demonstrates the runner and archive. Its specified success probabilities let us compare the observed scores with known inputs. The later coverage experiment independently samples binary outcomes under a stated population model.
Let's set up the environment and plotting style.
PythonIn [2]Expand
import hashlib
import json
import math
import platform
import re
from dataclasses import asdict, dataclass
from decimal import Decimal, InvalidOperation
from pathlib import Path
from statistics import NormalDist
from tempfile import TemporaryDirectory
import numpy as np
bundle_workspace = TemporaryDirectory(prefix="eval-harness-")
ARTIFACT_DIR = Path(bundle_workspace.name)The hidden setup seeds the book plot helpers. The fixture controls its random draws independently through task IDs and defined random generators.
The Dataset and Its Digest
Each item has an id, a natural-language question, and a canonical answer string. We keep the items in a list; the dataset digest is the SHA-256 of the JSON serialization of the list in a fixed key order. Any edit to any item changes the digest. Canonicalization matters here: JSON serialization is not unique across libraries and key orderings, so we force a sorted-key, compact representation so that two machines serializing the same logical object produce the same bytes, and therefore the same digest.
PythonIn [4]Expand
def canonical_bytes(obj) -> bytes:
"""Serialize an object to bytes in a stable, key-sorted form."""
return json.dumps(
obj, sort_keys=True, separators=(",", ":"), ensure_ascii=False
).encode("utf-8")
def digest(obj) -> str:
"""SHA-256 hex digest of the canonical serialization of obj."""
return hashlib.sha256(canonical_bytes(obj)).hexdigest()
# A tiny math-word-problem dataset. The reference answer is the exact
# string a correct response should contain after '####'.
dataset = [
{
"id": "m01",
"question": "Natalia sold 48 clips in April and half that in May. How many did she sell total?",
"answer": "72",
},
{
"id": "m02",
"question": "A robe takes 2 bolts of blue and half that of white. How many bolts total?",
"answer": "3",
},
{
"id": "m03",
"question": "Weng earns $12/hour for 50 minutes. How much does she earn?",
"answer": "10",
},
{
"id": "m04",
"question": "Betty picked 8 apples, then 3 more, then half the total. How many now?",
"answer": "?",
},
{
"id": "m05",
"question": "A train travels 60 km/h for 2.5 hours. How far does it go?",
"answer": "150",
},
{
"id": "m06",
"question": "There are 5 dozen eggs, 3 are used. How many remain?",
"answer": "57",
},
{
"id": "m07",
"question": "James buys 4 books at $5 each and pays with a $50 bill. Change?",
"answer": "30",
},
{
"id": "m08",
"question": "A recipe needs 3/4 cup sugar per batch for 2 batches. Total cups?",
"answer": "1.5",
},
]
dataset_digest = digest(dataset)ConsoleOut [5]Expand
Items: 8 Dataset digest: 531d7cc553482833...
The digest is a short fingerprint of the exact dataset bytes. If we later append a question, fix a typo in m04, or reorder items, this hex string changes. Notice that m04 has a deliberately broken reference ("?") to remind us that bad fixture data is itself a reproducibility hazard: the harness should flag items whose reference cannot be parsed, and we will see this in the grader audit.
That deliberate bug is worth dwelling on, because it models a failure that happens constantly in real benchmarks. A reference answer that "looks fine" to a human can be unparseable to a grader, or parse to something subtly different from what the item author intended. If the harness silently scores such an item as wrong, you get a slightly deflated accuracy that nobody can explain, and the model gets blamed for a data bug. The fix is not cleverness; it is making the grader report the condition so that it is visible in the aggregate report.
The Prompt Template as a Versioned Artifact
The prompt template is a real object with a name, a version, and a digest. It assembles the system instruction and the per-item question. We deliberately include an answer-format constraint (#### <answer>) so the grader can parse reliably: this follows the final-answer marker used in the GSM8K dataset and matters because grader fragility is a leading source of irreproducibility. The constraint is not a formality; it is a contract between the prompt and the grader. If the prompt stops enforcing the format, the grader starts failing to parse, and the score moves for a reason that has nothing to do with the model's reasoning.
PythonIn [6]Expand
@dataclass(frozen=True)
class PromptTemplate:
name: str
version: str
system: str
user_template: str # must contain '{question}'
def render(self, question: str) -> list[dict]:
"""Return chat-format messages for one item."""
return [
{"role": "system", "content": self.system},
{
"role": "user",
"content": self.user_template.format(question=question),
},
]
def template_digest(self) -> str:
"""Digest over just the template content (what versioning must pin)."""
return digest({"system": self.system, "user": self.user_template})
prompt = PromptTemplate(
name="math_cot_v1",
version="1.0.0",
system=(
"Solve the problem step by step. "
"End your final line with '#### ' followed by the numeric answer only."
),
user_template="{question}",
)
prompt_digest = prompt.template_digest()We give the template both a semantic version and a content digest. The version is for humans reading the changelog; the digest is the contract. If someone edits the system message but forgets to bump the version, the digest still catches the change, which is the whole point. Conversely, if someone bumps the version but changes nothing, the digest stays the same, which tells you the "change" was cosmetic.
Model Configuration: What Must Be Pinned
The model configuration is the most commonly under-specified surface in published evaluation. A ModelConfig should record every field that affects outputs. For a local model this includes the tokenizer revision and inference engine; for a hosted model it includes the provider, the API model identifier, and any provider-side "revision" pin if available. Even fields that currently do nothing, like seed, should be recorded so that a downstream change in provider behavior is visible in diffs.
Record the options you sent even if the runtime does not expose how it applies each option. A provider revision or configuration change is a separate fact.
PythonIn [7]Expand
@dataclass(frozen=True)
class ModelConfig:
name: str
revision: str # checkpoint / provider revision, not 'latest'
temperature: float
top_p: float
max_tokens: int
stop: tuple[str, ...]
seed: int | None # best-effort; never the sole reproducibility claim
def config_digest(self) -> str:
return digest(asdict(self))
model_a_cfg = ModelConfig(
name="mock-math-small",
revision="ckpt-2025-11-01",
temperature=0.7,
top_p=1.0,
max_tokens=256,
stop=("</solution>",),
seed=1272,
)
model_b_cfg = ModelConfig(
name="mock-math-large",
revision="ckpt-2025-11-01",
temperature=0.7,
top_p=1.0,
max_tokens=256,
stop=("</solution>",),
seed=1272,
)
model_a_digest = model_a_cfg.config_digest()
model_b_digest = model_b_cfg.config_digest()The mock systems share their decoding settings and a seed chosen to show a discordant task in the worked example. The controlled change is their fixture capability and model identity.
The Mock Model and Its Capability
The mock hashes the seed, task ID, temperature, and backend identity. It uses that value to choose a correct or a deliberately different response. Temperature lowers the synthetic success probability by 0.12 times temperature, clipped to the unit interval. The mock receives the rendered messages so the harness can archive them; this mock’s score does not depend on the prompt wording.
The keyed draw assigns the same value to a task when the seed, task ID, temperature and backend identity remain fixed. Reordering the tasks or running a subset leaves that value unchanged. A sequential pseudorandom stream can also simulate independent draws. The coverage experiments specify independence of sampled tasks directly.
PythonIn [8]Expand
@dataclass(frozen=True)
class MockModel:
cfg: ModelConfig
capability: float
def success_probability(self, temperature):
return max(0.0, min(1.0, self.capability - 0.12 * temperature))
def generate(
self, messages, item, temperature, backend_revision="mock-backend-1"
):
# Shared seeds and item IDs couple model outcomes for this fixture.
key = (self.cfg.seed, item["id"], temperature, backend_revision)
prefix = hashlib.sha256(canonical_bytes(key)).digest()[:8]
roll = (int.from_bytes(prefix, "big") >> 11) / 2**53
reference = item["answer"]
wrong = next(
x for x in ("-99999", "-99998") if numeric(x) != numeric(reference)
)
selected = (
reference if roll < self.success_probability(temperature) else wrong
)
return f"#### {selected}"
model_a = MockModel(cfg=model_a_cfg, capability=0.72)
model_b = MockModel(cfg=model_b_cfg, capability=0.80)The two specified mock capabilities are 0.72 and 0.80 at zero temperature. At temperature 0.7 the intended probabilities are 0.636 and 0.716. The mock uses the same draw for both models under equal settings, so their outcomes on one task can be correlated by construction.
The Grader as a Versioned Artifact
The fixture grader accepts one finite decimal number after #### on the last nonempty line. It flags an invalid reference independently of a malformed response, and compares parsed values as exact decimals.
PythonIn [9]Expand
NUMERIC_PATTERN = r"[+-]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)"
def numeric(text):
text = text.strip()
if not re.fullmatch(NUMERIC_PATTERN, text):
return None
try:
return Decimal(text)
except InvalidOperation:
return None
@dataclass(frozen=True)
class RegexNumericGrader:
version: str
answer_marker: str = "####"
def policy(self):
return {
"version": self.version,
"marker": self.answer_marker,
"numeric_pattern": NUMERIC_PATTERN,
"scope": "last_nonempty_line",
}
def policy_digest(self):
return digest(self.policy())
def _extract(self, response):
lines = response.strip().splitlines()
if not lines or not lines[-1].startswith(self.answer_marker):
return None
candidate = lines[-1][len(self.answer_marker) :].strip()
return candidate if numeric(candidate) is not None else None
def grade(self, response, reference):
expected = numeric(reference)
if expected is None:
return 0.0, "bad_reference"
extracted = self._extract(response)
if extracted is None:
return 0.0, "unparseable_response"
return float(numeric(extracted) == expected), "graded"
grader = RegexNumericGrader(version="1.0.0")
grader_digest = grader.policy_digest()The grader returns a score and a status. A malformed response counts as incorrect under the fixture policy. An invalid reference is excluded from accuracy and reported as a dataset problem. A well-formed incorrect answer and a malformed answer remain distinguishable in the raw records.
The Run Manifest
The run manifest records the task, prompt, model, grader, harness policy and runtime identities used for this fixture.
The manifest’s digest identifies the recorded configuration. Two attempts can share that configuration and produce different results if a model samples or execution state was not captured.
PythonIn [10]Expand
RUN_POLICY = {
"retries": 0,
"batching": "one item",
"response_parse_error": "score zero",
"bad_reference": "exclude before reporting",
"report": "accuracy and 95% Wilson interval",
}
@dataclass(frozen=True)
class RunManifest:
dataset_digest: str
prompt_name: str
prompt_version: str
prompt_digest: str
model_name: str
model_revision: str
model_digest: str
mock_capability: float
grader_version: str
grader_digest: str
harness_policy_digest: str
backend_revision: str
python_version: str
numpy_version: str
@classmethod
def build(
cls, dataset, prompt, model, grader, backend_revision="mock-backend-1"
):
cfg = model.cfg
return cls(
dataset_digest=digest(dataset),
prompt_name=prompt.name,
prompt_version=prompt.version,
prompt_digest=prompt.template_digest(),
model_name=cfg.name,
model_revision=cfg.revision,
model_digest=cfg.config_digest(),
mock_capability=model.capability,
grader_version=grader.version,
grader_digest=grader.policy_digest(),
harness_policy_digest=digest(RUN_POLICY),
backend_revision=backend_revision,
python_version=platform.python_version(),
numpy_version=np.__version__,
)
def manifest_digest(self):
return digest(asdict(self))
manifest_a = RunManifest.build(dataset, prompt, model_a, grader)
manifest_b = RunManifest.build(dataset, prompt, model_b, grader)ConsoleOut [11]Expand
Run A manifest digest: 7f1151443fcc36468f68e814 ... Run B manifest digest: 3488e58bf9e4a8744fb10ad4 ... Shared evaluation inputs match: True
The two manifest identities differ because the model name and mock capability differ. The dataset, prompt content, grader policy, harness policy and backend identity match. The fixture hashes its policy description. A real experiment can additionally bind the running code revision and dependency artifact bytes.
Executing a Run and Recording Artifacts
For each task, archive its ID, rendered messages, raw response, extracted answer, reference, score and status. The fixture rejects duplicate IDs before execution. Preserve raw inputs and outputs only under appropriate access and retention settings.
Retaining raw responses lets a later grader score the same outputs. Keep the original scores too so you can compare the two decisions.
PythonIn [12]Expand
@dataclass(frozen=True)
class ItemRecord:
item_id: str
messages: list[dict]
response: str
extracted: str | None
reference: str
score: float
status: str
def run_eval(
model, prompt, grader, temperature, items, backend_revision="mock-backend-1"
):
if len({x["id"] for x in items}) != len(items):
raise ValueError("Evaluation item IDs must be unique.")
records = []
for item in items:
messages = prompt.render(item["question"])
response = model.generate(messages, item, temperature, backend_revision)
extracted = grader._extract(response)
score, status = grader.grade(response, item["answer"])
records.append(
ItemRecord(
item["id"],
messages,
response,
extracted,
item["answer"],
score,
status,
)
)
return recordsPythonIn [13]Expand
records_a = run_eval(model_a, prompt, grader, model_a_cfg.temperature, dataset)
records_b = run_eval(model_b, prompt, grader, model_b_cfg.temperature, dataset)ConsoleOut [14]Expand
Model A (small): 5/8 correct = 0.625 statuses={'graded': 7, 'bad_reference': 1}
Model B (large): 6/8 correct = 0.750 statuses={'graded': 7, 'bad_reference': 1}Both runs produce a per-item accuracy, but the fixture's m04 has a broken reference and is scored bad_reference with 0. This is a fixture bug we introduced deliberately. The harness caught it via status, and a careful reviewer would exclude or fix m04 before reporting. For the statistics below, we will drop items with bad_reference so the denominator is well defined. That exclusion decision is itself part of the reporting convention and must be documented. The reason it must be documented is that exclusions change the denominator, and a silent exclusion is indistinguishable from a score improvement: if you drop a hard item, the accuracy goes up and the number looks better, even though nothing about the model changed.
PythonIn [15]Expand
def graded_only(records):
return [r for r in records if r.status != "bad_reference"]
rec_a = graded_only(records_a)
rec_b = graded_only(records_b)
scores_a = np.array([r.score for r in rec_a])
scores_b = np.array([r.score for r in rec_b])
n = len(rec_a)
assert len(rec_b) == nBefore trusting either accuracy, it helps to see the raw per-item score structure and how the status audit changes the denominator. The plot below shows each model's graded hit fraction next to the true capability and flags the one excluded item, so the reader can see exactly which denominator the reported number uses.
PythonIn [16]Expand
_graded_fraction_by_model = [
(
"A",
float(scores_a.mean()),
model_a.success_probability(model_a_cfg.temperature),
len(scores_a),
len(records_a) - len(scores_a),
),
(
"B",
float(scores_b.mean()),
model_b.success_probability(model_b_cfg.temperature),
len(scores_b),
len(records_b) - len(scores_b),
),
]VisualizationOut [17]Expand

Align the two score arrays by task ID before subtracting them. The assertion checks that the retained rows identify the same tasks in the same order.
PythonIn [18]Expand
ids_a = [r.item_id for r in rec_a]
ids_b = [r.item_id for r in rec_b]
assert ids_a == ids_b, "items must be aligned for paired statistics"Writing the Artifact Bundle
The bundle stores the manifest, dataset, prompt, model configuration, grader, harness policy and item records. Each file has a digest held separately for verification. The fixture uses a temporary directory; a real run would persist the files and trusted digest reference under its artifact policy.
Pass the same ordered tasks to the archive writer that the manifest and evaluator used. Before writing, compare the dataset, prompt, model settings, grader and run policy with their recorded identities. Check that each record matches the corresponding task and rendered messages. The archive keeps the fields needed to reproduce the scores.
PythonIn [19]Expand
def check_bundle_inputs(inputs, records):
manifest = inputs["manifest.json"]
items = inputs["dataset.json"]
prompt = PromptTemplate(**inputs["prompt.json"])
model_config = inputs["model_config.json"]
grader_policy = inputs["grader.json"]
run_policy = inputs["run_policy.json"]
if digest(items) != manifest["dataset_digest"]:
raise ValueError("Dataset content does not match the run manifest.")
identities = {
"prompt_name": prompt.name,
"prompt_version": prompt.version,
"prompt_digest": prompt.template_digest(),
"model_name": model_config["name"],
"model_revision": model_config["revision"],
"model_digest": digest(model_config),
"grader_version": grader_policy["version"],
"grader_digest": digest(grader_policy),
"harness_policy_digest": digest(run_policy),
}
for field, value in identities.items():
if manifest[field] != value:
raise ValueError(
f"Archive {field} does not match the run manifest."
)
ids = [item["id"] for item in items]
if len(ids) != len(set(ids)):
raise ValueError("Archived item IDs must be unique.")
recorded_items = [(row["item_id"], row["reference"]) for row in records]
if recorded_items != [(item["id"], item["answer"]) for item in items]:
raise ValueError(
"Record IDs and references must match the ordered dataset."
)
for item, row in zip(items, records, strict=True):
if row["messages"] != prompt.render(item["question"]):
raise ValueError(f"Rendered messages differ for {item['id']}.")
def write_bundle(manifest, items, records, prompt, model_cfg, grader):
inputs = {
"manifest.json": asdict(manifest),
"dataset.json": items,
"prompt.json": asdict(prompt),
"model_config.json": asdict(model_cfg),
"grader.json": grader.policy(),
"run_policy.json": RUN_POLICY,
}
rows = [asdict(record) for record in records]
check_bundle_inputs(inputs, rows)
payloads = {name: canonical_bytes(value) for name, value in inputs.items()}
payloads["records.jsonl"] = b"".join(
canonical_bytes(row) + b"\n" for row in rows
)
out = ARTIFACT_DIR / manifest.manifest_digest()
out.mkdir(exist_ok=True)
for name, contents in payloads.items():
path = out / name
if path.exists() and path.read_bytes() != contents:
raise ValueError(f"Existing bundle differs at {name}.")
path.write_bytes(contents)
digests = {
name: hashlib.sha256(contents).hexdigest()
for name, contents in payloads.items()
}
return out, digests
path_a, trusted_a = write_bundle(
manifest_a, dataset, records_a, prompt, model_a_cfg, grader
)
path_b, trusted_b = write_bundle(
manifest_b, dataset, records_b, prompt, model_b_cfg, grader
)ConsoleOut [20]Expand
Artifact bundles written: 7f1151443fcc3646... -> ['dataset.json', 'grader.json', 'manifest.json', 'model_config.json', 'prompt.json', 'records.jsonl', 'run_policy.json'] 3488e58bf9e4a874... -> ['dataset.json', 'grader.json', 'manifest.json', 'model_config.json', 'prompt.json', 'records.jsonl', 'run_policy.json']
The stored responses can be scored with the same grader without calling the model again. A later grading policy can generate a separate report over those responses. Report which policy produced each score.
Checking Whether Outputs Repeat
Keep the request inputs fixed. Compare two calls on the same mock backend, then change only its identifier as a controlled test of unrecorded backend variation.
The rate is the fraction of full responses that match byte for byte. A formatting difference can reduce byte agreement even when the grader gives both responses the same score. Report these two outcomes independently.
PythonIn [21]Expand
def replay_rate(
model, prompt, grader, temperature, items, first_backend, second_backend
):
if not items:
raise ValueError("Replay requires at least one item.")
first = run_eval(model, prompt, grader, temperature, items, first_backend)
second = run_eval(model, prompt, grader, temperature, items, second_backend)
identical = sum(
a.response == b.response for a, b in zip(first, second, strict=True)
)
return identical / len(items), len(items)
same_backend, k = replay_rate(
model_a,
prompt,
grader,
model_a_cfg.temperature,
dataset,
"mock-backend-1",
"mock-backend-1",
)
changed_backend, _ = replay_rate(
model_a,
prompt,
grader,
model_a_cfg.temperature,
dataset,
"mock-backend-1",
"mock-backend-2",
)ConsoleOut [22]Expand
Replay with pinned mock backend: 100.0% of 8 Replay after backend change, same seed and temperature: 62.5% of 8
Exact byte agreement holds when all mock inputs are unchanged. With a different backend identifier, the report measures an observed response agreement for those same tasks and seed. A deployed service may expose less of its execution state. Re-run it under named settings and keep byte agreement separate from changes in scored answers.
A seed controls only randomness that a particular implementation ties to it. Record the remaining settings and measure repeated output agreement. This check does not turn the seed into a cross-runtime guarantee.
Uncertainty with the Task as the Sampling Unit
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.
Comparing Two Models on the Same Tasks
Comparing model A and model B is usually framed as "is B's score higher than A's?" That framing invites computing two independent intervals and eyeballing overlap, which is both under-powered and misleading. The models were evaluated on the same tasks. That pairing is information: if a task is hard, both models tend to miss it; if it is easy, both tend to hit it. A paired analysis exploits this by looking at per-task differences, which cancels the shared task difficulty.
The discordant outcomes determine the observed difference, but the estimate still divides by the total number of matched tasks. Pairs where both systems succeed or both fail contribute a zero difference.
The statistic of interest is the mean per-task difference
where:
- : model 's score on task (1 if correct, 0 otherwise)
- : the number of graded tasks shared by both models
- : the estimated mean per-task accuracy difference between models B and A
With pairing, is the average of the per-task differences , which have mean and sample variance ; the standard error of is therefore the standard deviation of those differences divided by :
not . Positive covariance lowers the variance of the paired difference relative to ignoring covariance. Negative covariance raises it. The classic McNemar view makes the same point: only the discordant items (where one model is right and the other wrong) carry information about which model is better. Let (b) be the count of items where B is right and A is wrong, and (c) the count of items where A is right and B is wrong.
where:
- : the number of discordant tasks on which model B is correct and model A is incorrect
- : the number of discordant tasks on which model A is correct and model B is incorrect
- : the number of graded tasks shared by both models
- : the mean per-task difference, since the tasks contribute , the tasks contribute , and the remaining concordant tasks contribute
The paired difference is therefore (\hat d = (b - c)/n).
For uncertainty, a bootstrap over tasks is the most flexible and the least assumption-laden: resample task indices with replacement, compute on each resample, and take percentiles. We will also compute the analytic paired z-test as a cross-check.
Let's run the paired analysis on our fixture. Recall the true gap is 0.80 - 0.72 = 0.08.
PythonIn [32]Expand
diffs = scores_b - scores_a
n = len(diffs)
d_hat = float(diffs.mean())
# Discordant counts (symmetric difference)
b = int(((scores_b == 1) & (scores_a == 0)).sum()) # B right, A wrong
c = int(((scores_b == 0) & (scores_a == 1)).sum()) # A right, B wrong
# Paired standard error
var_d = float(np.var(diffs, ddof=1))
se_paired = math.sqrt(var_d / n)
z = 1.959963984540054
paired_ci = (d_hat - z * se_paired, d_hat + z * se_paired)
# Unpaired SE for comparison (wrong for this design)
p_a, p_b = scores_a.mean(), scores_b.mean()
se_unpaired = math.sqrt(p_a * (1 - p_a) / n + p_b * (1 - p_b) / n)
unpaired_ci = (d_hat - z * se_unpaired, d_hat + z * se_unpaired)
# Bootstrap over tasks
rng = np.random.default_rng(7)
B = 5000
boot_d = np.empty(B)
for bidx in range(B):
idx = rng.integers(0, n, size=n)
boot_d[bidx] = diffs[idx].mean()
boot_ci = (float(np.quantile(boot_d, 0.025)), float(np.quantile(boot_d, 0.975)))ConsoleOut [33]Expand
n=7, observed mean difference=+0.143 Discordant: B-only-right b=1, A-only-right c=0 Paired SE=0.1429 95% CI=(-0.137, +0.423) Bootstrap 95% CI=(+0.000, +0.429) Unpaired SE=0.2160 95% CI=(-0.280, +0.566)
Compare the paired estimate, discordant counts and interval bounds directly. This fixture has only seven graded tasks, so a handful of discordances can dominate the estimate. An interval including zero leaves both signs compatible with the uncertainty in that procedure.
Pairing changes variance through the covariance between scores. Positive covariance can narrow the interval compared with an independence calculation; negative covariance can widen it. The small fixture is a demonstration of the computation, so avoid treating either normal or percentile-bootstrap bounds as a release decision.
Coverage of the Paired Interval
In a separate synthetic experiment, draw 100 independent tasks per run. Use the same uniform draw for both binary outcomes on a task, creating positive dependence. Compare the observed coverage of the true 0.08 difference when the estimated covariance is used and when it is ignored.
PythonIn [34]Expand
def simulate_paired(n_runs=3000, n_tasks=100, base_seed=3000):
draws = np.random.default_rng(base_seed).random((n_runs, n_tasks))
a, b = (draws < 0.72).astype(float), (draws < 0.80).astype(float)
d = b - a
dhat = d.mean(axis=1)
z = NormalDist().inv_cdf(0.975)
paired_se = np.sqrt(d.var(axis=1, ddof=1) / n_tasks)
naive_se = np.sqrt(
(a.var(axis=1, ddof=1) + b.var(axis=1, ddof=1)) / n_tasks
)
gap = 0.80 - 0.72
return float(np.mean(np.abs(dhat - gap) <= z * paired_se)), float(
np.mean(np.abs(dhat - gap) <= z * naive_se)
)
cov_paired, cov_unpaired = simulate_paired()ConsoleOut [35]Expand
Observed coverage of the 0.08 gap, paired: 0.907 Observed coverage if covariance is ignored: 1.000
The output reports observed coverage for this construction. It does not establish nominal coverage for the same interval in a seven-item benchmark. Use a paired estimate on a matched design and report the assumptions behind the uncertainty calculation.
Building the Comparable Report
Print the input digests, decoding settings, grader identity, graded and excluded counts, point estimate, and interval method. Keep companion diagnostics such as replay and the paired result alongside individual model reports.
We will assemble a structured report object and render a compact text version, plus a plot placing the two models' intervals side by side so the intended comparison is legible.
PythonIn [36]Expand
def build_report(manifest, prompt, model_cfg, records):
graded = graded_only(records)
excluded = [r for r in records if r.status == "bad_reference"]
lo, hi, p = proportion_ci_wilson([r.score for r in graded])
statuses = {}
for record in records:
statuses[record.status] = statuses.get(record.status, 0) + 1
return {
"manifest_digest": manifest.manifest_digest(),
"dataset_digest": manifest.dataset_digest,
"harness_policy_digest": manifest.harness_policy_digest,
"prompt": {
"name": prompt.name,
"version": prompt.version,
"digest": manifest.prompt_digest,
},
"model_config": asdict(model_cfg),
"backend_revision": manifest.backend_revision,
"grader": {
"version": manifest.grader_version,
"digest": manifest.grader_digest,
},
"n_graded": len(graded),
"n_excluded": len(excluded),
"excluded_reasons": [f"{r.item_id}:{r.status}" for r in excluded],
"statuses": statuses,
"accuracy": p,
"interval_method": "95% Wilson over binary task scores",
"interval_95": [lo, hi],
}
report_a = build_report(manifest_a, prompt, model_a_cfg, records_a)
report_b = build_report(manifest_b, prompt, model_b_cfg, records_b)ConsoleOut [37]Expand
=== REPORT A ===
{'manifest_digest': '7f1151443fcc36468f68e8142acecdf496b06bfe6f2d86e5b961bd42f2e350ad',
'dataset_digest': '531d7cc553482833c29a3701959701081516c55dab035d5544eda3934d52b18d',
'harness_policy_digest': '73ffda1ec28246396ae7f693084879db7cb1b7703c29632c26ab664f919d5e4a',
'prompt': {'name': 'math_cot_v1',
'version': '1.0.0',
'digest': '990390123d9509d8c600ca27c2abed60ca249362d596637a0b560e01b6c61d03'},
'model_config': {'name': 'mock-math-small',
'revision': 'ckpt-2025-11-01',
'temperature': 0.7,
'top_p': 1.0,
'max_tokens': 256,
'stop': ('</solution>',),
'seed': 1272},
'backend_revision': 'mock-backend-1',
'grader': {'version': '1.0.0',
'digest': '4431c94319b9c9c1a6dd91b15282361ede9d9e83ad455c4c751d8dae946256af'},
'n_graded': 7,
'n_excluded': 1,
'excluded_reasons': ['m04:bad_reference'],
'statuses': {'graded': 7, 'bad_reference': 1},
'accuracy': 0.7142857142857143,
'interval_method': '95% Wilson over binary task scores',
'interval_95': [0.3589344518326194, 0.9177810759959433]}
=== REPORT B ===
{'manifest_digest': '3488e58bf9e4a8744fb10ad4702cf963f6b5a8ac457458a0abe1dccc55226c71',
'dataset_digest': '531d7cc553482833c29a3701959701081516c55dab035d5544eda3934d52b18d',
'harness_policy_digest': '73ffda1ec28246396ae7f693084879db7cb1b7703c29632c26ab664f919d5e4a',
'prompt': {'name': 'math_cot_v1',
'version': '1.0.0',
'digest': '990390123d9509d8c600ca27c2abed60ca249362d596637a0b560e01b6c61d03'},
'model_config': {'name': 'mock-math-large',
'revision': 'ckpt-2025-11-01',
'temperature': 0.7,
'top_p': 1.0,
'max_tokens': 256,
'stop': ('</solution>',),
'seed': 1272},
'backend_revision': 'mock-backend-1',
'grader': {'version': '1.0.0',
'digest': '4431c94319b9c9c1a6dd91b15282361ede9d9e83ad455c4c751d8dae946256af'},
'n_graded': 7,
'n_excluded': 1,
'excluded_reasons': ['m04:bad_reference'],
'statuses': {'graded': 7, 'bad_reference': 1},
'accuracy': 0.8571428571428571,
'interval_method': '95% Wilson over binary task scores',
'interval_95': [0.4868721707256813, 0.9743203756552565]}The recorded fields help check whether two reports share a dataset and scoring procedure. A comparison still needs a common estimand and a design that matches the task identities and experimental conditions.
We now plot the two intervals to make the uncertainty visible and to show why a single number hides it.
VisualizationOut [38]Expand

Each model’s interval reflects the task count under the stated binomial approximation. To assess whether a difference is supported on paired data, use the uncertainty of the differences.
The Paired Difference Figure
The honest comparison shows the difference and its interval. Many readers will try to infer the difference from the two separate intervals above; the paired figure below shows why they should not.
VisualizationOut [39]Expand

All intervals in the paired figure share the same point estimate. Their widths differ because they use different variance or resampling rules. With few tasks, check the zero line and the amount of evidence in the discordant rows.
Statistical vs Execution vs Semantic Reproducibility
It is worth separating three kinds of "reproducibility," because teams conflate them and then talk past each other.
- Execution reproducibility means the same manifest, run again, produces byte-identical per-item outputs. This is what the replay check measures. It is usually the hardest to achieve for hosted models and is often not required for scientific validity, as long as the variation is quantified.
- Statistical reproducibility concerns whether repeated results are compatible with the stated design and sources of variability. A controlled repeated-run comparison can address that question. Overlap between two separate intervals is insufficient to test a difference.
- Semantic reproducibility asks whether a substantive conclusion survives a stated set of reasonable changes to the evaluation procedure. The scope is the variants tested. See Benchmark Design and Evaluation Challenges for ways an evaluation can be sensitive to the setup.
These checks can disagree. A byte-level replay can succeed while the result changes under a different prompt. A repeated-run check keeps the protocol fixed, whereas a sensitivity check changes a named protocol component.
The replay rate measures repeated execution under the declared conditions. The paired interval describes uncertainty in the score difference under task sampling. The sensitivity suite checks the conclusion across named protocol variants.
Sensitivity: Does the Conclusion Survive Reasonable Perturbations?
A single score under a single prompt and grader can be a fragile conclusion. The harness should support sensitivity analysis: re-run under a small matrix of defensible variants (prompt paraphrase, grader variant, decoding setting) and report the spread. If the sign of the comparison flips under a reasonable paraphrase, you do not have a conclusion; you have a lucky prompt. The Evaluation Prompt Engineering chapter covered how to design these variants; here we show how to run and report them reproducibly.
Choose variants that a reasonable evaluator might use for the same task. Stable results support a conclusion over the variants tested. If one change reverses the ordering, report which change did so.
We construct two prompt variants: the original, and a paraphrase that changes the system message but keeps the answer-format constraint. We keep the model and grader fixed to isolate the prompt's effect. We run each variant for both models and record the difference.
PythonIn [40]Expand
prompt_alt = PromptTemplate(
name="math_cot_v1",
version="1.1.0-paraphrase",
system=(
"Show your reasoning briefly, then give the final numeric answer "
"on its own final line as '#### <answer>'."
),
user_template="Question: {question}",
)
variants = [("original", prompt), ("paraphrase", prompt_alt)]PythonIn [41]Expand
sensitivity = []
for vname, p in variants:
ra = run_eval(model_a, p, grader, model_a_cfg.temperature, dataset)
rb = run_eval(model_b, p, grader, model_b_cfg.temperature, dataset)
sa = np.array([r.score for r in graded_only(ra)])
sb = np.array([r.score for r in graded_only(rb)])
diff = float((sb - sa).mean())
sensitivity.append(
(
vname,
p.version,
p.template_digest()[:12],
float(sa.mean()),
float(sb.mean()),
diff,
)
)ConsoleOut [42]Expand
variant ver digest A B diff original 1.0.0 990390123d95 0.714 0.857 +0.143 paraphrase 1.1.0-paraphrase 36e34bd128cc 0.714 0.857 +0.143
The mock ignores prompt text. At fixed settings the two prompt variants produce the same scores and different template digests. This is a control for artifact tracking. To estimate sensitivity of a real model, run defensible prompt variants that leave the evaluated behavior and grading policy fixed.
Keep the sensitivity matrix alongside the headline result. The displayed rows show the prompt label, version and abbreviated digest with the corresponding scores. Retain the full prompt and grader identities with the run records to resolve those prefixes and recover the fixed grader.
Worked Example: A Complete Manifest-to-Report Loop
Reload the archive using separately held file digests. After checking the file set and bytes, check that the serialized inputs match the manifest and the item records match those inputs. Backend identity and library versions are declared runtime metadata. Comparing archive fields cannot establish what runtime served a past request. Regrade with the original policy to check that the stored responses still produce the recorded scores.
PythonIn [43]Expand
def reload_and_verify(bundle, trusted_digests, grader):
expected = {
"manifest.json",
"dataset.json",
"prompt.json",
"model_config.json",
"grader.json",
"run_policy.json",
"records.jsonl",
}
if (
set(trusted_digests) != expected
or {p.name for p in bundle.iterdir()} != expected
):
raise ValueError("Bundle files do not match the trusted manifest.")
loaded = {}
for name in sorted(expected):
contents = (bundle / name).read_bytes()
if hashlib.sha256(contents).hexdigest() != trusted_digests[name]:
raise ValueError(f"Bundle bytes changed at {name}.")
loaded[name] = contents
records = [
json.loads(row) for row in loaded.pop("records.jsonl").splitlines()
]
inputs = {name: json.loads(contents) for name, contents in loaded.items()}
check_bundle_inputs(inputs, records)
manifest = inputs["manifest.json"]
if grader.policy_digest() != manifest["grader_digest"]:
raise ValueError(
"Use the archived grader policy for this verification."
)
scores = []
for record in records:
score, status = grader.grade(record["response"], record["reference"])
if (score, status) != (record["score"], record["status"]):
raise ValueError(
f"Regrading changed the result for {record['item_id']}."
)
if status != "bad_reference":
scores.append(score)
if not scores:
raise ValueError("No graded tasks in this archive.")
return manifest["model_name"], sum(scores) / len(scores), len(scores)
name_a, acc_a_reload, n_a = reload_and_verify(path_a, trusted_a, grader)
name_b, acc_b_reload, n_b = reload_and_verify(path_b, trusted_b, grader)ConsoleOut [44]Expand
Reload mock-math-small: acc=0.714 over 7 items Reload mock-math-large: acc=0.857 over 7 items Matches in-memory report A: True Matches in-memory report B: True
The replay of the stored responses reproduces the scores with the original grader. The trusted file digests identify those bytes. An archive and untrusted checksums kept beside it can be altered together, so production systems need a protected reference or signature.
Limitations and Impact
The harness is not a magic wand. It has real limitations, and understanding them prevents false confidence.
Hosted inference may expose an incomplete version or configuration record. Repeated trials on the same task list can measure conditional score and byte agreement. They do not by themselves estimate how performance varies across new tasks.
A curated benchmark is a fixed set. A population interval needs an explicit sampling or outcome model. Wilson intervals assume independent binary trials; small samples, repeated tasks and related scenarios can require different analyses. No interval repairs a task set that misses the deployment population.
The mock deliberately changes response outcomes when its synthetic backend key changes. It gives no estimate of how much any deployed model drifts across requests, hardware or revisions.
Prompt changes and different grading rules can shift a comparison. Report the measured sensitivity under declared alternatives and retain each alternative’s input digest.
An archive can show whether a measured regression appeared alongside a changed prompt, grader, or execution setting. Controlled comparisons are still needed to isolate the cause.
Summary
An evaluation harness records the task set, model settings, prompts, grader, runner, environment and reporting rules. Digests identify the artifacts that are available to retain.
The fixture separates three checks. Repeated execution tests whether responses repeat under fixed conditions. Repeated synthetic task draws test an uncertainty procedure under a known model. Comparing the two systems uses the same task IDs and examines the distribution of per-task differences.
Keep the run manifest and input artifacts. Archive the requests, responses and grader policy with their item results. Verify the archive against a trusted digest list and report regrading as a separate result.
For a hosted model, retain the settings the provider exposes and distinguish repeated calls from new task draws. Report score sensitivity to the specific prompt and grader variants you tested.
Key Parameters
The key parameters of the harness implementation are:
ModelConfig.temperature: The mock is deterministic at any supported temperature when its full key stays fixed. Temperature changes the hash input and lowers the configured success threshold.ModelConfig.seed: The seed is one input to the mock draw. A manifest digest identifies what was declared. The replay check measures whether the recorded setting reproduces the outputs.MockModel.capability: The base success probability at zero temperature. At other temperatures the mock adjusts and clips that probability. The coverage simulations declare their own population parameters.RegexNumericGrader.versionandanswer_marker: The grader policy digest is computed from these; changing either is a grader change that alters the manifest.RUN_POLICY["report"]: Records accuracy and the 95% Wilson interval as the reporting convention. The notebook also computes other intervals to show how their bounds differ.bootstrap_ci'sB: The number of bootstrap resamples. Increasing it can reduce Monte Carlo error in the endpoints while leaving the observed task sample unchanged. At fixed task count, the resampling work grows in proportion toB.
Quiz
Ready to test your understanding? Take this quick quiz to reinforce what you've learned about evaluation harnesses and reproducibility.
Evaluation Harnesses and Reproducibility
Join the discussionAsk a question or share what you learned.
Keep exploring
Reference
Citation details
Cite or share this article.


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!