Red Teaming Language Model Detectors with Language Models

Zhouxing Shi, Yihan Wang, Fan Yin, Xiangning Chen, Kai-Wei Chang, Cho-Jui Hsieh

TL;DR

This paper demonstrates that current state-of-the-art AI text detectors are highly vulnerable to adversarial attacks orchestrated by other Large Language Models (LLMs). By using "attacker" LLMs to perform strategic word substitutions or to discover deceptive instructional prompts, the researchers successfully bypassed classifier-based, likelihood-based, and watermarking detectors while maintaining high text quality.

What Problem Does This Paper Address?

As LLMs like ChatGPT and LLaMA become ubiquitous, concerns regarding their misuse for plagiarism and misinformation have led to the development of AI text detectors. These detectors generally fall into three camps:

  1. Classifier-based: Neural networks trained to distinguish human vs. AI text.
  2. Watermarking: Injecting statistical patterns into the LLM's output during generation.
  3. Likelihood-based: Analyzing the log-likelihood of a text (e.g., DetectGPT), based on the observation that AI text tends to occupy specific "curvature" regions in probability space.

While these detectors work well in standard scenarios, the authors ask: How robust are they against a motivated adversary? Unlike previous studies that used weak or unprotected models to attack, this paper explores a more realistic and challenging "red teaming" setting where the attacker uses a powerful LLM that might itself be under detection.

Methods

The authors proposed two primary attack strategies:

1. Word Substitution Attacks

The goal is to perturb the LLM's output ($Y$) into a new version ($Y'$) that minimizes the detector's score.

  • Generating Candidates: They use an auxiliary LLM ($G'$) to suggest context-aware synonyms. This ensures the replacements aren't just dictionary synonyms but actually fit the sentence flow.
  • Query-based (Evolutionary Search): A genetic algorithm that iteratively selects the most effective word substitutions by querying the detector.
  • Query-free: For watermarking, they target "high-entropy" tokens—words where the model is less certain—as these are the most likely to have been influenced by the watermarking algorithm.

2. Instructional Prompt Attacks

Instead of changing the output after it's generated, this method perturbs the input prompt ($X$). The authors search for an "instructional prompt" ($X_p$) that tells the LLM to adopt a specific writing style (mimicking a reference text) that the detector is likely to miss. They use an automated search process to find a universal $X_p$ that works across many different inputs.

Properties of various attack methods and their applicability to different detectors.

Datasets

The study utilized two primary benchmarks to evaluate text completion and long-form question answering:

  • XSum: A dataset for extreme summarization, used here for text completion tasks.
  • ELI5: A dataset for long-form "Explain Like I'm Five" question answering. For both, the authors filtered for examples containing at least 1,000 characters to satisfy the requirements of certain detectors (like OpenAI’s).

Key Insights and Ideas

  • The "Protected Attacker" Paradox: The authors show that even if the attacker's LLM is itself being monitored by a detector, it can still be used to successfully generate attacks against other models.
  • Watermarking is Sturdier but Not Invincible: Watermarking proved more robust than likelihood or classifier-based methods, but strategic substitution of high-entropy tokens still significantly degraded its detection rate.
  • Style Mimicry is Powerful: Simply telling an LLM to "mimic the writing technique and diction" of a specific human passage (found via automated search) is an incredibly efficient way to bypass detectors without needing to query the detector at inference time.
  • Quality vs. Evasion: There is a slight trade-off between text quality and attack success. Query-based attacks are the most effective at evading detection but cause a minor dip in fluency compared to query-free methods.

Key Results

The attacks were devastatingly effective across all detector types:

  • DetectGPT: On the XSum dataset, the AUROC (Area Under the Receiver Operating Characteristic curve) for GPT-2-XL dropped from 84.4% to a mere 3.9% under a query-based substitution attack.
  • Classifier-based Detectors: The OpenAI AI Text Classifier saw its AUROC drop from 88.8% to 43.4% on XSum using word substitutions. The RoBERTa-based detector for GPT-2 was even more vulnerable, with the Attack Success Rate (ASR) jumping to 68% for query-based substitutions.
Attack Success Rate (ASR) for OpenAI RoBERTa-Large detector for GPT-2 texts.
  • Human Evaluation: Despite these heavy perturbations, human raters on Amazon Mechanical Turk found the generated text remained highly fluent and plausible, typically scoring only slightly lower than unattacked AI text.

Limitations and Future Work

The authors acknowledge that their attacks do cause a "minor decline" in generation performance. In high-stakes creative writing, this might be noticeable, but for "spamming" or misinformation, the quality remains more than adequate.

Future Directions: * Hybrid Defenses: The authors suggest combining watermarking with likelihood estimation to catch word substitution patterns. * Robustness Research: There is an urgent need to develop detectors that are inherently resistant to distribution shifts and adversarial prompts, rather than just training on static datasets of AI-generated text.

Summary updated

BibTeX
@article{shi2024red,
  author = {Zhouxing Shi and Yihan Wang and Fan Yin and Xiangning Chen and Kai-Wei Chang and Cho-Jui Hsieh},
  title = {{Red Teaming Language Model Detectors with Language Models}},
  journal = {Trans. Assoc. Comput. Linguistics},
  year = {2024},
  url = {https://openreview.net/forum?id=Zx2f3IOenf},
}
Figure