
Contributions
- Empirical identification that LLM-generated text occupies negative curvature regions of the log probability function, while human text occupies higher or lower curvature regions.
- DetectGPT: a practical zero-shot algorithm that measures this perturbation discrepancy without access to model internals, using only log probability evaluations and perturbations under a mask-filling model.
- Comprehensive evaluation showing DetectGPT outperforms existing zero-shot baselines across multiple datasets and LLMs, with robustness to factors like mask-filling model size and number of perturbations.
Method
DetectGPT operates under the white-box setting where log probabilities are accessible. The core hypothesis is that when small perturbations are applied to a passage $x$ from source model $p_\theta$, the log probability tends to decrease for model-generated text but not for human text.
The method estimates the local curvature of the log probability function using two key steps:
-
Perturbation Generation: Apply small, semantically meaningful perturbations $q(\cdot \mid x)$ to the input passage (using a T5-3B mask-filling model) to generate perturbed versions.
-
Curvature Estimation: For each perturbation, compute $\log p_\theta(\tilde{x})$ and compare to the original. The perturbation discrepancy is defined as: $$d(x, p_θ, q) = \log p_θ(x) - \mathbb{E}_{x̃∼q(·|x)} [\log p_θ(x̃)]$$
The method interprets this discrepancy as approximating the trace of the Hessian of the log probability function, where negative trace indicates model-generated text. A simple thresholding rule on the normalized perturbation discrepancy produces the classification.
Results
Zero-shot detection: DetectGPT achieves the strongest average AUROC (0.95) on detecting news generated from GPT-NeoX across multiple datasets (XSum, SQuAD, WritingPrompts). It improves detection accuracy over existing zero-shot methods including log p(x) thresholding, rank, and entropy-based approaches.
Robustness: The method remains effective across:
- Different source LLMs (GPT-2, GPT-2 Medium/Large, GPT-3, GPT-NeoX) and scoring models (T5, other generic models)
- Varying mask-filling model sizes (60M to 2.7B parameters)
- Different numbers of perturbations (single perturbation to 100+ for convergence)
- Paraphrased machine-generated text and passages with partial revisions
Cross-model detection: When source and scoring models differ, DetectGPT still outperforms supervised detectors in some cases, showing the generality of the probability curvature signal.
Notes
Strengths: The paper identifies a clear and interpretable signal (probability curvature) for distinguishing model-generated from human text. The zero-shot approach avoids the data collection burden of prior work. The evaluation is thorough, testing across multiple datasets, models, and ablation conditions. The method generalizes reasonably well across different LLMs.
Limitations: The method requires white-box access to log probabilities, limiting applicability to black-box APIs. Performance degrades for short passages and is sensitive to passage length. The approach assumes the mask-filling model accurately represents meaningful perturbations. Long sequences may require multiple rounds of masking.
Open questions: Whether the probability curvature signal persists as LLMs improve in quality. How watermarking or other adversarial techniques affect detection. Whether the method extends beyond text to other modalities.