DEV Community

Michael Wilson
Michael Wilson

Posted on

"0 false positives" isn't 0%: putting an interval on AI detector test results

When an AI detector study says a tool flagged none of the human texts it tested, it's tempting to read that as a 0% false positive rate. It isn't. It's 0 out of some number, and that number decides how much the zero is worth.

I came across Epoch AI's 2026 test in a roundup of published false positive rates for AI detectors. Epoch used 495 human passages of about 500 words each. Two detectors flagged none. The third flagged 19 of 495 passages (3.8%).

The fix: a Wilson score interval

For a proportion like "flagged k out of n", the Wilson score interval gives you a range that behaves sensibly even when k is 0 or n is small. The textbook "p ± 1.96 × standard error" interval breaks down there: with zero flags it collapses to 0% to 0%, which says nothing.

Here's how to calculate the intervals in Python using only the standard library. The two 495-passage rows use Epoch's numbers. The other three are worked examples.

from math import sqrt

def wilson_interval(flagged, total, z=1.96):
    """95% Wilson score interval for a proportion."""
    if total == 0:
        return (0.0, 1.0)
    p = flagged / total
    denom = 1 + z**2 / total
    center = (p + z**2 / (2 * total)) / denom
    half = z * sqrt(p * (1 - p) / total + z**2 / (4 * total**2)) / denom
    return (max(0.0, center - half), min(1.0, center + half))

cases = [
    ("0 of 50", 0, 50),
    ("0 of 495", 0, 495),
    ("19 of 495 (3.8%)", 19, 495),
    ("1 of 1,096", 1, 1096),
    ("0 of 200", 0, 200),
]
for label, k, n in cases:
    lo, hi = wilson_interval(k, n)
    print(f"{label:>18}: {k/n:6.2%}  95% CI {lo:6.2%} to {hi:6.2%}")
Enter fullscreen mode Exit fullscreen mode

Output:

           0 of 50:  0.00%  95% CI  0.00% to  7.14%
          0 of 495:  0.00%  95% CI  0.00% to  0.77%
  19 of 495 (3.8%):  3.84%  95% CI  2.47% to  5.92%
        1 of 1,096:  0.09%  95% CI  0.02% to  0.52%
          0 of 200:  0.00%  95% CI  0.00% to  1.88%
Enter fullscreen mode Exit fullscreen mode

How to read it

  • 0 of 50 is compatible with a true false positive rate as high as about 7%. If you tested a detector on 50 of your own essays and nothing got flagged, that's encouraging, but it doesn't rule out one false flag in every 15 essays.
  • 0 of 495: the Wilson upper bound is 0.77% if we treat each passage as independent. Epoch tested five passages from each of 99 authors, so the interval may be too narrow if a detector makes similar mistakes on the same author's writing.
  • 19 of 495: with 19 flags in 495 passages, a 5% false positive rate is still within the 95% Wilson interval of 2.5% to 5.9%, assuming the passages are independent.
  • 1 of 1,096: in this worked example the observed rate is 0.09%, and even the upper bound is below 1% (0.52%).

The intervals only describe sampling noise, and only under the independence assumption. They say nothing about whether the test texts look like the ones you care about. In Liang and colleagues' 2023 study, detectors that handled essays by US eighth graders well wrongly flagged about 61% of TOEFL essays by non-native English writers, on average. A narrow interval on the wrong kind of text is still the wrong answer for your students.

If you're testing a detector yourself

  1. Test a large sample of texts you know were written by people. With a small sample, even zero false positives can leave you with a wide interval.
  2. Match your real material. Short answers, lab reports, essays by second-language writers: test with what you'll actually check.
  3. Report k and n alongside the rate. With 0 of 120, anyone can calculate the interval.
  4. Compare detectors inside one test. Different studies use different texts, so intervals from two papers aren't directly comparable.

Top comments (0)