ai-code-detector

Original research · November 2026

AI Code Detection Accuracy: What Our 2026 Evaluation Data Actually Shows

We run an AI code detector, so instead of telling you how accurate we are, we are publishing the evaluation itself: the frozen test set, the real-world study where our own detector flagged human code, the fix, and what production traffic actually looks like.

Evaluation date

October 8, 2026

Frozen set, re-run when the model, threshold, or input pipeline changes.

Frozen samples

1,922

Human-written and AI-generated, scored under production normalization and threshold.

Languages covered

6

Python, Java, C++, JavaScript, HTML, Lua — with a stated human-side gap in three.

Update cadence

Every round

This page changes with each evaluation round, including failure modes we have not fixed yet.

Method

Everything below comes from three data layers: a frozen evaluation set we can re-run, a staging study we ran to explain a failure, and aggregate statistics from production traffic.

The three data layers behind this page.
LayerData setSizeWhen
L1 · Frozen evaluation setHeld-out set built on the public CoDET-M4 benchmark and a GPTSniffer Java set plus our own multi-language set; AI samples come from public-benchmark frontier outputs, commercial API models, and open-source models run locally.1,922 samples (frozen, checksum manifest on file)Frozen October 1, 2026; re-tested October 8, 2026
L2 · Staging attribution studyHand-constructed and real-world samples: library-style snippets (×8), zero-import controls (×3), longer human samples (×5), AI anchors (×2).18 + 11 re-testedNovember 1, 2026
L3 · Production aggregatesRead-only aggregate SQL over retained scan results. No user IDs, no code content, no original file names — counts and averages only.242 jobs / 103 retained resultsOctober 8 – November 16, 2026

Reproducibility: every sample in L1 went through the same input normalization our production scanner uses and was scored at the same production threshold, on the same engine version that runs in production (codebert-a5-1.0.0). The frozen set's checksum manifest (48 files) re-verified with zero mismatches, and re-run anchors matched the frozen values within tolerance — the pipeline did not drift, so the numbers are stable.

Samples with fewer than 10 non-empty lines (after normalization) are not scored.

Finding 1: The pipeline is the model

In our frozen evaluation set of 1,922 samples, 230 (12.0%) changed prediction after production-equivalent input normalization — all 230 in the AI direction.

Prediction flips in the frozen set of 1,922 samples, before vs. after production-equivalent normalization.
CutFlipped predictions
All samples230 of 1,922 (12.0%) — all 230 toward the AI side, 0 toward human
By languagePython 21.8% · Java 5.7%
By sample sourceLocally-run open-source models 56.8% · public-benchmark AI samples 0%

The mechanism, from our staging attribution work: normalization removed a spurious correlation in which a trailing newline made files look human. Before the fix, human files ending in a newline received visibly more human-leaning scores; once every sample was trimmed uniformly, all samples faced the model's real decision surface. The most useful lesson here is that a detector's "accuracy" is, to a large degree, a function of the data pipeline — not just the model.

Finding 2: Benchmarks said zero false positives. Reality said 18 out of 18.

In a November 2026 staging study of 18 real-world human-written snippets (13–57 lines), all 18 received scores of 0.69 or higher — scores that, at our production threshold, fall in the band we label high. The set included an excerpt from the CPython standard library (score 0.98). In the same model's frozen evaluation set, no human-written sample was flagged at all.

The November 1, 2026 staging study: real-world human-written snippets, scored by the same model that produced zero false positives on the frozen set.
Sample groupnLinesScore rangeScored high
Library-style usage (requests, pandas, Flask, logging — hand-written)813–200.860–0.9928/8
Zero-import controls (business logic, hand-rolled parsing, fizzbuzz)316–200.924–0.9703/3
Longer human samples (competition Dijkstra, tic-tac-toe, input() games)515–570.696–0.9885/5
Verifiably human open source (CPython textwrap.py excerpt)1160.9801/1
CSS snippet control1140.9741/1
Total real-world human code1813–570.696–0.99218/18
AI anchors (ChatGPT-style, ×2)223–450.955–0.9662/2

