Sub topic 10
Setting Acceptance Criteria and Thresholds
What this chapter assumes
You have already written testable requirements, built an evaluation set, and chosen graders that turn each case into a pass or fail. You also know how to compute a pass rate from those grades. This chapter covers the next step: deciding what numbers mean "good enough to ship". You should be comfortable reading short Python snippets.
From requirement to acceptance criterion
A requirement says what quality the feature must have. An acceptance criterion says what evidence will show that the requirement is met. The two are related but separate.
- A requirement: "Answers about refunds must be grounded in the policy text."
- A metric: the share of refund-policy cases that the groundedness grader marks as passing.
- An acceptance criterion: "On the 80 refund-policy cases, the groundedness pass rate is at least 95%, and no case with a critical severity fails."
A complete criterion has five parts. If one is missing, people will argue about it at release time.
| Part | Question it answers | Example |
|---|---|---|
| Metric | What is measured? | Groundedness pass rate |
| Slice | On which cases? | Category `refund_policy` |
| Threshold | What value is enough? | At least 95% |
| Evidence size | How many cases back the number? | At least 80 cases |
| Severity rule | Which failures override the average? | 0 critical failures |
Write criteria before you run the evaluation for the first time. If you pick the threshold after seeing the score, you will tend to pick a number the feature already meets. That makes the criterion a description of the current state, and it no longer tests anything.
Choosing a threshold value
There is no universal good pass rate. A threshold comes from the cost of being wrong, the alternatives, and what is achievable. Four inputs help.
- The cost of a failure. A wrong tone in a greeting is cheap. A wrong refund deadline can cost money and trust. Higher cost means a higher threshold, or a zero-tolerance rule.
- The baseline. Measure what users get today: a human agent, a search page, or the previous version of the feature. If human agents answer policy questions correctly 92% of the time, requiring 99% from the AI feature may be unrealistic, and requiring 80% would be a regression.
- The fallback. If the feature can say "I'm not sure, let me connect you to a person" when it is uncertain, you can set a strict accuracy threshold on the answers it does give. You then track a separate criterion for how often it falls back.
- The measurement noise. Your graders and your sample are imperfect. A threshold finer than that noise cannot be checked.
Many teams use two levels for each criterion.
- Minimum: the value below which the feature must not ship.
- Target: the value the team is aiming for and will track after launch.
For example, the minimum groundedness pass rate is 90% for a limited beta and the target is 95% for general release. Naming both avoids a debate in which one side argues from the minimum and the other from the target.
Why sample size matters
A pass rate from 60 cases is an estimate, not a fact. If the true pass rate is 95%, a 60-case run will often show 90% or 98% just by chance. If you compare the raw number to a threshold, you will sometimes block good releases and sometimes approve bad ones.
A confidence interval states the range of true pass rates that are consistent with what you observed. The Wilson interval works well for pass rates, including those near 0% or 100%.
import math
def wilson_interval(passed, total, z=1.96):
"""Return the (low, high) 95% Wilson interval for a pass rate."""
if total == 0:
return 0.0, 1.0
p = passed / total
denom = 1 + z**2 / total
centre = (p + z**2 / (2 * total)) / denom
margin = z * math.sqrt(p * (1 - p) / total + z**2 / (4 * total**2)) / denom
return max(0.0, centre - margin), min(1.0, centre + margin)
def check_criterion(passed, total, threshold):
"""Return 'pass', 'fail', or 'inconclusive' against a minimum pass rate."""
low, high = wilson_interval(passed, total)
if low >= threshold:
status = "pass"
elif high < threshold:
status = "fail"
else:
status = "inconclusive"
return status, low, high
for passed, total in [(57, 60), (200, 200), (40, 60)]:
status, low, high = check_criterion(passed, total, threshold=0.95)
print(f"{passed}/{total}: {status} (95% interval {low:.2f}-{high:.2f})")Running it prints:
57/60: inconclusive (95% interval 0.86-0.98)
200/200: pass (95% interval 0.98-1.00)
40/60: fail (95% interval 0.54-0.77)The first line is the important one. A 95% raw pass rate on 60 cases looks like it meets a 95% threshold, but the data cannot distinguish a true rate of 86% from one of 98%. The honest result is "inconclusive", and the fix is more cases or a better-scoped claim, not a rounded-up approval.
Three practical rules follow from this.
- Decide in advance whether the criterion applies to the observed rate or to the lower bound of the interval. The lower bound is stricter and suits high-stakes criteria.
- Size each slice so the interval is narrow enough to matter. With roughly 100 cases, the interval is about ±5 percentage points near 90%. With 30 cases, it is about ±10.
- Treat "inconclusive" as a real outcome with a defined action, such as adding cases in that slice.
Zero-tolerance criteria and what a sample can prove
Some failures should never happen: stating a refund amount that contradicts the policy, leaking another customer's data, giving unsafe medical instructions. You write these as a tolerance of 0 cases.
A zero-tolerance criterion has a limit that people often miss. Zero failures in a sample does not show a zero failure rate. A useful approximation, called the rule of three, says that after n cases with no failures, the true failure rate could still be as high as about 3/n. With 100 clean cases, the true rate may be near 3%. With 1,000 clean cases, near 0.3%.
This changes how you use these criteria.
- Use the zero-tolerance rule on the evaluation set as a gate: any single critical failure blocks the release and must be investigated.
- Do not claim "this failure never happens" from a passing run. Claim "no critical failures in N cases".
- Add targeted adversarial cases for each critical failure mode, so that the cases are dense where the risk is.
- Back the criterion with product controls outside the model, such as a rule that refund amounts are only ever filled in from the policy database, and monitor for it after launch.
Criteria per slice, not only overall
An overall pass rate hides weak areas. If 90% of your cases are easy and 10% are adversarial, the feature could fail every adversarial case and still show a 90% overall rate. Set criteria for each slice that matters.
| Criterion | Slice | Metric | Minimum | Target |
|---|---|---|---|---|
| AC-1 | Refund policy, typical cases | Groundedness pass rate | 95% | 98% |
| AC-2 | Refund policy, edge cases | Groundedness pass rate | 90% | 95% |
| AC-3 | Adversarial cases | Safe-behavior pass rate | 95% | 99% |
| AC-4 | All cases | Critical failures | 0 | 0 |
| AC-5 | All cases | Median response time | 4 s | 2 s |
| AC-6 | All cases | Rate of "hand off to a person" | At most 20% | At most 10% |
Notice that the thresholds differ by slice. Edge cases are harder, so a lower minimum is reasonable, provided the severity rule still covers critical failures. Notice also that AC-5 and AC-6 are not quality scores. A feature that refuses everything would pass the accuracy criteria perfectly, so you need criteria on usefulness and cost that pull the other way.
How criteria combine into a decision
Each criterion produces one of three results: pass, fail, or inconclusive. The release decision combines them with a simple, agreed rule. The release gates chapter covers how to automate it. At this stage you only need the logic written down.
Common errors
- Setting the threshold after seeing the score. Record criteria and thresholds before the first run, and change them only with a written reason.
- Using one number for everything. A single "90% overall" criterion hides critical failures and weak slices.
- Treating 100% as a target for non-critical dimensions. Perfect scores on a small set usually mean the set is too easy. If every case passes, add harder cases.
- Tuning on the evaluation set. If you adjust prompts until the set passes, the score no longer predicts behavior on new inputs. Keep a held-out portion that nobody tunes against.
- Ignoring grader error. If a model judge agrees with human reviewers only 85% of the time, a 95% threshold is finer than your measurement. Calibrate the grader first, or lower your confidence in the result.
- Missing counter-criteria. Pair every quality criterion that can be satisfied by refusing or hedging with one for helpfulness or hand-off rate.
- No action for "inconclusive". Decide in advance what happens: more cases, a limited beta, or a delay.
Documenting the criteria
Store the criteria next to the evaluation set, in version control, so each change has an author and a date. For each criterion record the ID, the requirement it covers, the slice, the metric and grader, the minimum and target, the severity rule, and the date and reason for the last change. When a release is blocked or approved, the record shows which criterion decided it.
Exercise
A support assistant is evaluated on 50 cases in the "billing dispute" slice. The acceptance criterion is "at least 90% of answers are grounded in policy". The run shows 46 of 50 passing (92%), and one failing case states an incorrect refund amount, which your severity table marks as critical. Using the decision flow in this chapter, what is the result for this criterion, and what should the team do next?
Show answer
The criterion fails, even though the raw pass rate of 92% is above 90%. The first check in the flow is the severity rule, and any critical failure fails the criterion, so the team must investigate the wrong refund amount first. After a fix, they should rerun the evaluation. Even then, 46 of 50 gives a Wilson interval of roughly 81% to 97%, which includes the 90% threshold, so a clean rerun would likely come out "inconclusive" unless the team adds cases to that slice.
Exercise
Why can a team not conclude that a critical failure "never happens" after 200 evaluation cases with zero critical failures, and what should the criterion say instead?
Show answer
Zero failures in a sample only bounds the true failure rate. By the rule of three, the true rate could still be about 3/200, or 1.5%. The criterion should state the result as "no critical failures in 200 cases", keep the zero-tolerance gate so any single failure blocks release, add targeted adversarial cases, and rely on product controls and online monitoring for the remaining risk.