MAGE: Machine-generated Text Detection in the Wild

Yafu Li, Qintong Li, Leyang Cui, Wei Bi, Zhilin Wang, Longyue Wang, Linyi Yang, Shuming Shi, Yue Zhang

TL;DR

The MAGE (MAchine-GEnerated text detection) framework introduces a massive, diverse testbed to evaluate AI text detectors in "wild" scenarios where the source model and domain are unknown. The study reveals that while linguistic differences between humans and machines vanish as data diversity grows, fine-tuning the decision boundaries of transformer-based detectors can still achieve over 86% accuracy on entirely unseen models like GPT-4.

What Problem Does This Paper Address?

Most existing AI text detectors are evaluated in "lab conditions"—testing on a single domain (like news) or a single model (like GPT-2). In the real world, a detector might encounter a student essay, a fake news tweet, or a scientific abstract, all generated by different, often unknown, Large Language Models (LLMs).

As LLMs become more sophisticated, the linguistic "tells" that once separated them from human writing are disappearing. This paper tackles the challenge of out-of-distribution (OOD) detection: can a system trained on today's models identify text from a model released tomorrow, or from a writing genre it has never seen before?

Figure 1: Machine-generated text detection in the wild: the detector encounters texts from various human writ- ings or fake texts generated by diverse LLMs.

Methods

The authors evaluated four representative detection paradigms:

  1. FastText: A supervised classifier using simple linguistic statistics (n-grams).
  2. GLTR: A method that uses a proxy LLM to look for statistical patterns in word rankings.
  3. DetectGPT: A zero-shot, unsupervised method that assumes machine text sits in "local minima" of probability (requires white-box access to a model).
  4. Longformer (PLM-based): A supervised transformer-based classifier.

The researchers discovered that standard decision boundaries often fail when moving to new domains. To fix this, they proposed a Boundary Adjustment technique, using a tiny sliver (0.1%) of in-domain data to recalibrate the detector's threshold, significantly boosting performance in unfamiliar territory.

Datasets

The authors built the MAGE testbed, which is significantly more comprehensive than previous benchmarks:

  • Human Sources: 7 distinct writing tasks including opinion statements (CMV, Yelp), news (XSum, TLDR), QA (ELI5), stories (WP, ROC), and scientific abstracts (SciXGen).
  • Machine Sources: Texts generated by 27 different LLMs (including the GPT-3.5 family, LLaMA, FLAN-T5, OPT, and BLOOM) using three different prompting strategies.
  • Wildness Levels: The data is organized into 8 "testbeds" of increasing difficulty, ranging from fixed-domain/fixed-model setups to the "wildest" scenario: unseen domains, unseen models (GPT-4), and paraphrasing attacks.

Key Insights and Ideas

  • Linguistic Convergence: In narrow domains, humans and machines use different patterns (e.g., how often they use dates or specific parts of speech). However, as you aggregate more domains and models, these statistical differences average out, making detection much harder.
Figure 5: Linguistic difference (Jensen-Shannon dis- tance) between human-written texts and machine- generated texts in 4 in-distribution settings (darker col- ors indicate larger differences).
  • The Perplexity Bias: Detectors often rely on "perplexity"—a measure of how "surprising" a text is to a language model. Machine text usually has low perplexity. However, this creates a bias: detectors often misclassify high-quality, low-perplexity human writing (like news or Wikipedia) as AI-generated.
  • Boundary Adjustment is a Silver Bullet: The study found that detectors often can distinguish between human and machine text in new domains (high AUROC), but they pick the wrong "cutoff" point for their decision. Adjusting this boundary with just a few examples can rescue a failing detector.
Figure 4: How refining the decision boundary improves the precision-recall trade-off.

Key Results

  • Longformer Wins: The PLM-based Longformer was the most robust across the board, maintaining high performance even as model and domain diversity increased.
  • OOD Success: In the most realistic scenario—detecting GPT-4 text in unseen domains—the Longformer achieved an 86.54% Average Recall (AvgRec) after boundary adjustment.
  • Paraphrasing is the Kryptonite: Even the best detectors struggled against paraphrasing attacks (using one AI to rewrite another's output). In these cases, AUROC dropped significantly (from 0.94 to 0.75), as paraphrasing shifts the perplexity distribution to mimic human writing.

Limitations and Future Work

The authors acknowledge that the "arms race" is ongoing. New models like Alpaca and Vicuna were not included in the initial testbed. Furthermore, since the human text comes from public benchmark datasets, there is a risk that these texts were included in the training data of the LLMs being detected, potentially blurring the lines further.

Future work will focus on gathering "fresh" online text that LLMs haven't seen during pre-training and developing more robust defenses against sophisticated paraphrasing attacks.

Summary updated

BibTeX
@inproceedings{li2024mage,
  author = {Yafu Li and Qintong Li and Leyang Cui and Wei Bi and Zhilin Wang and Longyue Wang and Linyi Yang and Shuming Shi and Yue Zhang},
  title = {{MAGE: Machine-generated Text Detection in the Wild}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.acl-long.3},
}
Figure