MGTBench: Benchmarking Machine-Generated Text Detection

Xinlei He, Xinyue Shen, Zeyuan Chen, Michael Backes, Yang Zhang

TL;DR

MGTBench is the first comprehensive benchmarking framework designed to evaluate machine-generated text (MGT) detectors against modern, high-performance LLMs like ChatGPT and Claude. The study reveals that while model-based detectors are currently highly effective, they—along with all existing detection methods—are alarmingly vulnerable to simple adversarial attacks like paraphrasing and random spacing.

What Problem Does This Paper Address?

As Large Language Models (LLMs) become increasingly adept at mimicking human prose, the risks associated with "AI-generated" content—ranging from academic dishonesty to automated misinformation campaigns—have skyrocketed. While many detection methods have been proposed, the research landscape is fragmented. Different studies use different model architectures, disparate datasets, and inconsistent experimental settings.

Furthermore, it hasn't been clear how well these detectors hold up against the newest generation of "powerful" LLMs (e.g., GPT-3.5-turbo, Claude) or how robust they are when a user intentionally tries to hide the machine's tracks. MGTBench seeks to provide a unified, modular platform to answer these questions systematically.

Methods

The authors categorize MGT detection into two primary methodologies:

  1. Metric-based Methods (Zero-shot): These leverage the statistical properties of text. They use a base model (like GPT-2) to calculate scores such as Log-Likelihood, Rank, and Entropy. The intuition is that LLMs tend to generate "predictable" text that resides in local optima of the model's probability distribution. Methods like DetectGPT and NPR take this further by adding minor perturbations to the text to see how the probability score changes.
  2. Model-based Methods (Supervised): These are classifiers (typically based on RoBERTa or BERT) fine-tuned on a specific corpus of human-written vs. machine-generated text. The authors implement several, including the OpenAI Detector, ChatGPT Detector, and their own LM Detector (a fine-tuned distilled BERT model).

The framework also moves beyond simple binary detection (Human vs. AI) to Text Attribution, where the goal is to identify which specific LLM generated a given snippet.

Datasets

MGTBench utilizes three primary datasets, each representing a different writing style:

  • Essay: 1,000 samples from IvyPanda (academic style).
  • WP (Writing Prompts): 1,000 samples from Reddit's r/WritingPrompts (creative/storytelling style).
  • Reuters: 1,000 news articles from the Reuters 50-50 authorship dataset (journalistic style).

To create the "machine" half of these datasets, the authors queried six representative LLMs: ChatGPT-turbo, ChatGLM, Dolly, GPT4All, StableLM, and Claude.

Distribution of word counts for human vs. machine-generated text across the three datasets.

Key Insights and Ideas

  • The 200-Word Sweet Spot: Detection performance scales with text length. The authors found that 200 words is generally the threshold required to achieve stable, high-quality detection. Below this, the statistical "signal" of the machine is often too weak to distinguish from human variability.
  • Metric-based Efficiency: Surprisingly, metric-based methods require as few as 10 training samples to determine an effective threshold and reach near-peak performance. In contrast, model-based methods need significantly more data to optimize their millions of parameters.
  • The Transferability Trade-off: There is a fascinating split in how models generalize. Metric-based methods transfer better across different LLMs (because most LLMs share similar statistical signatures), whereas model-based methods transfer better across different datasets (because they learn deeper semantic and syntactic patterns).
  • Attribution is Harder than Detection: Identifying that a text is AI-generated is much easier than identifying which AI wrote it. Metric-based methods fail miserably at attribution because the probability distributions of different LLMs often overlap. Model-based methods, however, remain quite effective at this task.

Key Results

  • Top Performer: The LM Detector (BERT-based) consistently outperformed others, achieving an F1-score of 0.993 when detecting ChatGPT-generated essays.
  • Length Matters: As shown in the length ablation study, F1-scores for most methods jump significantly as the word count increases from 10 to 200.
F1-score of different detection methods as the maximum number of words in the text increases.
  • Fragile Robustness: The most sobering result was the impact of adversarial attacks. Simple paraphrasing or even randomly inserting spaces (1% probability) caused detection performance to crater. For example, the LRR detector's F1-score dropped by 0.469 under adversarial perturbation.

Limitations and Future Work

The authors acknowledge that their study is currently limited to English text and a specific set of six LLMs. As LLMs continue to evolve, their statistical signatures may become even more human-like, potentially rendering current metric-based methods obsolete.

The most critical area for future work is robustness. Since current detectors are easily bypassed by simple text manipulations, the authors suggest that future research should focus on "adversarial training"—incorporating attacked text into the training loop—and developing more sophisticated input filtering to defend against these evasive maneuvers.

Summary updated

BibTeX
@inproceedings{he2024mgtbench,
  author = {Xinlei He and Xinyue Shen and Zeyuan Chen and Michael Backes and Yang Zhang},
  title = {{MGTBench: Benchmarking Machine-Generated Text Detection}},
  booktitle = {CCS},
  year = {2024},
  doi = {10.1145/3658644.3670344},
}
Figure