Last spring I flagged 14 of 62 submissions in my data structures course as probably AI-written. Nine of those students had done nothing except write very ordinary Java. That is the shape of most AI code detection false positives: the detector was not malfunctioning in any way I could point to. It was doing exactly what it was built to do, which is estimate the probability that a stretch of tokens came from a language model. The problem is that a syllabus violation is a claim about a person, and a probability over tokens is not the same kind of object.
Over three cohorts I ran peer similarity, web similarity, and an AI score against every file, then read all the flagged work myself. An AI score on its own turned into a confirmed violation about 26% of the time in my sample. An AI score that agreed with a peer similarity match converted 85% of the time. What follows is the triage framework I built around that gap, along with the parts of it I do not trust yet.
Method, sample, and why you should discount both
The sample is 1,412 submissions from three cohorts (Spring 2024, Fall 2024, Spring 2025) across four assignments each. Two courses: an intro Python course and a data structures course in Java. Every submission went through a code plagiarism checker with all three engines enabled: cohort peer matching, web and GitHub matching, and AI generation scoring. Nothing was pre-filtered.
Ground truth is my own judgement after reading the file and, where the file was ambiguous, a ten-minute conversation with the student. That is not an oracle. It is one instructor's read of a few hundred borderline cases, and it inherits whatever biases I have. I say this up front because the rest of this post leans on those numbers, and a study of one bootcamp is not a study of anything.
What the sample does have going for it is that it is not self-reported. Nobody was asked whether they used ChatGPT. The flags are what a detector produced on real coursework, and the confirmations are what survived a conversation.
| Signal | Submissions flagged | Confirmed violations | Precision |
|---|---|---|---|
| Peer similarity ≥ 60% | 138 (9.8%) | 98 | 71% |
| Web similarity ≥ 40% | 88 (6.2%) | 77 | 88% |
| AI score ≥ 70 | 161 (11.4%) | 66 | 41% |
Some submissions were flagged by more than one signal, so the rows overlap. The pattern that matters is the ordering. Web matches are the most reliable because you can point at a GitHub commit with a timestamp. Peer matches are next because two students producing the same tokens in the same order is a small miracle worth explaining. AI scores are last, and not by a small margin.
Why the AI score is the weakest column
A plagiarism detector compares your submission to other artifacts. It either finds a match or it doesn't, and when it finds one it can show you the lines. An AI detector compares your submission to a statistical model of what generated text looks like. There is no second artifact. The output is a number, and the number moves when you change the prompt, the temperature, the model version, or the length of the file.
That last one gets underweighted. Perplexity estimates over a 30-line file are noisy in a way that over a 3,000-word essay they are not. A 22-line Python solution to "reverse a linked list" gives a detector almost nothing to work with, and it will sometimes produce a confident-looking 78 anyway.
The research literature has one finding that should be taped to every AI detector dashboard. Liang et al., in Patterns (2023), ran several detectors over TOEFL essays written by non-native English speakers and over essays by US-born students. The detectors flagged 61.22% of the TOEFL essays as AI-generated versus 5.19% of the US student essays. The mechanism is straightforward: formal, uniform, slightly unusual phrasing reads to a detector as low-perplexity, and low-perplexity reads as machine.
Nobody has published the code equivalent of that experiment. I would like to be wrong about this, and if you have run it on a few thousand source files, I want to read your write-up.
In my own sample, the students most likely to trip the AI score with innocent work were the ones writing in their second or third language, using very regular formatting, and commenting heavily in complete sentences. Their code was fine. It just had low variance.
Where AI code detection false positives actually cluster
Four patterns account for almost every innocent flag I have chased.
Provided scaffolding. If you hand out a starter file with imports, a class skeleton, and an I/O template, every submission looks identical in those regions. Token-based and fingerprinting engines handle this reasonably well when you configure a minimum match length. They handle it badly when you leave the default. Codequiry's minimum match length ships generous on purpose, and if you never touch it, everybody who pastes the scaffold lands in the low 30s on peer similarity. I spent a week of one semester chasing that before I read the settings page properly.
Narrow problems with canonical answers. Ask 60 students to reverse a linked list and you will get 60 files that differ mostly in variable names. This is not plagiarism. It is a question with one good answer. A token-based engine that normalizes identifiers will see through the renaming, which is the correct behavior for detecting copying and the wrong behavior for concluding anything about it.
// Student A
for (int i = 0; i < arr.length; i++) { sum += arr[i]; }
// Student B, after "rewriting it in their own words"
for (int k = 0; k < arr.length; k++) { total += arr[k]; }
Those two lines are token-identical after normalization. They are also what any competent person writes. The detection is correct; the inference is the part that needs a human.
Framework boilerplate. A Django view, a React component, a JUnit test class: these have shapes the framework dictates. When half the class submits a test file with the same `@BeforeEach` setup, the similarity engine is not confused. It's reporting accurately on a genuine similarity that carries no information about authorship.
Short files. Anything under roughly 40 lines is a coin flip. I have stopped putting short files in front of students entirely, and I now tell TAs to treat any AI score on a short file as noise.

