Agree how much worse the AI may be before you measure it
A non-inferiority margin fixed at the start sets how many samples a pilot needs and whether sign-off ends with a signed rule or an argument.
In brief
- The margin is how much worse the client will accept a metric getting in exchange for another benefit, and it must be fixed before any data exists.
- Tighter margins need more samples: halving the margin nearly quadruples the sample size.
- 'No difference found' does not prove the AI matches people; check the lower bound of the confidence interval on every guardrail metric.
OpenAI’s guidance on evals lists two anti-patterns. One is treating “it seems to work” as an evaluation. The other is waiting until launch to build evals. At client sites the two habits tend to surface together, in the sign-off meeting, when the head of operations asks whether the AI system does worse than their team.
The question sounds simple, but nobody can answer it until someone says how much worse “worse” means. The AI will almost certainly get a few things wrong that people get right. Without an acceptable figure agreed in advance, every error the client finds in the demo becomes evidence against you.
The skill that matters, then, is agreeing a non-inferiority margin with the client before the pilot runs. That number determines how many samples you need, how the pilot is designed, and whether the final meeting ends with a signed rule or slides into an argument about impressions.
The margin is the price the client agrees to pay
Spotify, in its Confidence experimentation platform, defines the non-inferiority margin as how far a metric may deteriorate before it is considered a failure.
Setting the margin, in Spotify’s account, forces the team to state how much it is willing to give up on one metric so that another improves. For an FDE, the thing that improves is usually processing time or cost.
The thing allowed to slip a little is usually accuracy.
Medicine has done this for a long time. Walker and Nowacki, in a tutorial published in J Gen Intern Med, call the choice of the margin δ the most important step in equivalence and non-inferiority testing. Althunian and colleagues add that the margin must rest on both clinical and statistical reasoning.
Applied to client work, the domain half is a question: what does each additional error cost the client, and how many errors does the new benefit pay for? The statistical half tells you how much data that margin will cost.
A worked case: triaging insurance claims
Take a hypothetical insurer that triages claims by hand, with 92% accuracy on historical data, and wants AI to take over the step.
You ask the head of the department: at what point would an accuracy drop be unacceptable? She says 2 percentage points, because a claim routed down the wrong path has to be redone, and the time saved covers only about that much.
Spotify notes that the tighter the margin, the more statistical power it requires. Walker and Nowacki write that sample size depends directly on the margin. For two independent groups, a one-sided test at α = 2.5% and 80% power, the approximate formula is n per group ≈ 7.84 × [p₁(1−p₁) + p₂(1−p₂)] / δ². Plugging in p = 92% gives:
| Margin δ | Claims needed per group (approx.) |
|---|---|
| 5 percentage points | about 462 |
| 2 percentage points | about 2,885 |
| 1 percentage point | about 11,540 |
Bring this table into the room. A client who wants a 1-point margin “to be safe” will have to label more than 11,000 claims per group. Once they see that price, the conversation about the risk they will actually accept becomes far more realistic.
Suppose the margin is set at 2 points and you run 2,900 claims per group. The AI scores 91.5%, the people 92%, a difference of −0.5 points. The standard error of the difference is about 0.72 points, so the lower bound of the 95% confidence interval is roughly −0.5 − 1.96 × 0.72 ≈ −1.92 points. That is still above −2, so the AI passes, if only just.
Now rerun it with 300 claims per group and the same rates. The lower bound falls to about −4.9 points, outside the margin.
A conventional test would report “no significant difference”, but as Walker and Nowacki warn, when the evidence for equivalence is not strong enough, the possibility that the two differ has not been ruled out.
You have proved nothing.
Is one good-looking metric enough?
No. Spotify’s decision rule requires the new variant to be significantly non-inferior on every guardrail metric, in addition to the condition on the success metric.
In the insurance case, overall accuracy could pass while the rate of misrouted high-value claims rises. Each guardrail like that needs its own margin, agreed at the same time.
Each metric also has to be written specifically enough. Anthropic’s guidance on success criteria gives an example: replace “good performance” with “accurate sentiment classification”. With a client, that level of specificity means stating which dataset is measured, who labels the correct answer, and what the denominator of each rate is.
When the grader is also an LLM
Many projects do not measure against existing labels but use an LLM as a judge, so the question becomes whether the LLM can replace the human raters. The alt-test from Calderon, Reichart and Dror handles this with a value ε, set to weigh cost against benefit.
Put simply, ε works like a non-inferiority margin for the judge: it expresses how much the client is prepared to concede in return for not having to hire raters. For experts, who are reliable but expensive and sometimes hard to recruit, the authors suggest ε = 0.2.
In most cases 50 to 100 samples are enough, with at least three annotators.
One point needs care. The AltRA-Test paper, in which the margin scales with the level of disagreement between humans, warns that when raters agree very little, even a nearly meaningless LLM judge can pass.
So before presenting results, measure whether the client’s own experts agree with one another. If they do not, the first job is to fix the labeling guidelines; only then is it worth turning to the judge.
What to do in the first week on site
First, measure the baseline of the existing process on real data, not the figure in a slide deck. Then sit down with the person responsible for operations, ask about the cost of an error and the value of speed, and propose a few margins with the matching sample-size table.
Finally, write into the pilot agreement the primary metric, the guardrail metrics, the margin for each, the sample size and the rule: the lower bound of the confidence interval for every metric must lie above −δ.
Walker and Nowacki stress that the margin must be set before data are recorded. That is why it needs a signature before the first row of data is run. A margin set after seeing the results is a negotiation, and the client will notice.
The mistakes that sink pilots
The first is loosening the margin after seeing the AI score 89%. The second is reporting “no difference” from a small sample as though it were evidence of equality.
The third is guarding only an aggregate metric and ignoring the high-risk claims. The fourth is setting the margin from statistics alone without asking the people who know the business, or the reverse.
For your career, this is a skill worth putting on a CV with numbers, for example: “agreed a 2-point non-inferiority margin with the client before the pilot; evaluated on 2,900 claims per group”.
In interviews, be ready to walk through one such case from start to finish, from the first question to the client through to the signed rule, because it shows you can turn a vague worry into a measurable number.
The best sign-off meeting is usually the shortest, because everyone only has to compare the measured figures with a rule signed in advance.
Was this article useful?
Thanks for the feedback!
9 sources
- Better Product Decisions with Guardrail Metrics (Spotify Confidence) · 2026-05-12 (last updated)
- non inferiority margin (Spotify Confidence glossary) · 2026-07-03 (last updated)
- Risk-Aware Product Decisions in A/B Tests with Multiple Metrics (Spotify Engineering) · 2024-03-05
- Understanding Equivalence and Noninferiority Testing · 2010-09-21
- Althunian et al., overview of defining the noninferiority margin and analysing noninferiority trials (Br J Clin Pharmacol) · 2017-04-06
- The Alternative Annotator Test for LLM-as-a-Judge: How to Statistically Justify Replacing Human Annotators with LLMs · 2025-01-19 (v1); v4 2025-08-08
- AltRA-Test: An Alternative Annotator Test for LLM Judges Without Shared Annotators
- Define success criteria and build evaluations (Claude Platform Docs)
- Evaluation best practices (OpenAI API docs)