GPT AI Humanizer

DetectGPT Explained: How Stanford’s AI Text Detector Works

Updated · 9 min read · GPT AI Humanizer team

DetectGPT is a zero-shot method for detecting AI-generated text, published by Stanford researchers in 2023: it checks whether a passage sits at a local peak of a language model’s probability, because text a model wrote itself tends to score lower when slightly reworded, while human text does not. It became one of the best-known ideas in AI detection and still shapes how many detectors are discussed today. This guide explains how DetectGPT works in plain English, what its results showed, where it falls short, how it compares with tools like GPTZero, and what it means if you are a student, teacher or writer.

Facts come from the DetectGPT paper (arXiv 2301.11305 and the ICML 2023 proceedings), Stanford HAI’s announcement, the official GitHub repository and the Fast-DetectGPT paper, checked in November 2026. We quote numbers only as the authors reported them.

DetectGPT at a glance

QuestionShort answer
What is it?A research method for spotting machine-generated text, not a consumer app
Who made it?Eric Mitchell, Yoonho Lee, Alexander Khazatsky, Christopher D. Manning and Chelsea Finn (Stanford)
When?First posted on arXiv on 26 January 2023; published at ICML 2023 (PMLR volume 202)
Core ideaAI text tends to sit in “negative curvature” regions of the model’s log probability
Training needed?No separate classifier, no dataset of human or AI samples, no watermark
What it does needLog probabilities from the model being tested, and a second model (T5) to make small rewrites
Headline result0.95 AUROC on fake news written by GPT-NeoX 20B, versus 0.81 for the strongest zero-shot baseline
Main drawbackSlow and costly: around 100 perturbations per passage for best accuracy
CodeOfficial implementation on GitHub under the MIT license

What DetectGPT is (and what it is not)

DetectGPT is the name of a paper and a method: DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvature. Stanford HAI announced it in February 2023, describing it as a tool built by PhD student Eric Mitchell with colleagues, supervised by Chelsea Finn. The team released the paper, a demo and the code for its experiments.

“Zero-shot” means the method does not learn from labelled examples. Most commercial detectors are trained classifiers: they see many human and AI texts and learn to tell them apart. DetectGPT skips that step and uses the language model’s own probability scores instead.

Why it matters: if you search for “DetectGPT” today, you will also find an app, a browser extension and listings on software review sites using the same name. Those products are not the Stanford research and the paper does not mention them. Judge each one on its own published information, not on the reputation of the research.

How DetectGPT works, step by step

The key observation in the paper is that text sampled from a language model tends to occupy “negative curvature regions” of the model’s log probability function. In everyday terms: when a model writes a sentence, it picks words it finds likely, so the sentence sits near a local peak of probability. Nudge a few words and the probability almost always drops. Human writing is not chosen that way, so small rewrites move its score up or down more randomly.

DetectGPT turns that into a test:

  1. Score the original. Ask the model being tested (for example GPT-2 or GPT-NeoX) how probable the passage is.
  2. Make small rewrites. Use a separate model, T5, to mask short spans of the passage (the paper uses a 15% mask rate with two-word spans) and fill them back in. This creates many slightly different versions, called perturbations.
  3. Score the rewrites. Ask the tested model how probable each perturbed version is.
  4. Compare. If the original scores clearly higher than its rewrites on average, the passage looks machine-generated. If the scores are similar, it looks human.

Tip: you do not need to follow the maths to read DetectGPT results. Remember one sentence: “model text sits on a peak, human text sits on a slope.”

Probability curvature vs perplexity and burstiness

Many detectors, including early versions of GPTZero, were explained with two simpler ideas: perplexity (how surprising the words are to a model) and burstiness (how much that surprise varies from sentence to sentence). These look at a single score for the text as it stands.

DetectGPT asks a different question: not “is this text likely?” but “is this text more likely than nearby versions of itself?” That matters because plain, simple human writing can also have low perplexity. A comparison with its own rewrites gives the method extra information that a single score does not.

Why it matters: low perplexity alone is a weak signal, and it is one reason careful, formulaic or non-native writing can be flagged by detectors. Our guide on whether AI detectors are accurate covers these false positives in detail.

What the results showed

The paper’s best-known result: on fake news articles generated by the 20-billion-parameter GPT-NeoX model, DetectGPT improved detection from 0.81 AUROC for the strongest zero-shot baseline to 0.95. AUROC is a ranking measure: 1.0 means every AI passage scored as more suspicious than every human one, and 0.5 is a coin flip. It is not the same as “95% of essays are classified correctly.”

Stanford HAI’s write-up summarised the early experiments as identifying authorship about 95% of the time across five open-source models, with somewhat lower confidence when the scoring model was different from the model that wrote the text. The paper also reports that accuracy kept improving up to about 100 perturbations, where it levelled off.

Tip: when you see any “95% accurate” headline for a detector, ask three things: on which models, on what kind of text, and measured how. The answer changes the meaning completely.

The limits of DetectGPT

