DASS › AI evaluation › Eval sample size

AI evaluation · free tool

How many eval items do I need?

Size an eval set before you pay to label it. Choose what the eval has to answer, whether one model beats another or how accurate one model is, and get the number of items, a sentence for your eval plan, and R and Python code that reproduces it.

Your eval plan

What should the eval answer?

The difference between the two models that would change your decision, in percentage points.

The share of items one model gets right and the other wrong. Count it on a pilot of a few hundred items, and plan with the upper end if you're unsure.

Power

Significance level (two-sided)

Items that come in groups

For example, five questions about each document, or paraphrases of one prompt. Leave items per group at 1 if every item is independent.

Result

Sentence for your eval plan

Detailed results

Size the eval for the question it has to answer

Most eval sets are sized by what was easy to collect. The right size depends on the question. "How accurate is this model?" and "Is the new version better than the old one?" need different numbers, and the second usually needs several times more items. The calculator above handles both.

Is model A better than model B?

When both models answer the same items, every item they both get right, or both get wrong, says nothing about which is better. The comparison rests on the items where they disagree, and the paired McNemar test uses only those. So the number of items depends on two inputs: the smallest gap you need to detect and the share of items on which the models disagree. Connor's (1987) formula gives the items needed for a two-sided test:

n = (z1−α/2·√disc + zpower·√(disc − gap²))² ÷ gap²

For 80% power at α = .05:

Halving the gap roughly quadruples the items. More disagreement means more items for the same gap, not fewer, because a small net difference is harder to separate from chance when the models disagree often. The gap can never exceed the disagreement rate: a 3-point lead needs at least 3% of items where only the leader is right.

Where the disagreement rate comes from

Run both models on a pilot of a few hundred items and count the items where exactly one is right. The accuracy gap on a pilot is too noisy to plan with, but the disagreement rate is estimated well enough. To be safe, plan with the upper end of its likely range. Once the full eval is scored, the model comparison calculator runs the test.

How accurate is one model?

An accuracy score from a sample of items is an estimate, and its margin of error shrinks only with the square root of the item count: n = z² · p(1 − p) ÷ margin². Near 80% accuracy, a ±5-point margin at 95% confidence takes 246 items and ±3 points takes 683. Near 90% you need fewer (139 and 385), because scores near the ceiling vary less. With no idea what to expect, plan for 50%, the worst case (385 and 1,068).

Items that come in groups

Both formulas assume every item is an independent test. Items built from the same document, paraphrases of one prompt, or turns from one conversation tend to succeed or fail together. The standard correction multiplies the count by the design effect, 1 + (m − 1) × ICC, where m is the number of items per group and the ICC measures how alike items in a group are. Five questions per document with an ICC of 0.2 gives a design effect of 1.8, so the 870 items above become 1,570: 314 documents with five questions each. More groups beats more items per group.

Before you trust the number

Checked against R and Python

The calculations run in your browser and were compared with R (qnorm) and SciPy (norm.ppf) across 2,304 cases, using both Connor's formula and an independently derived odds-ratio form (Chow, Shao, & Wang, 2008). Every item count agreed exactly. An exact power calculation then checked the sizes against the tests themselves: at the sizes this page gives, the mid-p McNemar test that the model comparison calculator reports reaches the target power, landing at most about two points above it. The classic exact McNemar test falls one to four points short. When the gap equals the disagreement rate, the sizes are conservative. The code panel above reproduces your result in either language.

Sources

Want the reasoning in prose? Read How many test items does an AI eval need?

Common questions

Why does the disagreement rate matter so much?

When two models answer the same items, only the items where exactly one is right carry information about which is better. The paired McNemar test uses only those, so the count depends on how many there are and how lopsided they need to be.

Where do I get the disagreement rate?

Run both models on a pilot of a few hundred items and count the items where exactly one is right. The pilot's accuracy gap is too noisy to plan with, but its disagreement rate is good enough. Plan with the upper end of its likely range.

Why do more disagreements mean more items?

For the same net gap, models that disagree often trade wins back and forth, so the difference is harder to separate from chance. A 3-point gap needs 870 items at 10% disagreement and 1,742 at 20%.

What if my items come in groups?

Items built from one document or paraphrases of one prompt tend to succeed or fail together. The calculator multiplies the count by the design effect, 1 + (m − 1) × ICC, and rounds up to whole groups. Five questions per document with an ICC of 0.2 turns 870 items into 1,570.

Which test are these sizes for?

Connor's (1987) formula for the paired McNemar test. An exact power calculation showed the mid-p McNemar test, the one our model comparison calculator reports, reaches the target power at these sizes, landing at most about two points above it.

Is my data sent anywhere?

No. The calculations run in your browser, and nothing you enter is sent anywhere or stored.