Skip to main content
QUICK REVIEW

[论文解读] DNA-GPT: Divergent N-Gram Analysis for Training-Free Detection of GPT-Generated Text

Xianjun Yang, Wei Cheng|arXiv (Cornell University)|May 27, 2023
Topic ModelingComputer Science被引用 20
一句话总结

DNA-GPT 引入一种无需训练、零样本的检测器,通过截断输入、用大语言模型重新生成继续文本,并分析 n-gram 或概率的发散来区分 GPT 生成的文本与人类文本——在黑盒和白盒设置中实现了最先进的结果,同时提供可解释的证据。

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.

研究动机与目标

  • 随着 LLM 的发展,激发对灵活且可解释的 AI 生成文本检测的需求。
  • 提出一个无需训练的检测框架(DNA-GPT),对比基于前文条件的机器与人类续写。
  • 提供带有可解释证据的黑盒和白盒检测机制。
  • 在多个数据集上,对 OpenAI 模型和开源 LLM 进行方法验证。
  • 展示对修订文本攻击的鲁棒性并实现模型来源识别。

提出的方法

  • 将输入文本按比例 gamma 截断以形成 X 和 Y0(其余部分)。
  • 使用目标 LLM 从 X 重新生成 K 个续写 Y1,...,YK。
  • 基于 {Yk} 与 Y0 之间的差异计算分数(黑盒为 BScore;白盒为 WScore)。
  • 在黑盒中,使用 Yk 与 Y0 之间的 n-gram 重叠,并配合权重函数 f(n)(f(n)=n log n;n0=4,N=25)。
  • 在白盒中,使用模型对数概率比 p(Y0|X) / p(Yk|X)。
  • 通过跨多次再生的重叠 n-gram 提供证据。

实验结果

研究问题

  • RQ1一个无需训练、零-shot 的检测器是否能在多种模型和领域中可靠地区分 GPT 生成的文本与人类文本?
  • RQ2在前文条件下是否会揭示机器与人类续写分布之间的差异(Likelihood-Gap 假设),从而实现检测?
  • RQ3在数据集和语言上,黑盒和白盒变体在性能与可解释性方面的对比如何?
  • RQ4该方法对修订文本攻击是否鲁棒,并且是否具备模型来源能力?

主要发现

  • DNA-GPT 在多个数据集和模型上实现了领先的检测性能(在 1% FPR 下的 AUROC 和 TPR 更高),超越基于训练的基线。
  • 黑盒检测使用 BScore,白盒检测使用 WScore,在 OpenAI 模型(GPT-3.5-turbo、GPT-4)和开源模型(GPT-NeoX-20B、LLaMa-13B)上表现强劲。
  • 截断比 gamma ≈ 0.5,K 在 5–20 范围内,在各种设置下均可获得强健、稳健的结果。
  • 该方法通过重叠的 n-gram 提供可解释的证据,辅助解释和潜在的抄袭评估。
  • DNA-GPT 在对修订文本攻击方面表现出鲁棒性,并通过比较跨模型再生模式实现模型来源识别。
  • 非英语检测(德语)与英语具有竞争力,展示了在不进行语言特定训练的情况下的零-shot 能力。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。