A three-signal triage framework
The framework is a routing sheet, not a scoring formula. It exists to answer one question per submission: does this go to the student, to my own reading pile, or nowhere. The ordering is the whole idea. Evidence gets ranked by what it can prove, and the AI column is never allowed to make the decision on its own.
Pass one: bucket, do not normalize. A 71% from MOSS and a 71% from JPlag do not mean the same thing, because the tokenizers and match algorithms differ. Cross-tool percentage comparisons are meaningless. Compare only within a tool and within a cohort, and only against the same assignment.
Pass two: rank by evidentiary strength. A web source with a commit date before your deadline is the strongest thing you will get. It is an artifact with a timestamp. A peer match with a real token count is second. An AI score is a prior, and priors do not open disciplinary cases.
Pass three: escalate only to a specific span. If you cannot point at line ranges and describe in plain language what was compared, you do not have a case yet. You have a number.
# triage.py -- order matters, and the AI column never gets the last word
def triage(row):
"""row: one result with peer_pct, web_pct, ai_score,
matched_tokens, web_source_dated_before_due."""
if row["web_pct"] >= 40 and row["web_source_dated_before_due"]:
return "refer" # a timestamped source is the strongest evidence we get
if row["peer_pct"] >= 60 and row["matched_tokens"] >= 40:
return "refer"
if row["ai_score"] >= 70 and row["peer_pct"] >= 40:
return "escalate" # talk to the student, bring the diff
if row["ai_score"] >= 70:
return "review" # read it yourself before you say anything
return "clear"
Here is what that produces on my sample. The middle row is the finding I keep coming back to: the AI signal is nearly useless in isolation and quite good when it corroborates something else.
| Combination | Disposition | Cases | Confirmed |
|---|---|---|---|
| Web match, source dated before deadline | Refer | 88 | 88% |
| Peer ≥ 60% with ≥ 40 matched tokens | Refer | 138 | 71% |
| AI ≥ 70 and peer ≥ 40% | Escalate to interview | 41 | 85% |
| AI ≥ 70, peer < 40% | Review only | 120 | 26% |

The practical consequence: I stopped sending AI-only cases forward entirely. Not because I think those students are innocent. Because a 26% precision rate means that for every three accusations I make, two land on someone who did nothing, and the cost of that is paid by the student and by the next student who hears about it. If a case is real, it usually shows up somewhere else eventually: in the interview, in the next assignment, in a commit history.
The evidence packet you actually hand over
When a case does go forward, the packet is four things and no score. The matched line ranges with token counts. The source, meaning a repository URL with a commit date or the peer submission with an ID. A one-paragraph plain-language description of what the tool compared (token sequence, tree structure, formatting-normalized identifiers). And the specific clause in the policy that the behavior maps to.
Give the student the diff, not the percentage. A number invites an argument about the number. Line 44 through line 61 invites a conversation about line 44 through line 61.
For AI cases specifically, the interview does the work the file cannot. Ask the student to walk through one function and change one condition. Students who wrote the code, including students who used AI to explain a concept and then wrote it themselves, can do this. Students who pasted a whole solution from a chat window generally cannot, and the reason is not that they are poor liars. It is that they never built the model of the problem in the first place.

