Evaluation Harnesses and Reproducibility › Checking Whether Outputs Repeat
Language AI HandbookAll chapters 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.
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!