Abstract
Detecting AI-generated text (AIGT) has become increasingly difficult as users move away from simple copy-pasting toward "hybrid" documents that mix human and AI-authored content. Traditional document-level detectors often fail on these fine-grained tasks. We present SeqXGPT, a novel framework that treats word-wise log probabilities from Large Language Models (LLMs) as wave-like signals. By employing a hybrid CNN-Transformer architecture, SeqXGPT achieves state-of-the-art performance in pinpointing AI-generated sentences within mixed documents, demonstrating superior generalization across different models and domains.
Introduction
The rapid proliferation of Large Language Models (LLMs) has led to a surge in AI-generated content. While document-level detection has seen significant progress, real-world scenarios often involve "polished" text where human authors integrate AI-generated sentences into their own work. Existing detection methods struggle with such mixed-source documents due to the brevity of individual sentences and the tendency of supervised models to overfit to specific training distributions. SeqXGPT addresses these challenges by shifting the focus from raw text to the underlying statistical "rhythms" of LLMs.
The Challenge of Mixed Content
Most current AIGT detectors require long stretches of text (typically over 100 tokens) to identify statistical signatures. In mixed documents, these signatures are diluted. Zero-shot methods like DetectGPT, which rely on text perturbations, lose efficacy at the sentence level because small changes in short sentences do not produce a statistically significant signal. Furthermore, supervised models like fine-tuned RoBERTa often memorize the vocabulary of their training sets, leading to poor performance when encountering text from a new, unseen LLM.
Methodology: Language as a Signal
SeqXGPT introduces a paradigm shift by treating language detection as a signal processing task. The core of the method lies in extracting "white-box" features from several reference LLMs (e.g., GPT-2, LLaMA).
Log-Probability "Waves"
Instead of analyzing words directly, SeqXGPT computes the log probabilities of each word in a sentence according to multiple reference models. These probabilities fluctuate, creating a unique "wave" for each model. The authors hypothesize that LLMs exhibit specific patterns in how they assign these probabilities, which differ fundamentally from human writing patterns.
Hybrid Architecture
To process these signals, SeqXGPT utilizes a two-stage architecture:
- Convolutional Neural Network (CNN): Used to capture local temporal patterns within the log-probability waves.
- Transformer: The CNN output is fed into a self-attention network to capture long-range dependencies and contextual relationships across the entire sentence.
The model performs sequence labeling at the word level, and a final voting mechanism determines whether the sentence is human or AI-generated.
Datasets and Evaluation
To evaluate the framework, the researchers developed SeqXGPT-Bench, a comprehensive dataset of 30,000 documents. These documents were constructed by taking human-authored news, social media, and scientific articles and using LLMs (including GPT-2, GPT-Neo, GPT-J, LLaMA, and GPT-3.5-turbo) to generate continuations. To test robustness, an Out-of-Distribution (OOD) dataset based on TriviaQA was also created.
Key Results
SeqXGPT demonstrates significant improvements over existing baselines:
- High Accuracy: On GPT-2 and GPT-Neo datasets, SeqXGPT achieved a Macro-F1 score of approximately 97%, far outperforming supervised baselines like Sent-RoBERTa (~84%).
- Model Identification: In multiclass detection tasks (identifying which specific model generated a sentence), SeqXGPT maintained a 95.7% Macro-F1 score, while previous state-of-the-art methods dropped below 45%.
- Robust Generalization: On the OOD TriviaQA dataset, SeqXGPT retained a 92.8% F1 score. This suggests that log-probability "waves" are a more universal and reliable feature for detection than raw text features, which are prone to domain-specific overfitting.
Conclusion and Future Work
SeqXGPT provides a robust solution for fine-grained AI text detection by leveraging the internal probability distributions of LLMs. While highly effective, the authors note that future iterations could benefit from integrating semantic features to catch more sophisticated AI writing. Additionally, exploring a wider variety of prompting styles and more complex "Frankenstein" documents (mixing multiple AI sources) remains an important area for future research.
Summary updated