Benchmark performance and real-world behavior can decouple completely: zero false positives on a frozen benchmark and 18 out of 18 false positives on real pasted snippets were simultaneously true of the same model. This is the gap behind the industry's "99% in the lab, broken in the classroom" pattern — measured, in our own product.

Finding 3: No threshold could fix it

In the short-input band, the human and AI distributions do not just overlap — they invert. One AI anchor scored 0.955, lower than a human library-style sample at 0.992. There is no line that separates the two: raising the threshold to 0.18 changed nothing, and even at 0.5 every flagged sample would still have been flagged. Suppression heuristics failed too — the zero-import human controls still scored 0.924–0.970, while real AI code uses libraries just as heavily.

So we changed the product, not the threshold. Since November 1, 2026, inputs under 50 non-empty lines are capped at the medium band — the score is still shown, with a "mixed signals; manual review recommended" reading. In re-testing, all 11 library-style and control samples stopped landing in the high band, and the behavior of inputs at 50 lines or more is unchanged.

Production then confirmed the fix independently. After we capped verdicts for inputs under 50 non-empty lines (deployed November 1, 2026), 6 production results with scores ≥ 0.14 were shown as medium instead of high in the following two weeks; zero short inputs were shown as high.

Inputs under 50 lines averaged a score of 0.48 in retained production results, versus 0.18 for 50–199 lines and 0.32 for 200+ lines.
Length band (total lines)nMean scoreHighMediumLow
Under 50 lines130.482166
50–199 lines130.178526
200+ lines770.3236287

Two independent data layers point at the same conclusion: the lab finding (short inputs are not separable) and the production observation (short inputs carry the highest average scores and the misclassification risk) reinforce each other. That agreement is the backbone of this page's credibility.

Finding 4: Our explanation signals have limits too

Our naming-style signal showed no separation across verdict bands in production data (band means 0.957 / 0.963 / 0.959) — which is why we treat the four signals as explanations, not verdicts. In real-world code, naming conventions are saturated: nearly everything scores high, so the signal cannot distinguish anything. The four signals are computed alongside the score and never enter it.

We also tested whether the model's attention could explain itself. It could not: when we aggregated the classifier's final-layer token attention to lines, the top-5 attributed lines were all token-dense boilerplate such as System.out.println(...) (attention share 4–11%), with no defensible correspondence to AI-style semantics. That is why our reports show chunk-level scores and signal context — and why we do not ship per-line verdicts. Tools that claim line-level certainty are claiming more than the technique supports.

What production traffic actually looks like

These are aggregate counts from October 8 to November 16, 2026 — no user identifiers, no code content, no original file names. Across 103 retained production results, the median score was 0.26; 68 were in the high band, 16 medium, 19 low.

Production volume by scan type, October 8 – November 16, 2026. All results ran on engine version codebert-a5-1.0.0.
MetricValue
Total jobs242
Single synchronous scans148
Single asynchronous scans65
Batch jobs29 (26 done, 3 running)
Retained results103 — anonymous scans are never persisted, and synchronous single scans record only the job row, by design
Score distribution across the 103 retained results: median 0.26, mean 0.325.
Score bandResults
0.0–0.122
0.1–0.218
0.2–0.314
0.3–0.416
0.4–0.510
0.5–0.610
0.6–0.75
0.7–0.82
0.8–0.90
0.9–1.06
What people actually submit (106 file records, grouped by extension only).
Formn
No extension (pasted snippets)65
.py25
.cpp / .c7
.zip (batch archives)3
.java2
Other (.rc / .jar / .ipynb / .txt, one each)4

Submissions are large: the median retained result is 4,281 tokens, and the 90th percentile is 7,304 — more than half of retained samples exceeded the synchronous single-block path (a 512-token window, at most 4 blocks, roughly 2,048 tokens) and were handled by the multi-block or asynchronous pipeline. We also know what we do not know: pasted snippets are almost never language-labeled (104 of 106 records), a gap in our own instrumentation that we disclose rather than paper over.

How this compares to independent research