How the tooling lines up
Most of the friction I had early on was tooling shape rather than detection quality. MOSS is still excellent at what it does and still returns results as a URL that expires in about two weeks, which is a genuinely bad fit for a workflow where you need to open a case in week six. JPlag 5.x has a real report viewer now and does solid token-based matching with tree normalization for Java and C++. Dolos, out of ETH Zurich, is tree-sitter based, open source, and pleasant to run locally.
None of the three produce an AI signal. That is not a criticism, it is a scope difference, and for a lot of courses peer similarity is the whole job. It just means the triage sheet ends up with a column you fill in by hand somewhere else.
| Tool | Peer similarity | Web / GitHub sources | AI score | Interface |
|---|---|---|---|---|
| MOSS (Stanford) | Yes, winnowing fingerprints | No | No | Email + expiring URL |
| JPlag 5.x (KIT) | Yes, token-based with tree normalization | No | No | CLI + local viewer |
| Dolos (ETH Zurich) | Yes, tree-sitter AST | No | No | CLI + web dashboard |
| Codequiry | Yes, token + AST + fingerprinting | Yes | Yes | Hosted dashboard + REST API |
I moved to Codequiry for the boring reason: the framework above needs all three signals in one row per submission, and it is the only one of the four that puts them there. The AI code detector scores per file, the peer and web engines run on the same submission, and the review queue sorts by cohort outlier so I am not scrolling 1,400 rows looking for the ones that matter. If you are running MOSS today and only want peer matching, the Codequiry vs MOSS comparison is a fair place to start, and staying with MOSS is a defensible answer.
What I would not do is bolt a separate AI detector onto a separate plagiarism tool and then try to reconcile two dashboards with different thresholds. That is how you end up making decisions from numbers that were never on the same scale.
What this framework does not solve
Three gaps, in order of how much they bother me.
There is no public benchmark for AI-generated code detection on student work with ground truth. Clone detection has BigCloneBench and twenty years of precision/recall comparisons. AI code detection has vendor evaluation sets. Until somebody builds the equivalent, every number in this post, including mine, is one institution's anecdote with a spreadsheet attached.
Detector behavior moves with the model. A score tuned against one generation of language models does not transfer cleanly to the next, and the direction of drift is not predictable. Recalibrate every semester or your thresholds are describing a world that ended.
And the framework has nothing useful to say about the hardest case: a student who uses AI to understand a problem, then writes the solution themselves. The file looks like a person wrote it because a person did. My honest position is that this is not a violation in most course policies, and the ones that forbid it should say so explicitly rather than hoping a detector will enforce an ambiguous rule. If you want the longer version of that argument, the code plagiarism checker for teachers walkthrough gets into policy design.
Questions I get from other instructors
Is a high AI score enough to confront a student? Not on its own. Use it to decide what to read first. Confronting someone on a 26%-precision signal is how you generate a grievance and a reputation in the same week.
Do detectors get better with bigger files? Yes, substantially. Files over a few hundred lines give the statistical signals something to work with. Anything under 40 lines I treat as noise regardless of the score.
Should I tell students which tools I run? Yes. Publish it in the syllabus, run a demo on the first day using your own solution, and show them the similarity report for it. Detection you have announced works better as deterrence than detection you have hidden.
If you want to run the three-signal version of this on your own cohort, the code plagiarism detection side of Codequiry will give you the peer, web, and AI columns in a single check, which is the minimum the framework needs to function.