Abstract
As Large Language Models (LLMs) proliferate, the need for reliable text detection has grown. However, existing detectors are often vulnerable to adversarial perturbations. We present RAFT (Realistic Attacks to Fool Text Detectors), a zero-shot, black-box framework that subverts AI text detectors through minimal, grammar-aware word substitutions. Unlike previous methods that produce nonsensical text, RAFT maintains high fluency and semantic integrity. Our evaluations show that RAFT can reduce detector accuracy (AUROC) by up to 99% while remaining indistinguishable from human writing to both algorithms and human readers.
Introduction
The rapid adoption of LLMs has raised concerns regarding disinformation and academic dishonesty. In response, various detection methods have been developed, ranging from supervised classifiers to zero-shot statistical tools like DetectGPT. While these detectors perform well on standard machine-generated text, they are often brittle when faced with adversarial attacks. Existing "red-teaming" methods typically rely on heavy paraphrasing or word substitutions that introduce grammatical errors, making them easily detectable by humans. RAFT addresses this by generating "realistic" perturbations that bypass machine detection without sacrificing text quality.
Methodology
RAFT operates as a zero-shot, black-box attack, requiring no access to the target detector's internal weights. The framework follows a four-step process:
- Identifying Important Words: To avoid exhaustive search, RAFT uses an auxiliary "white-box" LLM to identify words that are statistically significant to the machine's signature by performing proxy tasks like next-token prediction.
- Generating Candidates: For the identified target words (capped at 10% of the total text), RAFT utilizes GPT-3.5-Turbo to generate contextually appropriate replacement candidates.
- Enforcing Realism (POS Consistency): To ensure grammatical correctness, RAFT filters candidates to match the Part-of-Speech (POS) of the original word using the NLTK library. This prevents common errors like substituting a noun for a verb.
- Greedy Selection: The final candidate is selected based on its ability to most effectively reduce the target detector's confidence score.
Experimental Setup
The framework was evaluated across three datasets: XSum (summarization), SQuAD (question-answering), and ArXiV Paper Abstracts. Source texts were generated using models including GPT-3.5-Turbo, Llama-3-70B, and Mixtral-8x7B-Instruct to ensure robustness across different generation styles.
Results and Analysis
RAFT demonstrates a profound ability to degrade detector performance. On the XSum dataset, RAFT reduced the AUROC of Log Probability detectors to as low as 0.0035.
As shown in Figure 1, the distribution of scores for RAFT-attacked text (yellow) shifts significantly toward the human distribution (blue), effectively masking the machine-generated origin across multiple detection algorithms including DetectGPT and Fast-DetectGPT.
Performance Trade-offs
The effectiveness of the attack is sensitive to the "mask percentage"—the proportion of words substituted.
Figure 5 illustrates that even a small increase in the mask percentage leads to a dramatic drop in AUROC. While higher substitution rates increase text perplexity (reducing fluency), the POS-consistency constraint in RAFT helps maintain a lower perplexity compared to unconstrained word-substitution methods, preserving readability.
Human Evaluation
In a manual evaluation involving Amazon Mechanical Turk workers, humans were unable to reliably distinguish RAFT-attacked text from original human-written text (p-value = 0.917). This confirms that the "realistic" nature of the perturbations successfully fools human intuition as well as automated systems.
Discussion
A key insight from this work is the transferability of embeddings. Because different LLMs share similar latent semantic spaces, an attack optimized on one model's embeddings is highly effective against detectors built on entirely different architectures. Furthermore, RAFT serves as a valuable tool for adversarial training. By incorporating RAFT-perturbed examples into training sets, developers can create detectors that are significantly more robust against future attacks.
Conclusion
RAFT highlights a critical vulnerability in current AI text detection paradigms. By prioritizing grammatical realism, it achieves high attack success rates while remaining inconspicuous. Future work will explore adaptive perturbation rates and larger-scale human evaluations to further refine the framework's effectiveness and stealth.
Summary updated