How Do AI Detectors Work? Perplexity, Classifiers and More
AI detectors work by measuring statistical features of a text and feeding them to a model trained to tell human writing from machine writing. The two best-known signals are perplexity (how predictable each word is) and burstiness (how much sentences vary). A classifier combines these and other features into a probability that the text was generated by AI. The result is always an estimate. Detectors do not know how a text was produced; they infer it from patterns that human writing can share.
The basic idea
A large language model writes by choosing likely next words. If you take another language model and ask it to score your text word by word, it can tell you how expected each word was. Text generated by a model tends to be full of expected choices. Human writing tends to include more surprising words, odd constructions and uneven rhythm. Detectors turn that difference into a score.
Signal 1: perplexity
Perplexity is a measure of how surprised a language model is by a sequence of words. Low perplexity means the text was easy to predict.
Consider two sentences:
The cat sat on the mat.
The cat sat on the radiator, glaring at the rain.
A model finds the first very predictable. The second has less expected choices. Model-generated text often sits in the low-perplexity range because the generator itself favored likely words.
The weakness is obvious: plenty of human writing is predictable too. Definitions, instructions, legal clauses and formal academic prose all use expected wording by design.
Signal 2: burstiness
Burstiness describes variation across a text. Humans tend to write in bursts: a long, winding sentence followed by a short one, a paragraph of dense detail followed by a quick aside. Model text, especially unedited, often has steadier sentence lengths and a consistent level of predictability throughout.
Detectors can measure variation in sentence length, in per-sentence perplexity, and in structure. Low variation pushes a score toward "AI." But a disciplined human writer following a template can also produce low burstiness.
Signal 3: learned features
Modern detectors usually do more than compute two numbers. They are themselves neural networks trained on large collections of labeled examples: texts known to be human and texts known to be generated. During training, the detector learns whatever features best separate the two groups. Some of those features match intuitive ideas (common transitions, generic vocabulary, tidy structure); many are patterns no person would describe in words.
This is why detector quality depends so heavily on training data. A detector trained mostly on essays generated by older models, compared against human essays from one region, will perform best on text that looks like that and worse on everything else.
Putting it together: the pipeline
- Preprocessing. The text is cleaned and split into tokens, then often into segments such as sentences or windows of a few hundred words.
- Feature extraction. For each segment, the detector computes signals such as perplexity and its own learned features.
- Segment scoring. Each segment gets a probability of being AI-generated.
- Aggregation. Segment scores are combined into a document-level result: a percentage, a label, or both.
- Thresholding. The tool decides what counts as "likely AI", "mixed" or "likely human." Where that line sits is a design choice.
- Display. Many tools highlight the segments with the highest scores.
Watermark detection: a different approach
Everything above is after-the-fact inference. Watermarking flips it: a model provider deliberately embeds a subtle statistical pattern in generated text, such as slightly favoring certain word choices according to a secret rule. A detector that knows the rule can test for the pattern. This can be much more dependable than inference, but only for text from providers that implement it, and editing, paraphrasing or translation can weaken the signal.
Why detectors make mistakes
| Cause | Result |
|---|---|
| Human text that is formal, formulaic or technical | False positive |
| Second-language writing with regular patterns | False positive |
| Short samples | Unstable scores |
| AI text that was heavily edited by a person | False negative |
| New models the detector was not trained on | Often false negatives |
| Mixed authorship | Scores that are hard to interpret |
Why length matters so much
Every signal described above is a statistic, and statistics need samples. Perplexity averaged over 30 words can be dominated by one unusual phrase. Burstiness cannot be measured meaningfully over two sentences. With a few hundred words or more, random quirks start to cancel out and the overall pattern becomes clearer. That is why many detectors set a minimum length, and why scores on short answers, captions or single paragraphs are so unstable. If you test a short piece and get an alarming score, the most likely explanation is simply not enough data.
What a score does and does not mean
A score summarizes how strongly the detector's features point toward machine authorship. It does not reveal the writing process, the amount of AI involvement, or whether any AI use broke a rule. Two detectors can disagree sharply on the same passage. Read any result as "this text has these statistical properties," not "this person did this."
Practical takeaways
For writers: A detector can be a useful mirror. Passages it highlights are often generic, and rewriting them with concrete detail and your own reasoning improves the writing. Try it with the free AI detector. But do not chase a score. No method can guarantee one, and drafts and version history are far better evidence of authorship.
For reviewers: Combine any score with other evidence. Ask for drafts, compare with earlier work, and talk with the writer. Be most cautious with short, technical or second-language writing.
For code: Source code has very different statistics from prose. Use a tool built for it, such as the AI code detector, and apply the same caution.
FAQ
What is perplexity in AI detection?
Perplexity measures how predictable a text is to a language model. Lower perplexity means more predictable wording, which detectors associate with AI-generated text, though predictable human writing also scores low.
What is burstiness?
Burstiness is the variation in sentence length, structure and predictability across a text. Human writing usually varies more; unedited model output often varies less.
Do AI detectors store the text I check?
It depends on the tool. Read each tool's privacy information before pasting sensitive or unpublished work.
Can AI detectors explain why they flagged something?
Many highlight sentences but cannot give a precise reason, because classifiers rely on learned features that are hard to translate into plain language.