The method is clever, but the paper and Stanford’s announcement are open about its constraints:

  • It needs the model’s probabilities. DetectGPT uses log probabilities computed by the model of interest. Many commercial chatbots do not give full access to these, so the method works best when you know and can query the model that wrote the text.
  • It is compute-heavy. Scoring around 100 rewrites per passage costs far more than scoring once. The authors even reduced the number of evaluation samples in some experiments to keep API costs down.
  • Edited text is harder. Stanford HAI noted that detection quality declines for edited essays. In the paper’s tests, accuracy stayed above 0.8 AUROC until nearly a quarter of the words had been replaced, then kept falling.
  • Model mismatch. Results were strongest when the scoring model matched the source model and weaker otherwise.
  • Early-stage research. Mitchell described the work as early, and the experiments used 2022-era models, not the chatbots people use in 2026.

Why it matters: none of these limits makes DetectGPT “wrong”. They mean a DetectGPT score, like any detector score, is a statistical estimate and should never be treated as proof on its own.

Fast-DetectGPT and what came next

DetectGPT’s cost inspired follow-up work. The best known is Fast-DetectGPT by Guangsheng Bao and colleagues, published at ICLR 2024. It replaces DetectGPT’s perturbation step with a more efficient sampling step. Its authors report about a 75% relative improvement over DetectGPT in both white-box and black-box settings and detection that is roughly 340 times faster.

The wider lesson is that “probability curvature” became a standard building block. Research detectors and commercial tools now mix several signals, and many are trained classifiers rather than pure zero-shot methods. Detector companies rarely publish their full methods, so you usually cannot tell which ideas a given product uses.

Tip: if you want to understand a specific tool, look for its own published methodology and independent tests, as we did for Copyleaks and the QuillBot AI detector.

DetectGPT vs GPTZero and other detectors

DetectGPT (research)Typical commercial detector
ApproachZero-shot: compares a passage with its own rewritesUsually a trained classifier, often combined with other signals
Needs model accessYes, log probabilities from the scoring modelNo, runs on the vendor’s own models
SpeedSlow (many model calls per passage)Fast, built for pasting a document
TransparencyPaper and code are publicMethods mostly undisclosed
Ready for everyday useNo, it is a research method with a demoYes, with web apps and paid plans

Why it matters: DetectGPT is the reason people talk about detectors in terms of probability, but most tools that students and teachers meet in practice are not DetectGPT. A result from one tool says nothing certain about what another tool will show.

Can you run DetectGPT yourself?

Yes, if you are comfortable with Python. The official repository, eric-mitchell/detect-gpt, is described as the official implementation of the experiments in the paper and is MIT licensed. Setup is a virtual environment and pip install -r requirements.txt, then running the scripts in paper_scripts/. Some experiments need extra datasets, and the larger models need a capable GPU.

The code reproduces research experiments; it is not a polished app for checking a single essay. For a quick estimate of one document, a ready-made detector is more practical. Our free AI detector gives a score and highlights, which, like every detector score, is an estimate rather than proof.

What to do with a detector result: a practical checklist

  1. Treat the score as one signal. Even the DetectGPT authors frame their results as probabilities, not verdicts.
  2. Check the kind of text. Short passages, lists, formulaic writing and heavily edited text are where detectors disagree most.
  3. Compare tools carefully. Different detectors use different methods, so mixed results are normal, not a sign of guilt.
  4. Keep evidence of your process. Drafts, notes and version history show how a text was written far better than a score.
  5. Follow the rules that apply to you. Students should follow their school’s AI policy; employees and freelancers should follow their client’s or employer’s rules.
  6. For teachers: use a score to start a conversation, not to end one. Our guide on AI detectors for teachers explains a fair review process.
  7. For writers using AI where permitted: edit drafts so they carry your own facts, examples and voice. Our tips on how to humanize AI text focus on readability, not on beating detectors.

Our verdict

DetectGPT is an important piece of AI detection research: it showed that a model’s own probability scores, compared against small rewrites, can separate machine text from human text without any training data. It is also slow, needs access to model probabilities, weakens on edited text and was tested on older models, so it is not a practical everyday checker and not proof of authorship. If you are worried about a detector score, focus on what actually settles questions: your drafts, your sources and the rules you are working under. If you use AI for writing where it is allowed, our AI humanizer can help make a draft clearer and more natural, and you can compare plans on the pricing page.

Questions

What is DetectGPT?

DetectGPT is a zero-shot AI text detection method from Stanford researchers, published at ICML 2023. It compares how probable a passage is to a language model with how probable slightly rewritten versions are; AI text usually scores clearly higher than its rewrites.

Is DetectGPT accurate?

In the paper it reached 0.95 AUROC on fake news written by GPT-NeoX 20B, versus 0.81 for the best zero-shot baseline. Accuracy drops on edited text and when the scoring model differs from the one that wrote the text, so treat any result as an estimate.

Is DetectGPT the same as GPTZero?

No. DetectGPT is a Stanford research method with public code. GPTZero is a separate commercial detector with its own methods. Some apps also use the name DetectGPT but are not related to the Stanford research.

Read next

Paste your first 500 words. No account needed.

Humanize my text →
DetectGPT Explained: How the AI Text Detector Works