Abstract
As Large Language Models (LLMs) become ubiquitous, AI-generated text (AIGT) detectors have emerged as critical tools for identifying synthetic content. However, existing evasion techniques—primarily perturbation-based or paraphrase-based—often struggle with maintaining text quality or optimization efficiency. This paper introduces GradEscape, the first gradient-based evader designed to rewrite AIGT to bypass detectors while preserving original meaning. By utilizing a novel "pseudo-embedding" technique to bridge the gap between discrete text and continuous optimization, GradEscape achieves superior evasion rates compared to much larger models and successfully compromises real-world commercial detectors.
Introduction
The proliferation of LLMs has led to a surge in AIGT, prompting the development of detectors to flag synthetic content in academic, professional, and security contexts. This has sparked a "cat-and-mouse" game between detection and evasion. Current evasion methods generally fall into two categories: perturbation-based methods, which swap words for synonyms but often produce ungrammatical results, and paraphrase-based methods, which use LLMs to rewrite text but may alter meaning significantly as they are not explicitly optimized for evasion.
The ideal approach is gradient-based optimization, common in computer vision for adversarial attacks. However, the discrete nature of text and the mismatch between different model tokenizers have historically hindered such efforts. GradEscape addresses these challenges by treating evasion as an unsupervised optimization problem.
The GradEscape Framework
GradEscape operates by rewriting synthetic text to shift its distribution toward that of human-written text as perceived by a target detector. The framework supports both "open" (white-box) attacks, where the detector's parameters are known, and "opaque" (black-box) attacks, where only detection scores are available.
In opaque scenarios, GradEscape employs a tokenizer inference attack. By observing how a detector responds to specific "spoofed" characters (e.g., extra spaces or pad tokens), the system can deduce the underlying architecture (e.g., RoBERTa vs. GPT-2). A surrogate model is then trained to mimic the victim detector, allowing the evader to be optimized against this substitute.
Technical Implementation
The core innovation of GradEscape is the use of pseudo-embeddings to make text rewriting differentiable. Instead of passing discrete tokens to the detector, GradEscape passes a "weighted embedding"—a mathematical mixture of all possible words in the dictionary, weighted by the probability assigned by the evader model. This allows gradients to flow back from the detector to the evader.
The training process involves a multi-faceted loss function:
- Label Loss ($\mathcal{L}_l$): Encourages the evader to produce high-confidence token predictions.
- Semantic Loss ($\mathcal{L}_s$): Uses a text encoder to ensure the rewritten text maintains the original meaning via Mean Squared Error (MSE).
- Classification Loss ($\mathcal{L}_c$): The primary signal from the detector, optimized to minimize the probability of the text being flagged as AI-generated.
To further bridge the gap between models, GradEscape uses a warm-started evader. By initializing the evader with the same parameters as a BERT-based detector and pre-training it as a "repeater," the authors ensure both models share a consistent linguistic representation.
Evaluation and Results
GradEscape was evaluated across four diverse datasets: GROVER News, HC3, GPA, and GPTWiki Intro. It was benchmarked against state-of-the-art evaders, including DIPPER, an 11-billion parameter paraphrase model.
Key Findings
- Efficiency and Performance: Despite having only 139 million parameters, GradEscape consistently outperformed DIPPER (80x larger). On the GROVER dataset, it achieved nearly a 100% evasion rate while maintaining a high ROUGE score of 0.9.
- Commercial Impact: In tests against commercial detectors like Sapling, GradEscape reduced detection confidence from near 1.0 to near 0.0 for half of the samples.
- Query Efficiency: In opaque attack scenarios, the system required only approximately 2,000 queries to train a surrogate detector that reached 90% of the effectiveness of a white-box attack.
Discussion and Conclusion
The success of GradEscape highlights that detectors often rely on "expression styles" rather than deep semantic understanding. By subtly shifting these styles toward a "human" distribution, evasion becomes highly effective. The paper also demonstrates that tokenizers are "leaky," providing a fingerprint that allows attackers to identify black-box model architectures.
As a countermeasure, the authors propose Active Paraphrasing, which involves paraphrasing all incoming text before detection to normalize style. While this reduces GradEscape's success rate to 20%, it introduces significant computational overhead. Future work will focus on improving detector robustness and extending gradient-based evasion to multi-lingual contexts.
Summary updated