Skip to main content
QUICK REVIEW

[Paper Review] DeTeCtive: Detecting AI-generated Text via Multi-Level Contrastive Learning

Xun Guo, Shan Zhang|arXiv (Cornell University)|Oct 28, 2024
Topic ModelingComputer Science3 citations
TL;DR

DeTeCtive proposes a multi-level contrastive learning framework that reformulates AI-generated text detection as writing style discrimination rather than binary classification. By enhancing text encoder representations through multi-task contrastive learning and enabling Training-Free Incremental Adaptation (TFIA), it achieves state-of-the-art performance, especially in out-of-distribution detection, with a 14.20% improvement in AvgRec on unseen domains and strong zero-shot generalization across benchmarks.

ABSTRACT

Current techniques for detecting AI-generated text are largely confined to manual feature crafting and supervised binary classification paradigms. These methodologies typically lead to performance bottlenecks and unsatisfactory generalizability. Consequently, these methods are often inapplicable for out-of-distribution (OOD) data and newly emerged large language models (LLMs). In this paper, we revisit the task of AI-generated text detection. We argue that the key to accomplishing this task lies in distinguishing writing styles of different authors, rather than simply classifying the text into human-written or AI-generated text. To this end, we propose DeTeCtive, a multi-task auxiliary, multi-level contrastive learning framework. DeTeCtive is designed to facilitate the learning of distinct writing styles, combined with a dense information retrieval pipeline for AI-generated text detection. Our method is compatible with a range of text encoders. Extensive experiments demonstrate that our method enhances the ability of various text encoders in detecting AI-generated text across multiple benchmarks and achieves state-of-the-art results. Notably, in OOD zero-shot evaluation, our method outperforms existing approaches by a large margin. Moreover, we find our method boasts a Training-Free Incremental Adaptation (TFIA) capability towards OOD data, further enhancing its efficacy in OOD detection scenarios. We will open-source our code and models in hopes that our work will spark new thoughts in the field of AI-generated text detection, ensuring safe application of LLMs and enhancing compliance. Our code is available at https://github.com/heyongxin233/DeTeCtive.

Motivation & Objective

  • To overcome the limitations of existing AI text detection methods that rely on manual feature engineering and binary classification, which suffer from poor generalization to out-of-distribution (OOD) data and new LLMs.
  • To reframe AI-generated text detection as a writing style discrimination task in a high-dimensional feature space, leveraging the distinct stylistic patterns of different authors, including LLMs.
  • To develop a training-free, incremental adaptation mechanism (TFIA) that enhances detection performance on unseen models and domains without retraining.
  • To improve the robustness and generalization of text encoders in detecting AI-generated content across diverse benchmarks and unseen scenarios.
  • To establish a new SOTA benchmark for AI-generated text detection through a dense retrieval pipeline and contrastive representation learning.

Proposed method

  • DeTeCtive employs a multi-task auxiliary contrastive learning framework that jointly optimizes for multiple levels of textual relatedness: human-written vs. AI-generated, and within-class variations among different LLMs or human writers.
  • It introduces a multi-level contrastive loss $\mathcal{L}_{mcl}$ that models positive and negative pairs at different granularities, including intra-class and inter-class relations, to enhance discriminative representation learning.
  • The method uses a dense information retrieval pipeline: pre-encoding training data into a feature database and classifying queries via K-Nearest Neighbors (KNN) based on cosine similarity to stored embeddings.
  • A novel Training-Free Incremental Adaptation (TFIA) scheme is introduced, where OOD data are encoded with the pre-trained model and directly added to the feature database without retraining.
  • The framework is compatible with various text encoders (e.g., BERT-based, T5-based), enabling plug-and-play enhancement of existing models.
  • UMAP visualization is used to demonstrate that DeTeCtive’s learned embeddings effectively cluster by writing style, even in unsupervised settings.

Experimental results

Research questions

  • RQ1Can AI-generated text detection be improved by reframing it as a writing style discrimination task rather than a binary classification problem?
  • RQ2How effective is multi-level contrastive learning in capturing fine-grained stylistic differences between human writers and LLMs?
  • RQ3Can a training-free incremental adaptation mechanism significantly improve zero-shot detection performance on out-of-distribution models and domains?
  • RQ4To what extent does the proposed method generalize across unseen LLMs and domains compared to existing SOTA approaches?
  • RQ5Does the integration of contrastive learning with a dense retrieval pipeline enhance detection robustness and accuracy?

Key findings

  • DeTeCtive achieves state-of-the-art performance on all three major benchmarks, outperforming existing methods in both in-distribution and out-of-distribution settings.
  • On the Deepfake dataset’s Unseen Domains subset, DeTeCtive achieves an Average Recall (AvgRec) of 96.15, outperforming the previous SOTA by 14.20 percentage points.
  • On the Unseen Models subset, it achieves an AvgRec of 95.36, a 5.58 percentage point improvement over the previous SOTA.
  • Ablation studies confirm that removing any component of the multi-level contrastive loss leads to performance degradation, with the full $\mathcal{L}_{mcl}$ providing the largest gain.
  • The TFIA mechanism enables consistent performance improvement with minimal OOD data—adding just a small amount of OOD data significantly boosts detection on unseen domains.
  • UMAP visualizations show that DeTeCtive’s embeddings form clear, separable clusters by writing style, even without supervision, confirming its ability to learn discriminative representations.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.