Why AI Detectors Are Biased Against STEM Writing and Code
By Dusan Boljevic · AI/ML Engineer at TheChecker.AI

Quick answer
A detector's accuracy depends heavily on what it's reading. A new peer-reviewed study of more than 280,000 real student samples found today's AI detectors perform acceptably on long essays and theses, fail badly on short coursework, and are barely better than a coin flip on programming code. Worse, the writing style that gets flagged hardest isn't sloppy prose — it's formulaic, disciplined, rule-following prose, the exact style STEM disciplines train students to produce. A detector score still means something. It just doesn't mean the same thing in every subject, and pretending otherwise is how honest students end up defending themselves against a false accusation.
The Study: 280,000 Samples, 13 Detectors, Three Very Different Answers
Yicheng Sun, Yihan Liao, and Xiaoxue Ma report in Computers & Education (Volume 249, March 2026) a record-setting real-world detector evaluation. The work draws on student work archived at a university from 2016 to 2021, a period that pre-dated ChatGPT. Their three datasets, StuTask for coursework, StuThesis for theses, and DataCode for engineering code, encompass more than 280,000 paired human/AI samples. The researchers ran 13 leading detectors, commercial and open-source alike, across all three datasets.
The analysis demonstrates a clear separation of results along genre lines. Detectors managed to perform reasonably on long-form theses, as the extended text allows perplexity and burstiness patterns to become evident. Short coursework, however, produced a drop in performance; the brevity of the material offers insufficient signal for reliable detection. In the realm of engineering code, several detectors achieved performance at or below random chance, meaning that a simple coin toss would rival a grader's decision. Of particular concern, one widely used commercial detector failed to identify about three-quarters of AI-generated code, according to education researcher Med Kharbach's review of the full study.
That alone should give any school running detectors across every subject equally reason to pause. But the paper's sharper finding is about who gets falsely flagged, not just what gets missed.
Why Careful, Rule-Following Writing Gets Punished
The study identified what its authors call a systematic bias against STEM writing. Technical prose is formulaic by design: passive voice, fixed terminology, standardized methods sections, predictable sentence structure. That's not a flaw in a lab report or a code comment — it's the discipline working as intended. But formulaic, predictable phrasing is exactly the statistical signature perplexity-based detectors are built to flag as AI-generated.
The result is a bias that lands hardest on the students least likely to deserve it. As the authors put it, misclassifying rigorous, disciplined human work "is not only unfair but also a potential penalty for upholding academic standards." A student who writes a precise, conventionally structured methods section carries a higher false-accusation risk than a classmate writing a looser, more idiosyncratic essay in the humanities — for following the rules of their own field correctly.
This isn't an isolated finding. It builds directly on Liang et al.'s Stanford research, which found detectors flagged non-native English speakers' TOEFL essays as AI-generated at rates over 61%, because lower lexical variety reads as low perplexity to the same statistical model (we covered that research in Can AI Detectors Be Wrong?). The new study extends that same mechanism from individual writers to entire academic disciplines. Two different groups of students, punished by the same math, for the same underlying reason: writing the way they were correctly taught to write.
The Incentive Structure Runs Backwards
Within the data a second problem lurks. It is easy to miss if not carefully examined. Detection difficulty and task complexity diverge in opposite directions. Such divergence conflicts with the principles of a fair system.
Simple, factual writing prompts produce predictable AI output that's comparatively easy to catch. Complex reasoning, long technical documents, and real code push AI-generated text closer to expert human work — and that's exactly where detectors struggle most. The practical effect is a reverse-selection problem: the highest-stakes, most complex assignments carry the lowest detection risk, while low-stakes, simple tasks carry the highest. A grading system built on detector scores ends up catching the wrong things — small, low-stakes lapses on easy assignments, while sophisticated AI-assisted work on the assignments that matter most slides through with a clean score.
The study also tested how real students actually try to lower their score, interviewing student subjects about their own editing habits and then running those exact edits back through the 13 detectors. Simple synonym substitution alone pushed more than half of AI-generated text past detection. Combining several light-touch edits pushed the evasion rate to 88% — meaning nine out of ten lightly polished AI submissions cleared every detector tested, including the one that had performed best on unedited text. That's not a loophole a determined bad actor found. It's the baseline vulnerability of the entire category, on ordinary edits any student might make without thinking about detection at all.
The article does not aim to guide you through the editing process; that would miss the essential lesson, and it's the same miss our piece on humanizing AI text already covers. What the study actually demonstrates is that relying on a single metric as conclusive evidence is flawed. Whether the score is high or low, it cannot serve as forensic proof.
What Actually Works: Process, Not Just a Percentage
The paper's own conclusion isn't "detectors are useless, throw them out." It's narrower and more useful than that: a detection score should function as one weak signal among several, never the sole basis for a decision. The authors recommend triangulating a score against draft and revision history, version timestamps, and — where it matters — a short conversation with the student about their own process. That's the same "process over verdict" recommendation that's been building across the research this blog has already covered, from how detection actually works under the hood to what a detection percentage genuinely tells you.
The practical version of this for a teacher or an editorial team: treat a detector as a first-pass filter that tells you where to look closer, not a verdict that ends the conversation. On a code assignment or a tightly structured lab report, expect the tool to be noisier than usual, and weigh a flag accordingly. On any assignment, a percentage plus a five-minute look at the highlighted sentences and the student's draft history will catch real cases and clear honest ones far better than the percentage alone.
According to research, that kind of second-look input is exactly what a detector should do. It isn't meant to replace reading the actual work; it's a tool to help you dig deeper. Think of it as a safety net that flags potential issues, but you still need to sift through the text yourself. See it for yourself: try the free demo.
FAQ
Does this mean AI detectors don't work at all? I've found that AI detectors do a pretty solid job on long-form pieces, like theses. When you drop in short coursework or pure code, they start to stumble. That same pattern shows up when the writing is formulaic and technical, those bits get a hit of bias. Still, the score you get from a detector can give you useful clues. Just remember the reliability isn't the same for every type of writing: long-form works get a better read than short coursework or code. In short, AI detectors can be trustworthy, but they're not equal across all formats.
Should schools stop using AI detectors on code assignments? The study's own data suggests detectors are close to unreliable on engineering code — several performed at or below chance. Treating a code-assignment flag the same way you'd treat a flag on a five-paragraph essay isn't supported by this research.
Why would rewriting AI text with synonyms fool a detector? Perplexity-based detectors measure how statistically predictable your word choices and sentence rhythm are. Swapping words for synonyms changes the surface-level statistics the detector is measuring without changing the underlying content — which is precisely why the researchers frame this as a vulnerability in the detection approach, not a legitimate way to "clean up" writing.
What should a teacher or editor actually do with a detection score? Use it as a starting point, not an ending point. Look at which sentences are flagged, compare the writing to the person's usual voice or past drafts, and if something feels off, ask directly rather than treating the number as settled proof either way.
Dusan Boljevic
AI/ML Engineer at TheChecker.AI
Dusan Boljevic writes at TheChecker.AI, covering how AI-text detection works and how educators and teams can use it responsibly.
Related posts

Why Does My Essay Get Flagged as AI? What to Actually Do About It
A flag is a probability estimate, not a verdict. Here's what actually triggers false positives, a real case showing the cost of getting it wrong, and the exact steps to take before you panic.
Read more
AI Detection Score Meaning: What That Percentage Actually Tells You
A 62% AI score is not 62% of your text. It's a probability, not a fraction. Here's what detector scores actually measure, and how to read one.
Read more
Is AI Detection Accurate? What the 2026 Research Actually Shows
Two new 2026 studies and the field's 2023 baseline, compared: false positives are down sharply, but catching fully AI-generated text still varies wildly by tool, and hybrid text defeats almost everyone.
Read more