How DetectGPT Works: The Curvature Trick Behind Zero-Shot AI Detection
03 Aug 2025
Most AI detectors you’ve heard of were trained on piles of labeled examples — this is human, this is machine, learn the difference. DetectGPT does something stranger. It never sees a single labeled example. Instead, it pokes at your text, watches how the numbers move, and makes a call from the shape of a probability curve.
That sounds abstract, so let’s walk through it. By the end you’ll get the one idea — curvature — that makes it tick, and why it’s both clever and genuinely limited.
Key takeaways
- DetectGPT is a zero-shot method. It needs no labeled training set, just access to a language model’s probability scores.
- Its core idea is curvature. Machine text tends to sit on a local peak of a model’s log-probability surface, so small rewrites almost always make it look less likely. Human text doesn’t behave that way.
- It works by perturbing your text many times, re-scoring each version, and measuring how far the score drops on average.
- It’s most accurate when it scores text with the same model that wrote it, and it degrades fast when it has to guess the source model.
- Like every detector, it outputs a probability, not proof.
What “zero-shot” actually means
Start with the word that gets thrown around: zero-shot. A normal classifier learns from data. You feed it thousands of human essays and thousands of AI-generated ones, it studies the patterns, and afterward it can guess which bucket a new sample falls into. The catch is obvious once you say it out loud — when a new model ships and writes differently, your classifier is suddenly judging 2026 text with 2023 habits.
DetectGPT, introduced by Eric Mitchell and colleagues at Stanford in 2023, throws out the training step. It doesn’t learn from examples at all. It only needs to ask a language model one question: how likely is this exact text, according to you? That number is a log-probability, and everything DetectGPT does is built on top of it.
If you want the deeper background on probability scoring itself — how models assign likelihoods token by token — we cover the statistics behind perplexity and burstiness in a separate post. Here we’ll assume you know a model can score text, and focus on the trick DetectGPT layers on top.
The curvature insight
Here’s the observation the whole method rests on. When a language model generates text, it tends to pick high-probability words. Not always the single most likely one, but it leans toward them. The result is that machine-written passages land on or near a local peak in the model’s probability landscape.
Think of it as a hill. Imagine all the slightly reworded versions of a sentence spread out around it. For text the model itself produced, the original sits close to the top of the hill. Almost any nudge — swap a word, reorder a clause — moves you downhill, toward lower probability. The text is perched on a maximum.
Human writing doesn’t sit on a peak. People choose surprising words, awkward phrasings, oddly specific details. So a human sentence is more likely to be sitting on a slope or in a dip. Nudge it, and the probability might just as easily go up as down.
That difference — does perturbing the text reliably push the score down, or does it wander both ways? — is what mathematicians call curvature. Machine text has strong negative curvature around it: you’re on a peak, and everything nearby is lower. Human text doesn’t. DetectGPT’s whole job is to measure that curvature without ever asking you to do calculus.
The algorithm, step by step
The mechanics are surprisingly hands-on. Here’s roughly what happens when DetectGPT evaluates a passage.
1. Score the original
First it asks the model for the log-probability of your exact text. Call that the baseline.
2. Perturb it, many times
Then it makes dozens of slightly altered copies. The original paper used a second model (T5) to mask out spans and fill them back in — so “the committee reviewed the proposal” might become “the board examined the document.” The meaning stays close; the surface wording shifts. The method does this dozens of times, up to around a hundred, to get a spread of variants.
3. Re-score every variant
Each perturbed version gets its own log-probability from the model.
4. Compare
Finally it asks: on average, how much lower are the perturbed scores than the original? If the drop is large and consistent, the original was sitting on a peak — a machine-text signature. If the perturbed versions are scattered, sometimes higher and sometimes lower, the curvature is flat, which points toward a human.
That average gap becomes the score. A bigger gap means “more likely machine-generated.”
A mini-scenario
Picture two paragraphs about a city budget. One was written by a model in a single pass. DetectGPT scores it, generates 50 reworded variants, and finds that 48 of them score noticeably lower than the original. Big, lopsided drop. High curvature. Flagged as likely AI.
The second paragraph was written by a tired human at 1 a.m., full of a weird tangent about parking meters and a sentence that trails off. DetectGPT runs the same process. This time the variants are all over the map — some score higher than the original, some lower. The average drop is small. Low curvature. Flagged as likely human.
Notice that neither result came from understanding the writing. The detector never knew what a parking meter is. It only measured how the probability moved when the words changed.
Why this is clever — and where it cracks
The elegance is real. No training data, no labeled corpus to maintain, and in the original experiments it beat the existing zero-shot detectors at spotting text from the model it was paired with. On fake news generated by a 20-billion-parameter model, the paper reports 0.95 AUROC for DetectGPT versus 0.81 for the strongest zero-shot baseline. When the detector scores text using the same model that generated it, the curvature signal is sharp.
But that “same model” condition is the whole ballgame, and it’s where things get shaky in practice.
You usually don’t know the source model. If a student used one model and the detector scores with another, the probability peak gets blurry. The Mitchell paper itself flags this white-box assumption as a core limitation — you need to evaluate the log-probabilities of the model in question. In the wild, you almost never know which model, which version, or what prompt produced a given text. That uncertainty eats into the signal.
It’s computationally heavy. Scoring one passage means generating and re-scoring dozens of variants — far slower than a trained classifier that judges text in one pass. That matters when you’re grading thousands of submissions.
Editing changes everything. The moment a human revises — reordering ideas, adding detail, cutting filler — the text stops sitting neatly on the model’s peak, and the curvature signal weakens. This isn’t a loophole. It’s a description of what real revision does: genuine editing makes writing better and, as a side effect, less statistically machine-like.
It still outputs a probability. This is the honest center of the whole topic. DetectGPT doesn’t return “AI” or “human.” It returns a number reflecting a statistical pattern, and statistical patterns produce false positives. A 2023 study from Liang and colleagues at Stanford found AI detectors were biased against non-native English writers, flagging more than half of a set of TOEFL essays as machine-generated — partly because that writing can be more predictable and lower-perplexity. A curvature-based method is not immune to that failure.
For context: OpenAI pulled its own AI Text Classifier in July 2023, citing a low rate of accuracy. Detection is genuinely hard, and no single method, however clever, settles it.
What this means if you write with AI
The practical lesson isn’t “here’s how to game the curve.” It’s the opposite. The signal DetectGPT measures is real: first-pass model output really does cluster around predictable, high-probability phrasing. If your writing reads that way, a detector picking it up is telling you something true about the prose. It’s a bit flat, a bit on-the-nose.
The durable fix is the unglamorous one. Add specifics only you would know. Vary your sentence rhythm. Cut the throat-clearing. Say the surprising thing. That work moves your text off the peak because it genuinely changes the writing, not because it tricks a number. If the mechanics here interest you, we’ve got more guides on how detection actually works.
Frequently asked questions
Is DetectGPT the same thing as GPTZero or Turnitin?
No. GPTZero and Turnitin are commercial products with their own classifiers and interfaces. DetectGPT is a research method published by a Stanford team in 2023 — an algorithm, not a website you paste text into. The shared thread is that they all read a model’s probability signals rather than understanding meaning.
Does DetectGPT need to be trained on examples of AI writing?
That’s the point of “zero-shot” — no, it doesn’t. Trained classifiers learn from labeled datasets and can go stale when a newer model arrives. DetectGPT skips that step. It only queries a language model for probability scores, so it adapts to whatever model it’s pointed at.
Why does it get less accurate when it doesn’t know which model wrote the text?
The curvature signal is strongest when DetectGPT scores text with the exact model that generated it. Score it with a different model and the probability peak blurs, shrinking the gap between human and machine text. In practice you rarely know the source model, so this cross-model penalty is a real limit.
Can well-edited AI text fool a curvature-based detector?
Editing changes the picture. Once a human rewrites sentences and adds specific detail, the text no longer sits on the model’s peak, so the signal weakens. That’s not a trick — it’s what genuine revision does to the statistics. Real editing makes writing both better and less machine-like.
Should I trust a DetectGPT score as final proof?
No detector should be treated as proof. DetectGPT outputs a probability based on statistical behavior, and false positives happen — including documented bias against non-native English writers. Treat any score as one input, and look at drafts and process rather than accepting a number as a verdict.
The short version
DetectGPT is a genuinely smart idea. Instead of memorizing what AI text looks like, it measures whether your writing sits on a probability peak that machine-generated text tends to occupy. The trick is elegant, it needs no training data, and it’s strongest exactly when it knows the model that wrote the text — a condition that rarely holds in the real world. The takeaway for anyone writing with AI is the one good editors have always known: to sound human, write with specifics, rhythm, and the occasional surprise. Run a draft through PaperBleach to see where yours stands.
Try it on your own text
Paste your draft into PaperBleach to humanize AI text so it reads naturally — then check your score against built-in AI detection. Free on your first run.


