Generative AI / Advanced: evaluation, reliability, and accountability / Lesson 21
Paired Evaluation and Release Regressions
Compare two generative system configurations on the same cases and review regressions before release.
On this page
Lesson goals
- Compare candidate and baseline on paired cases.
- Inspect safety and task slices rather than only aggregate scores.
- Record release criteria, uncertainty, and rollback evidence.
Freeze a representative evaluation set
A release comparison should define the task, evidence available to each configuration, expected properties, and consequences of failure. Include ordinary requests, ambiguous questions, unsupported claims, and permission boundaries relevant to the application. Keep test material and expected judgments controlled so both configurations face the same conditions.
Record model, prompt, retrieval index, tools, validators, and evaluation procedure. If generation is sampled, repeated runs can reveal variation; record the sampling configuration and do not assume one response represents all runs. Protect private data in fixtures and logs.
Inspect paired changes
A paired comparison follows the same case through the baseline and candidate. The synthetic Boolean results below show one regression and one improvement; an unchanged aggregate pass count alone would hide both. The labels are illustrative, not measurements of a real system, and a pass definition must be reviewed for the actual task.
old = {"a": True, "b": True, "c": False, "d": True}
new = {"a": True, "b": False, "c": True, "d": True}
print("regressions", [k for k in old if old[k] and not new[k]])
print("improvements", [k for k in old if not old[k] and new[k]])
Case b passes only in the baseline and case c passes only in the candidate.
Review important slices
Group results by relevant failure type or population and report both counts and denominators. Small slices can be informative examples but provide limited precision. A boundary failure may need attention even when the overall pass rate looks favorable. Review the source evidence and decision trace for each consequential regression.
cases = [("ordinary", True), ("boundary", False), ("boundary", True)]
for group in sorted({group for group, passed in cases}):
values = [passed for name, passed in cases if name == group]
print(group, sum(values), len(values))
The ordinary slice has one pass in one case, while the boundary slice has one pass in two cases.
Make judgments reproducible
Define what a passing answer must do and how reviewers resolve disagreement. Automated checks can verify parseable structure or exact fields, but semantic support and harmful behavior may need additional judgment. Audit a sample of automated decisions, retain versioned rubrics, and report unresolved cases rather than forcing every example into a confident label.
Decide and monitor
Set acceptance criteria and owners before inspecting the comparison, including any non-negotiable access or action boundary. Investigate regressions, then rerun affected and previously passing cases after a fix. Record the release decision and rollback configuration. Monitor real use with appropriate privacy controls because a finite test set cannot cover every future request.
Common errors and fixes
A candidate is approved because its aggregate score is unchanged.
- Why it happens
- Regressions and improvements on individual cases cancel numerically.
- How to fix it
- Inspect paired changes and consequential slices.
- Prevent it next time
- Include regression review in release criteria.
Two versions are compared on different evidence.
- Why it happens
- The retrieval index or fixture changed between runs.
- How to fix it
- Re-run the comparison with controlled inputs and record versions.
- Prevent it next time
- Freeze and version the evaluation configuration.
A valid structured answer is marked factually correct automatically.
- Why it happens
- Schema validity was treated as evidence support.
- How to fix it
- Check the claims against the available source material.
- Prevent it next time
- Evaluate structure and semantic support separately.
2 practice exercises
1. The baseline and candidate each pass three of four cases, but one baseline pass becomes a candidate failure. What should be reviewed?
Show worked solution
Identify the paired regression and any offsetting improvement, inspect the affected task and boundary, and decide against the predefined criteria. Equal aggregate counts do not show equal behavior.
2. A boundary slice has one failure among two tests. Can its failure rate be estimated precisely?
Show worked solution
No. Report one failure in two cases, investigate its severity, and add representative tests as appropriate. The small denominator limits precision and does not make the observed failure unimportant.
Key takeaways
- Compare the same cases and preserve configuration details.
- Inspect regressions and consequential slices alongside aggregates.
- Document release criteria, judgment limits, and recovery.