Why AI detectors break on LaTeX, and how to check a paper properly
Most detectors were built for essays and blog posts. Feed them a .tex file and you are not measuring your writing, you are measuring their tokenizer's confusion.
Here is a number from our own bench: when we ran raw LaTeX source through a word-level detector trained on ordinary prose, the false-positive rate on genuine human papers jumped by more than a factor of ten compared to the same papers with markup stripped. Same authors, same sentences, same science. The only difference was \begin{figure}, \cite{smith2019}, and a few dozen \alphas.
If you have ever pasted a chapter of your thesis into a free detector and stared at a nonsense verdict, this post is about why that happens, and what checking a paper properly looks like.
What LaTeX does to a detector
A text detector, whatever its architecture, is a statistical instrument. It was calibrated on some distribution of text: word frequencies, sentence lengths, punctuation rhythms, token sequences. LaTeX source violates that distribution in several ways at once.
Commands look like words. To a tokenizer, \textbf, \autocite, and \mathbb are exotic tokens that almost never appear in training data. Rare tokens push models toward whichever class happened to contain more weird text during training. You inherit a verdict from an accident of the training set.
Math dilutes the signal. Equations are, statistically, noise: high-entropy symbol soup with no stylistic fingerprint. A methods section that is 30 percent math by volume gives the detector 30 percent less prose to judge, while adding tokens that inflate its uncertainty. Short passages are already unreliable for every detector; math quietly turns a long section into a short one.
Structure reads as style. Hard-wrapped source lines, % comments, bibliography keys, and table grids all change the surface statistics that stylometric features measure: line lengths, punctuation ratios, capitalisation patterns. None of it is your writing style, but all of it gets measured as if it were.
Citations are a tell in both directions. [12, 14] and \parencite{...} patterns correlate with genuine academic writing, so some detectors learn "citation soup means human". That sounds convenient until you realise a language model can produce citation soup too, and then the shortcut becomes a hole.
The result is a verdict that is partly about your prose and mostly about your markup. We have seen both failure directions in testing: real papers flagged because the tokenizer choked, and generated text cleared because the grids and keys diluted the statistics.
Stripping LaTeX is harder than deleting backslashes
The obvious fix is to remove the markup before analysis. Doing that well is fussier than it looks, and doing it badly creates new artifacts:
- Accents must resolve, not vanish.
G\"odelshould become Gödel, not "G odel" or "Gdel". A detector seeing mangled names sees rare tokens again, and you are back where you started. - Math should be removed, prose kept. Inline math becomes a gap; display environments disappear entirely. But the caption of a figure or table is real prose written by a real author, and it should survive.
- Single newlines are spaces. LaTeX sources are hard-wrapped at 80 columns. If your converter keeps those line breaks, every sentence gets chopped into fragments, and per-sentence analysis becomes meaningless.
- Comments, preamble, and bibliographies are not writing.
%-lines,\usepackageblocks, and.bblcontent should never reach the model.
When we built unslop, we wrote and tested this pipeline against real theses until the output read like the paper as its author would print it: prose intact, captions intact, accents correct, markup gone.
What checking a paper properly looks like
unslop is calibrated on scientific English specifically, and it treats LaTeX as a first-class input rather than an inconvenience:
- Paste
.texsource directly, or upload the file (PDF and DOCX work too). The LaTeX toggle switches on automatically when the input looks like markup. - The analysis runs on the stripped prose, and the split view shows exactly what was analysed next to your original source, with machine-leaning passages shaded sentence by sentence.
- The headline number is a calibrated likelihood over the whole document, with a published false-positive rate on genuine papers (0.4 percent at our default operating point), because a tool that flags real researchers is worse than no tool.
No sign-up, no word limits, no metering. Check a full thesis if you like: unslop.
And if a detector, ours or anyone's, flags your genuinely human writing: that is a signal to review, not an accusation. Short passages, non-native English, and heavily formulaic sections (methods boilerplate especially) are known confounds for the entire field. Any tool that presents its verdict as proof is overselling.