Lune

ICLR2024Top-tier venue

DNA-GPT: Divergent N-Gram Analysis for Training-Free Detection of GPT-Generated Text

Xianjun Yang, Wei Cheng, Yue Wu, Linda Ruth Petzold, William Yang Wang, Haifeng Chen

Abstract

Large language models (LLMs) have notably enhanced the fluency and diversity of machine-generated text. However, this progress also presents a significant challenge in detecting the origin of a given text, and current research on detection methods lags behind the rapid evolution of LLMs. Conventional training-based methods have limitations in flexibility, particularly when adapting to new domains, and they often lack explanatory power. To address this gap, we propose a novel training-free detection strategy called Divergent N-Gram Analysis (DNA-GPT). Given a text, we first truncate it in the middle and then use only the preceding portion as input to the LLMs to regenerate the new remaining parts. By analyzing the differences between the original and new remaining parts through N-gram analysis in black-box or probability divergence in white-box, we unveil significant discrepancies between the distribution of machine-generated text and the distribution of human-written text. We conducted extensive experiments on the most advanced LLMs from OpenAI, including text-davinci-003, GPT-3.5-turbo, and GPT-4, as well as open-source models such as GPT-NeoX-20B and LLaMa-13B. Results show that our zero-shot approach exhibits state-of-the-art performance in distinguishing between human and GPT-generated text on four English and one German dataset, outperforming OpenAI's own classifier, which is trained on millions of text. Additionally, our methods provide reasonable explanations and evidence to support our claim, which is a unique feature of explainable detection. Our method is also robust under the revised text attack and can additionally solve model sourcing. Codes are available at https://github.com/Xianjun-Yang/DNA-GPT.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

52 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • BiScope: AI-generated Text Detection by Checking Memorization of Preceding Tokens cites DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvature
  • BiScope: AI-generated Text Detection by Checking Memorization of Preceding Tokens cites Spotting LLMs With Binoculars: Zero-Shot Detection of Machine-Generated Text
  • BiScope: AI-generated Text Detection by Checking Memorization of Preceding Tokens cites Fast-DetectGPT: Efficient Zero-Shot Detection of Machine-Generated Text via Conditional Probability Curvature
  • DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvature cites Language Models are Few-Shot Learners
  • Monitoring AI-Modified Content at Scale: A Case Study on the Impact of ChatGPT on AI Conference Peer Reviews cites DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvature
  • Spotting LLMs With Binoculars: Zero-Shot Detection of Machine-Generated Text cites DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvature
  • Spotting LLMs With Binoculars: Zero-Shot Detection of Machine-Generated Text cites Language Models are Few-Shot Learners
  • Spotting LLMs With Binoculars: Zero-Shot Detection of Machine-Generated Text cites Fast-DetectGPT: Efficient Zero-Shot Detection of Machine-Generated Text via Conditional Probability Curvature
  • Language Models are Few-Shot Learners cites The Curious Case of Neural Text Degeneration
  • Fast-DetectGPT: Efficient Zero-Shot Detection of Machine-Generated Text via Conditional Probability Curvature cites DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvature
  • Fast-DetectGPT: Efficient Zero-Shot Detection of Machine-Generated Text via Conditional Probability Curvature cites Language Models are Few-Shot Learners
  • Fast-DetectGPT: Efficient Zero-Shot Detection of Machine-Generated Text via Conditional Probability Curvature cites Training language models to follow instructions with human feedback
  • Who Wrote this Code? Watermarking for Code Generation cites DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvature
  • Who Wrote this Code? Watermarking for Code Generation cites The Curious Case of Neural Text Degeneration
  • Training language models to follow instructions with human feedback cites Language Models are Few-Shot Learners
  • Training language models to follow instructions with human feedback cites Extracting Training Data from Large Language Models
  • Extracting Training Data from Large Language Models cites Language Models are Few-Shot Learners
  • Extracting Training Data from Large Language Models cites The Curious Case of Neural Text Degeneration
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers52

  1. Fast-DetectGPT: Efficient Zero-Shot Detection of Machine-Generated Text via Conditional Probability CurvatureGuangsheng Bao, Yanbin Zhao, Zhiyang Teng, Linyi Yang et al.ICLR 2024 · 311 citations
  2. Spotting LLMs With Binoculars: Zero-Shot Detection of Machine-Generated TextAbhimanyu Hans, Avi Schwarzschild, Valeriia Cherepanova, Hamid Kazemi et al.ICML 2024 · 262 citations
  3. Monitoring AI-Modified Content at Scale: A Case Study on the Impact of ChatGPT on AI Conference Peer ReviewsWeixin Liang, Zachary Izzo, Yaohui Zhang, Haley Lepp et al.ICML 2024 · 213 citations
  4. BiScope: AI-generated Text Detection by Checking Memorization of Preceding TokensHanxi Guo, Siyuan Cheng, Xiaolong Jin, Zhuo Zhang et al.NeurIPS 2024 · 52 citations
  5. Who Wrote this Code? Watermarking for Code GenerationTaehyun Lee, Seokhee Hong, Jaewoo Ahn, Ilgee Hong et al.ACL 2024 · 36 citations

Builds on10

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida et al.NeurIPS 2022 · 24,707 citations
  3. The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes et al.ICLR 2020 · 4,112 citations
  4. Extracting Training Data from Large Language ModelsNicholas Carlini, Florian Tramèr, Eric Wallace, Matthew Jagielski et al.USENIX Security 2021 · 2,866 citations
  5. DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability CurvatureEric Mitchell, Yoonho Lee, Alexander Khazatsky, Christopher D. Manning et al.ICML 2023 · 988 citations

Related papers

  1. DNA-DetectLLM: Unveiling AI-Generated Text via a DNA-Inspired Mutation-Repair ParadigmXiaowei Zhu, Yubing Ren, Fang Fang, Qingfeng Tan et al.NeurIPS 2025 · 10 citations
  2. Detecting Machine-Generated Long-Form Content with Latent-Space VariablesYufei Tian, Zeyu Pan, Nanyun PengEMNLP Findings 2024 · 3 citations
  3. DALD: Improving Logits-based Detector without Logits from Black-box LLMsCong Zeng, Shengkun Tang, Xianjun Yang, Yuanzhou Chen et al.NeurIPS 2024
  4. LLMDet: A Third Party Large Language Models Generated Text Detection ToolKangxi Wu, Liang Pang, Huawei Shen, Xueqi Cheng et al.EMNLP Findings 2023 · 31 citations
  5. Learning to Rewrite: Generalized LLM-Generated Text DetectionWei Hao, Ran Li, Weiliang Zhao, Junfeng Yang et al.ACL 2025
Dusk over the sea between two cliffs drawn in fine vertical lines