Abstract
The misuse of large language models (LLMs), such as academic plagiarism, has driven the development of detectors to identify LLM-generated texts. To bypass these detectors, paraphrase attacks have emerged to purposely rewrite these texts to evade detection. Despite the success, existing methods require substantial data and computational budgets to train a specialized paraphraser, and their attack efficacy greatly reduces when faced with advanced detection algorithms. To address this, we propose Contrastive Paraphrase Attack (CoPA), a training-free method that effectively deceives text detectors using off-the-shelf LLMs. The first step is to carefully craft instructions that encourage LLMs to produce more human-like texts. Nonetheless, we observe that the inherent statistical biases of LLMs can still result in some generated texts carrying certain machine-like attributes that can be captured by detectors. To overcome this, CoPA constructs an auxiliary machine-like word distribution as a contrast to the human-like distribution generated by the LLM. By subtracting the machine-like patterns from the human-like distribution during the decoding process, CoPA is able to produce sentences that are less discernible by text detectors. Our theoretical analysis suggests the superiority of the proposed attack. Extensive experiments validate the effectiveness of CoPA in fooling text detectors across various scenarios.
Introduction
As Large Language Models (LLMs) become ubiquitous, the "arms race" between AI text generators and AI text detectors has intensified. Detectors, such as Fast-DetectGPT or RoBERTa-based classifiers, look for specific statistical signatures—like a preference for high-probability word sequences—that characterize machine writing.
To evade these, researchers developed "paraphrase attacks" to rewrite AI text into a more human-like style. However, existing attacks face two major challenges. First, they often require high costs, such as training a specialized, large-scale paraphrasing model like DIPPER. Second, they suffer from residual biases; even when an LLM is prompted to "write like a human," its internal statistical biases often leak through, leaving "machine-like" traces that advanced detectors can still identify.
The Contrastive Paraphrase Attack (CoPA) addresses these issues by "purifying" LLM output of machine-like traits without the need for additional training. By intervening at the decoding level, CoPA breaks the predictable statistical "smoothness" that AI detectors rely on.
Methods
The core innovation of CoPA is moving the attack from the prompt level to the decoding level. Instead of relying solely on a single prompt, CoPA performs "logit arithmetic" during the generation process using a dual-prompting strategy.
Dual Prompting and Contrastive Decoding
For every token generated, the system performs two forward passes:
- Positive Contrast: A prompt asking the LLM to write in a human-like, vivid style (e.g., "Rewrite this in the tone of a text message to a friend").
- Negative Contrast: A prompt that elicits the model's inherent "machine-style" (e.g., "Repeat the following paragraph").
The model then calculates the difference between the word distributions of these two prompts. By subtracting the "machine-like" probabilities from the "human-like" probabilities, the system effectively penalizes words that the LLM typically favors as an AI assistant.
Adaptive Truncation
To ensure the resulting text remains coherent, CoPA includes an adaptive truncation mechanism. This restricts word choices to a reliable candidate pool based on the human-like distribution, preventing the model from selecting nonsensical, low-probability words while still breaking the machine signature.
Results and Discussion
CoPA was evaluated across three diverse long-text datasets: XSum (news summaries), SQuAD (Wikipedia contexts), and LongQA (long-form QA). It was tested against eight different detection algorithms, ranging from zero-shot statistical methods (DetectGPT, LogRank) to trained classifiers (RoBERTa, R-detect).
Key findings include:
- Superior Fooling Rates: Against advanced detectors like Fast-DetectGPT, CoPA improved the "fooling rate" (at a 5% False Positive Rate) by an average of 57.72% for GPT-3.5 generated text.
- High Semantic Quality: Despite manipulating word probabilities, CoPA maintained a semantic similarity score of over 90% (measured via P-SP), ensuring the original meaning remained intact.
- Cross-Model Success: The attack effectively masked text from various models, including GPT-4, Claude 3.5, and Gemini 1.5 Pro.
- Linguistic Diversity: Analysis showed that CoPA-generated text exhibited higher lexical diversity (Type-Token Ratio) and more varied sentence structures than standard AI output.
The success of CoPA suggests that the "machine" signature is easier to define and subtract than the "human" style is to emulate directly. By amplifying machine-like traits in a negative reference, they can be systematically filtered out, forcing the model into the "long tail" of language that detectors struggle to classify.
Conclusion
CoPA demonstrates that LLMs can be steered to produce text that is nearly invisible to current detection algorithms without specialized training. However, this method introduces computational overhead, as it requires two forward passes per token, doubling the latency of generation. Future work will explore extending CoPA to other languages and developing more robust "Adaptive Defenses" to counter such sophisticated attacks.
Summary updated