Table of Contents
Fetching ...

DetectLLM: Leveraging Log Rank Information for Zero-Shot Detection of Machine-Generated Text

Jinyan Su, Terry Yue Zhuo, Di Wang, Preslav Nakov

TL;DR

This work tackles the problem of detecting machine-generated text with zero-shot methods under white-box assumptions. It introduces two log-rank–based detectors, LRR and NPR, that leverage log-likelihood and log-rank information (and perturbation sensitivity for NPR) to outperform prior zero-shot detectors with varying efficiency and accuracy. Through extensive experiments on XSum, SQuAD, and WritingPrompts across multiple LLMs, the methods achieve substantial AUROC gains and reveal practical guidelines for decoding strategies, perturbation functions, and resource constraints. The findings show NPR typically offers higher efficiency, while LRR provides robustness and competitive performance, offering actionable choices for deployment in real-world screening and content verification tasks.

Abstract

With the rapid progress of large language models (LLMs) and the huge amount of text they generated, it becomes more and more impractical to manually distinguish whether a text is machine-generated. Given the growing use of LLMs in social media and education, it prompts us to develop methods to detect machine-generated text, preventing malicious usage such as plagiarism, misinformation, and propaganda. Previous work has studied several zero-shot methods, which require no training data. These methods achieve good performance, but there is still a lot of room for improvement. In this paper, we introduce two novel zero-shot methods for detecting machine-generated text by leveraging the log rank information. One is called DetectLLM-LRR, which is fast and efficient, and the other is called DetectLLM-NPR, which is more accurate, but slower due to the need for perturbations. Our experiments on three datasets and seven language models show that our proposed methods improve over the state of the art by 3.9 and 1.75 AUROC points absolute. Moreover, DetectLLM-NPR needs fewer perturbations than previous work to achieve the same level of performance, which makes it more practical for real-world use. We also investigate the efficiency--performance trade-off based on users preference on these two measures and we provide intuition for using them in practice effectively. We release the data and the code of both methods in https://github.com/mbzuai-nlp/DetectLLM

DetectLLM: Leveraging Log Rank Information for Zero-Shot Detection of Machine-Generated Text

TL;DR

This work tackles the problem of detecting machine-generated text with zero-shot methods under white-box assumptions. It introduces two log-rank–based detectors, LRR and NPR, that leverage log-likelihood and log-rank information (and perturbation sensitivity for NPR) to outperform prior zero-shot detectors with varying efficiency and accuracy. Through extensive experiments on XSum, SQuAD, and WritingPrompts across multiple LLMs, the methods achieve substantial AUROC gains and reveal practical guidelines for decoding strategies, perturbation functions, and resource constraints. The findings show NPR typically offers higher efficiency, while LRR provides robustness and competitive performance, offering actionable choices for deployment in real-world screening and content verification tasks.

Abstract

With the rapid progress of large language models (LLMs) and the huge amount of text they generated, it becomes more and more impractical to manually distinguish whether a text is machine-generated. Given the growing use of LLMs in social media and education, it prompts us to develop methods to detect machine-generated text, preventing malicious usage such as plagiarism, misinformation, and propaganda. Previous work has studied several zero-shot methods, which require no training data. These methods achieve good performance, but there is still a lot of room for improvement. In this paper, we introduce two novel zero-shot methods for detecting machine-generated text by leveraging the log rank information. One is called DetectLLM-LRR, which is fast and efficient, and the other is called DetectLLM-NPR, which is more accurate, but slower due to the need for perturbations. Our experiments on three datasets and seven language models show that our proposed methods improve over the state of the art by 3.9 and 1.75 AUROC points absolute. Moreover, DetectLLM-NPR needs fewer perturbations than previous work to achieve the same level of performance, which makes it more practical for real-world use. We also investigate the efficiency--performance trade-off based on users preference on these two measures and we provide intuition for using them in practice effectively. We release the data and the code of both methods in https://github.com/mbzuai-nlp/DetectLLM
Paper Structure (44 sections, 2 equations, 10 figures, 9 tables)

This paper contains 44 sections, 2 equations, 10 figures, 9 tables.

Figures (10)

  • Figure 1: Distribution of LRR and NPR visualized on 300 human-written texts (HG) from the WritingPrompts dataset fan2018hierarchical as well as 300 texts generated with GPT2-xl (MG) by prompting it with the first 30 tokens from human-written texts.
  • Figure 2: Comparison of DetectGPT to NPR averaged across six models (in terms of AUROC). (The full results are given in Figure \ref{['fig: rank vs prob- 6 models']} in the Appendix).
  • Figure 3: Comparing LRR and NPR when T5-small and T5-base are used for perturbation in NPR (AUROC scores).
  • Figure 4: Comparing LRR and NPR when T5-3b and T5-large are used for the perturbation in NPR (AUROC scores).
  • Figure 5: Comparing supervised methods with different temperature (AUROC score).
  • ...and 5 more figures