Evaluation Harnesses and Reproducibility › Sensitivity: Does the Conclusion Survive Reasonable Perturbations?
Language AI HandbookAll chapters 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.
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!