Sub topic 10
Setting Acceptance Criteria and Thresholds
Acceptance criteria are measurable conditions that decide whether an AI feature is good enough for its intended use. A threshold is the boundary for passing a criterion. This chapter assumes you understand basic product requirements, have a general idea of how language models work, and can read short Python and JSON examples.
From a requirement to a pass condition
An AI feature can produce different answers for the same input. Therefore, an acceptance criterion usually describes performance across a set of cases rather than one required answer.
A useful criterion names:
- The population being tested, such as questions about refund policy.
- The quality dimension, such as groundedness or completeness.
- The grader or measurement method.
- The minimum or maximum acceptable value.
- Any failure that is unacceptable even when the overall score is high.
For example:
> For refund-policy questions, at least 95% of answers must contain only claims supported by the retrieved policy text, according to the groundedness grader. No answer may contradict a refund amount or deadline.
The first sentence defines an aggregate threshold. The second sentence defines a zero-tolerance rule. Both are needed because an average can hide a dangerous individual failure.
Choose thresholds from risk and user impact
Do not choose a threshold only because it is a round number. Consider the cost of failure, the current baseline, and the amount of variation in the measurement.
| Criterion | Measurement | Example threshold | Additional rule |
|---|---|---|---|
| Groundedness | Grounded cases divided by all cases | At least 95% | Zero critical contradictions |
| Required information | Cases containing all required facts | At least 90% | At least 85% on every key category |
| Response time | 95th-percentile latency | At most 3 seconds | No timeout over 10 seconds |
A high-risk feature may require a strict threshold and zero critical failures. A low-risk brainstorming tool may accept a lower score if users can easily review and edit its output.
Set thresholds for important slices, too. A slice is a subset of the evaluation data, such as complex questions, a language, or a customer segment. An overall pass rate of 95% is weak evidence if one important slice passes at only 70%.
def decide(results, overall_min=0.90, slice_min=0.85):
"""Return a release decision from case-level evaluation results."""
total = len(results)
if total == 0:
return {"ship": False, "reason": "no evaluation cases"}
overall_rate = sum(item["passed"] for item in results) / total
critical_failures = [
item["id"] for item in results
if not item["passed"] and item["severity"] == "critical"
]
slice_rates = {}
for item in results:
slice_name = item["slice"]
slice_rates.setdefault(slice_name, []).append(item["passed"])
failing_slices = []
for name, values in slice_rates.items():
rate = sum(values) / len(values)
slice_rates[name] = rate
if rate < slice_min:
failing_slices.append(name)
ship = (
overall_rate >= overall_min
and not critical_failures
and not failing_slices
)
return {
"ship": ship,
"overall_rate": overall_rate,
"slice_rates": slice_rates,
"critical_failures": critical_failures,
"failing_slices": failing_slices,
}
cases = [
{"id": "refund-1", "slice": "typical", "passed": True, "severity": "minor"},
{"id": "refund-2", "slice": "typical", "passed": True, "severity": "minor"},
{"id": "refund-3", "slice": "edge", "passed": True, "severity": "major"},
{"id": "refund-4", "slice": "edge", "passed": True, "severity": "major"},
]
print(decide(cases))Account for uncertainty
A pass rate from ten cases is less reliable than the same rate from one thousand cases. Record the number of cases behind every metric. For a small or high-risk evaluation, use human review, add more cases, or report a confidence interval rather than treating the observed rate as exact.
Define what happens near the boundary. For example, require a score of at least 0.90 and rerun the evaluation when the score is between 0.88 and 0.90. This avoids making a release decision from small random changes.
Connect criteria to a release gate
A release gate should state what blocks launch:
- Calculate overall metrics and important slice metrics.
- Check zero-tolerance failure rules.
- Compare every metric with its threshold.
- Record failing case IDs and the model or prompt version.
- Allow release only when all blocking conditions pass.
Exercise
An assistant has a 96% overall groundedness rate, but one answer gives a legally prohibited instruction. Should it pass the release gate?
Show answer
No. The overall rate passes, but the critical failure should trigger a zero-tolerance block until the case is fixed and the evaluation is rerun.