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

Xun Guo, Shan Zhang, Yongxin He, Ting Zhang, Wanquan Feng +2 more
2/3/2026

No official code found. Best implementation: heyongxin233/DeTeCtive (57 stars, last commit 2025-11-09). 1 more below.

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.

View on arXivView PDF

Code Implementations(2)

[NeurIPS 2024] DeTeCtive: Detecting AI-generated Text via Multi-Level Contrastive Learning

577Shell, PythonOct 17, 202411 months ago
ai-text-detectiondeepfakesllmsneurips-2024

这是关于论文《DeTeCtive: Detecting AI-generated Text via Multi-Level Contrastive Learning》的jittor代码复现仓库

00Shell, PythonJan 31, 20268 months ago

Similar Papers

Cite this paper

@article{guo2026detective,
  title  = {DeTeCtive: Detecting AI-generated Text via Multi-Level Contrastive Learning},
  author = {Xun Guo and Shan Zhang and Yongxin He and Ting Zhang and Wanquan Feng and Haibin Huang and Chongyang Ma},
  year   = {2026},
  eprint = {2410.20964},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2410.20964},
  url    = {https://arxiv.org/abs/2410.20964},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.20964.svg)](https://codeofpaper.com/paper/2410.20964)

Discussion