DeTeCtive: Rethinking AI-Generated Text Detection via Multi-Level Style Attribution

DeTeCtive: Detecting AI-generated Text via Multi-Level Contrastive Learning

2024-10-28
Xun Guo, Shan Zhang, Yongxin He, Ting Zhang, Wanquan Feng, Haibin Huang, Chongyang Ma
Summary
Problem
Method
Results
Takeaways
Abstract

This paper introduces DeTeCtive, a multi-level contrastive learning framework designed to detect AI-generated text by distinguishing unique writing styles rather than performing simple binary classification. DeTeCtive utilizes a multi-task auxiliary loss and a dense information retrieval pipeline, achieving state-of-the-art results across major benchmarks like Deepfake, M4, and TuringBench.

TL;DR

Existing AI text detectors often break when facing a new model like GPT-4 or Llama-3 because they treat "AI-generated" as a single, static category. DeTeCtive flips the script: it treats every LLM as a unique author with its own fingerprint. By using a multi-level contrastive learning framework and a training-free adaptation strategy, it achieves state-of-the-art accuracy and shows unprecedented resilience to out-of-distribution (OOD) domains and paraphrasing attacks.

The Motivating Insight: LLMs as Authors

Modern AI detection is a cat-and-mouse game. When a new LLM is released, old detectors (trained on GPT-2 or GPT-3) often fail because the "statistical signature" of the text has shifted. The authors of DeTeCtive argue that the problem lies in the Binary Classification Trap.

Instead of asking, "Is this human or AI?", they ask, "What is the stylistic kinship of this text?". By mapping writing styles into a high-dimensional feature space, they can identify the "familial" similarities between models from the same company (e.g., the Llama family) and the stark differences between human prose and machine output.

Methodology: Contrastive Kinship

The core of DeTeCtive is its Multi-task Auxiliary Multi-level Contrastive Learning.

  1. Hierarchical Relationships: The model is trained to recognize four layers of distribution:
    • : Text from a specific LLM.
    • : Text from the same model series/company.
    • : Text from any LLM.
    • : Human-written text.
  2. Multi-Level Contrastive Loss: Unlike standard contrastive learning that treats all "negatives" the same, DeTeCtive uses a weighted loss that forces the encoder to understand that a Llama-7B text is "closer" to a Llama-65B text than it is to a GPT-3 text, and much further from human text.
  3. Dense Retrieval Inference: Instead of a simple Softmax layer, DeTeCtive uses a KNN-based retrieval pipeline. It pre-encodes the training set into a feature database. During inference, it searches for the nearest neighbors of the query text to determine its source.

Overview of DeTeCtive Framework

Disruptive Feature: Training-Free Incremental Adaptation (TFIA)

Perhaps the most practical contribution is TFIA. In traditional systems, to detect a new model (e.g., Llama-3), you would need to fine-tune the entire detector. With DeTeCtive, you simply:

  1. Generate/Collect a small sample of the new model's text.
  2. Run them through the frozen DeTeCtive encoder.
  3. Add these vectors to your retrieval database.

The system now "knows" what the new model looks like without a single gradient update.

Experimental Results: Setting New Benchmarks

The authors tested DeTeCtive against baselines like RoBERTa, DetectGPT, and Longformer across Deepfake, M4, and TuringBench datasets.

  • Generalization: On "Unseen Domains" (OOD), DeTeCtive outperformed existing SOTA by 14.2% in Average Recall.
  • Attack Robustness: Even under heavy paraphrasing attacks (DIPPER/OUTFOX), where most detectors' performance collapses, DeTeCtive maintained near-peak accuracy thanks to its fault-tolerant KNN mechanism.

Performance comparison across datasets

Visualizing the Latent Space: UMAP projections show that while pre-trained models see a messy cloud of text, DeTeCtive creates clear, clustered islands for different model families and human sources.

UMAP Visualizations

Critical Analysis & Conclusion

Takeaway: DeTeCtive proves that style is a more stable signal than statistical probability when it comes to LLM detection. Its ability to adapt via TFIA makes it one of the few frameworks truly ready for the rapid-fire release cycle of modern LLMs.

Limitations:

  • Database Scaling: As the feature database grows to millions of entries, retrieval latency might become an issue (though tools like Faiss mitigate this).
  • Interpretability: While the clusters are clear, what specific stylistic tokens (syntax, vocabulary choices) the model is latching onto remains a "black box" for future research.

DeTeCtive represents a significant step forward in ensuring LLM compliance and information security in an era where the line between human and machine is increasingly blurred.

Find Similar Papers

Try Our Examples

  • Search for recent papers that utilize authorship attribution or stylometry techniques to distinguish between text generated by different large language model families.
  • Which paper originally proposed using K-Nearest Neighbors (KNN) for dense information retrieval in text classification, and how does this paper build upon that for AI detection?
  • Are there any studies exploring the application of multi-level contrastive learning for detecting AI-generated content in other modalities, such as synthetic images or deepfake audio?
Contents
DeTeCtive: Rethinking AI-Generated Text Detection via Multi-Level Style Attribution
1. TL;DR
2. The Motivating Insight: LLMs as Authors
3. Methodology: Contrastive Kinship
4. Disruptive Feature: Training-Free Incremental Adaptation (TFIA)
5. Experimental Results: Setting New Benchmarks
6. Critical Analysis & Conclusion