We are not the only ones measuring this. In an independent 5,069-sample study (ICSE-SEET 2024), a leading general-purpose detector scored near chance on code (accuracy ≈ 0.497). The table below lists third-party results — the numbers are theirs, from the cited papers, not ours.

Third-party results, quoted from the cited papers.
StudySetupKey numbers
arXiv:2401.03676 (ICSE-SEET 2024)5,069 samples across 5 detectorsGPTZero code detection accuracy ≈ 0.497; GLTR 0.4841–0.7693, highly sensitive to prompt variants
arXiv:2307.09381v2 (GPTSniffer, ASE 2023 — the paper baseline of our training recipe)Same-distribution paired testAccuracy 0.99
Same paperCross-distribution test (closer to the real world)Accuracy 0.62; recall on the human class only 0.25

Three takeaways. First, the gap between "90%+ accuracy" marketing and independent measurement is documented in the literature, not just alleged. Second, the decay from 0.99 same-distribution to 0.62 cross-distribution runs in the same direction as our own lab-versus-reality findings above. Third, a screening workflow — narrowing 100 submissions down to the 10–20 that deserve human review first — remains useful even in the 60–85% accuracy range, which is exactly why we position every score as a screening signal.

Limitations & fair use

  • Benchmark bias. Our human samples come from public benchmarks (competition and GitHub-style code), which are cleaner than real pasted snippets — we know, because that gap is exactly what Finding 2 caught. We say so first.
  • Coverage gaps. JavaScript, HTML, and Lua had AI-generated samples but no human-written ones in this round. We show the gap rather than round it away.
  • Channel bias. Production distributions only cover retained results from signed-in users. Anonymous scans are never persisted — that is a privacy design choice, and its cost is incomplete observation.
  • Observational data. Users decide what to paste. The production score distribution cannot tell you how much of the world's code is AI-written.
  • Screening signals, not verdicts. A score is a reason to look closer, never a conclusion. For teachers, the correct use is narrowing 100 submissions down to the 10–20 that deserve a human review first — not convicting by score. See the screening workflow for classrooms.
  • Failure modes, published. This page is updated with every evaluation round. Known failure modes — short inputs, library-heavy code — are listed as-is, with before-and-after fixes side by side.

Questions

How accurate are AI code detectors in 2026?

Independent research paints a sobering picture: in a 5,069-sample study presented at ICSE-SEET 2024, a leading general-purpose detector scored near chance on code (accuracy ≈ 0.497). Our own data says the honest answer is layered, not a single number: our frozen evaluation set of 1,922 samples behaves differently from real-world pasted snippets, and we publish both layers on this page instead of one percentage.

Why did your own detector flag human code — and what did you do about it?

In a November 2026 staging study of 18 real-world human-written snippets (13–57 lines), all 18 received AI-likelihood scores of 0.69 or higher — including an excerpt from the CPython standard library (score 0.98). We found that no threshold could separate short human code from AI code in that band, so since November 1, 2026, inputs under 50 non-empty lines are capped at the medium band with a manual-review note. In the following two weeks, 6 production results with scores ≥ 0.14 were shown as medium instead of high, and zero short inputs were shown as high.

Can an AI code detector prove that code was AI-generated?

No. An AI code detection score is a screening signal — a reason to look closer, never a conclusion. For a classroom, the correct use is to narrow 100 submissions down to the 10–20 that deserve a human review first, not to convict anyone by score.

What code can your detector not evaluate?

Submissions with fewer than 10 non-empty lines of code (after normalization) are not scored at all — they are rejected rather than guessed at. Separately, our October 8, 2026 evaluation round contained AI-generated samples in JavaScript, HTML, and Lua but no human-written ones, so behavior in those languages is extrapolated, not measured.

How often is this page updated?

This page is updated with every evaluation round — whenever the model, the scoring threshold, or the input pipeline changes. The next round will add human-side validation samples for JavaScript, HTML, and Lua, and known failure modes (with before-and-after fixes) are listed as we find them.

Read the score the way we read it: a signal for a second look.

Keep reading