DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvature
Written for the Research library (claude-opus-5-5) from the paper text. Original — arxiv.org/pdf/2301.11305
Summary
LLMs now write fluent prose, and people can barely tell it apart from human writing. That makes detection important for education and journalism. This Stanford paper (ICML 2023) introduces DetectGPT, a zero-shot detector. It needs no trained classifier, no collected dataset of real or fake passages, and no watermark. The method rests on a geometric observation. Text sampled from a model tends to sit where the model's log probability function curves downward, so slightly edited versions of it usually score lower. Edits of human-written text show no such consistent drop. To use this, DetectGPT masks spans of a passage and refills them with an off-the-shelf mask-filling model such as T5. It then compares the source model's log probability for the original with the average score of these perturbed versions, normalized by their spread. A large gap points to machine origin. Across several LLMs and datasets, the method beats earlier zero-shot baselines. For fake news articles from GPT-NeoX-20B, it raises AUROC from 0.81 to 0.95. Because nothing is trained, it can be applied to a newly released model right away.
Key points
- Criterion: The "perturbation discrepancy" is the original passage's log probability minus the mean log probability of its perturbed versions. It approximates the trace of the Hessian, which measures local curvature.
- Headline result: On GPT-NeoX (20B) news generations, AUROC rises from 0.81 (best zero-shot baseline, average log probability) to 0.95. Gains exceed 0.1 AUROC for several source models. Evaluation data include XSum, SQuAD, WritingPrompts and PubMedQA.
- Practical settings: Accuracy improves up to about 100 perturbations and then levels off. A discrepancy threshold of about 0.1 separates GPT-Neo-2.7B text from human text across domains. mT5 replaces T5 for non-English text.
- Limitations: The method assumes white-box access to the model's log probabilities, which can cost money through APIs and is not available for ChatGPT. It is more compute-heavy than baselines because every perturbation must be scored. Performance drops when mask-fillers rewrite a domain poorly, as with PubMedQA.
- Resources: Code and data are at ericmitchell.ai/detectgpt. The authors suggest combining the method with watermarking and scoring with ensembles of models in black-box settings.
Cited by
- Fast-DetectGPT: Efficient Zero-Shot Detection of Machine-Generated Text via Conditional Probability Curvature
- TrustLLM: Trustworthiness in Large Language Models
- Challenges and Applications of Large Language Models
- Paraphrasing evades detectors of AI-generated text, but retrieval is an effective defense
- Can AI-Generated Text be Reliably Detected?
Cite
@misc{mitchell2023detectgpt,
title = {{DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvature}},
author = {Mitchell, Eric and Lee, Yoonho and Khazatsky, Alexander and Manning, Christopher D. and Finn, Chelsea},
year = {2023},
doi = {10.48550/arxiv.2301.11305},
eprint = {2301.11305},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2301.11305}
}References
- G., Yin, P., Duke, T., Levskaya, A., Ghemawat, S., Dev, S., Michalewski, H., Garcia, X., Misra, V., Robinson, K., Fedus, L., Zhou, D., Ippolito, D., Luan, D., Lim, H., Zoph, B., Spiridonov, A., Sepassi, R., Dohan, D., Agrawal, S., Omernick, M., Dai, A. M., Pillai, T. S., Pellat, M., Lewkowycz, A., M… find
- Aaronson, S. My Projects at OpenAI, Nov 2022. URL https://scottaaronson.blog/?p=6823. ↗
- Bakhtin, A., Gross, S., Ott, M., Deng, Y., Ranzato, M., and Szlam, A. Real or fake? Learning to discriminate machine from human generated text. arXiv, 2019. URL http://arxiv.org/abs/1906.03351. — [arXiv:1906.03351](https://arxiv.org/abs/1906.03351) ↗
- Black, S., Gao, L., Wang, P., Leahy, C., and Biderman, S. GPT-Neo: Large Scale Autoregressive Language Modeling with Mesh-Tensorflow, March 2021. URL https: //doi.org/10.5281/zenodo.5297715. — [doi:10.5281/zenodo.5297715](https://doi.org/10.5281/zenodo.5297715) find
- Christian, J. CNET secretly used AI on articles that didn’t disclose that fact, staff say. https://web. archive.org/web/20230124063916/https: //futurism.com/cnet-ai-articles-label, 2023. Accessed: 2023-01-25. find
- Black, S., Biderman, S., Hallahan, E., Anthony, Q., Gao, L., Golding, L., He, H., Leahy, C., McDonell, K., Phang, J., Pieler, M., Prashanth, U. S., Purohit, S., Reynolds, L., Tow, J., Wang, B., and Weinbach, S. GPT-NeoX-20B: An open-source autoregressive language model. In Proceedings of the ACL Wor… find our card
- Bojar, O. r., Chatterjee, R., Federmann, C., Graham, Y., Haddow, B., Huck, M., Jimeno Yepes, A., Koehn, P., Logacheva, V., Monz, C., Negri, M., Neveol, A., Neves, M., Popel, M., Post, M., Rubino, R., Scarton, C., Specia, L., Turchi, M., Verspoor, K., and Zampieri, M. Findings of the 2016 conference… find our card
- Christiano, P. F., Leike, J., Brown, T., Martic, M., Legg, S., and Amodei, D. Deep reinforcement learning from human preferences. In Guyon, I., Luxburg, U. V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 30.… find
- Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and… find
- Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., Agarwal, S., Herbert-Voss, A., Krueger, G., Henighan, T., Child, R., Ramesh, A., Ziegler, D., Wu, J., Winter, C., Hesse, C., Chen, M., Sigler, E., Dolhansky, B., Bitton, J.,… find
- Gehrmann, S., Strobelt, H., and Rush, A. GLTR: Statistical detection and visualization of generated text. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pp. 111–116, Florence, Italy, July 2019. Association for Computational Linguist… find our card
- Liang, W., Yuksekgonul, M., Mao, Y., Wu, E., and Zou, J. Gpt detectors are biased against non-native english writers. arXiv preprint arXiv:2304.02819, 2023. find
- Lin, S., Hilton, J., and Evans, O. TruthfulQA: Measuring how models mimic human falsehoods. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 3214– 3252, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 1… find our card
- Guarnera, L., Giudice, O., and Battiato, S. Deepfake detection by analyzing convolutional traces. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops, June 2020. find
- Güera, D. and Delp, E. J. Deepfake video detection using recurrent neural networks. In 2018 15th IEEE International Conference on Advanced Video and Signal Based Surveillance (AVSS), pp. 1–6, 2018. doi: 10.1109/AVSS.2018.8639163. — [doi:10.1109/avss.2018.8639163](https://doi.org/10.1109/avss.2018.8639163) find
- Hutchinson, M. A stochastic estimator of the trace of the influence matrix for laplacian smoothing splines. Communications in Statistics - Simulation and Computation, 19(2):433–450, 1990. doi: 10.1080/ 03610919008812866. URL https://doi.org/10. 1080/03610919008812866. find
- Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., and Stoyanov, V. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019. find
- Mireshghallah, F., Mattern, J., Gao, S., Shokri, R., and Berg-Kirkpatrick, T. Smaller language models are better black-box machine-generated text detectors. arXiv preprint arXiv:2305.09859, 2023. — [arXiv:2305.09859](https://arxiv.org/abs/2305.09859) find
- Narayan, S., Cohen, S. B., and Lapata, M. Don’t give me the details, just the summary! Topic-aware convolutional neural networks for extreme summarization. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, 2018. find
- Ippolito, D., Duckworth, D., Callison-Burch, C., and Eck, D. Automatic detection of generated text is easiest when humans are fooled. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 1808–1822, Online, July 2020. Association for Computational Linguistic… find our card
- OpenAI. Chatgpt: Optimizing language models for dialogue. http://web.archive.org/web/ 20230109000707/https://openai.com/ blog/chatgpt/, 2022. Accessed: 2023-01-10. ↗
- Jawahar, G., Abdul-Mageed, M., and Lakshmanan, L. V. S. Automatic detection of machine generated text: A critical survey. In International Conference on Computational Linguistics, 2020. find
- Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., and Sutskever, I. Language models are unsupervised multitask learners, 2019. URL https://d4mucfpksywv.cloudfront.net/ better-language-models/language\_ models\_are\_unsupervised\_multitask\_ learners.pdf. ↗
- Jin, Q., Dhingra, B., Liu, Z., Cohen, W., and Lu, X. Pub-MedQA: A dataset for biomedical research question answering. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp… find our card
- Kirchenbauer, J., Geiping, J., Wen, Y., Katz, J., Miers, I., and Goldstein, T. A watermark for large language models, 2023. URL https://arxiv.org/abs/2301. 10226. ↗ our card
- Krishna, K., Song, Y., Karpinska, M., Wieting, J., and Iyyer, M. Paraphrasing evades detectors of ai-generated Raffel, C., Shazeer, N., Roberts, A., Lee, K., Narang, S., Matena, M., Zhou, Y., Li, W., and Liu, P. J. Exploring the limits of transfer learning with a unified text-to-text transformer. Jo… find
- Rajpurkar, P., Zhang, J., Lopyrev, K., and Liang, P. SQuAD: 100,000+ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 2383– 2392, Austin, Texas, November 2016. Association for Computational Linguistics. doi: 1… find our card
- Roose, K. and Newton, C. ChatGPT transforms a classroom and is ‘M3GAN’ real? Hard Fork, a New York Times Podcast, 2022. URL https:// www.nytimes.com/2023/01/13/podcasts/ hard-fork-chatgpt-teachers-gen-z-cameras-m3gan. html. find
- Sadasivan, V. S., Kumar, A., Balasubramanian, S., Wang, W., and Feizi, S. Can ai-generated text be reliably detected? arXiv preprint arXiv:2303.11156, 2023. find our card
- Solaiman, I., Brundage, M., Clark, J., Askell, A., Herbert-Voss, A., Wu, J., Radford, A., and Wang, J. Release strategies and the social impacts of language models, 2019. URL https://arxiv.org/ftp/arxiv/ papers/1908/1908.09203.pdf. ↗
- Uchendu, A., Le, T., Shu, K., and Lee, D. Authorship attribution for neural text generation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 8384–8395, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp… find
- Wang, B. and Komatsuzaki, A. GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model. https://github.com/kingoflolz/ mesh-transformer-jax, May 2021. ↗
- Zellers, R., Holtzman, A., Rashkin, H., Bisk, Y., Farhadi, A., Roesner, F., and Choi, Y. Defending against neural fake news. In Neural Information Processing Systems, 2019. find our card
- Zhang, S., Roller, S., Goyal, N., Artetxe, M., Chen, M., Chen, S., Dewan, C., Diab, M., Li, X., Lin, X. V., Mihaylov, T., Ott, M., Shleifer, S., Shuster, K., Simig, D., Koura, P. S., Sridhar, A., Wang, T., and Zettlemoyer, L. Opt: Open pre-trained transformer language models, 2022. URL https://arxiv… find
- Zhao, H., Zhou, W., Chen, D., Wei, T., Zhang, W., and Yu, N. Multi-attentional deepfake detection. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 2185–2194, 2021. find
- Zi, B., Chang, M., Chen, J., Ma, X., and Jiang, Y.-G. Wild-deepfake: A challenging real-world dataset for deepfake detection. In Proceedings of the 28th ACM international conference on multimedia, pp. 2382–2390, 2020. find
- Ziegler, D. M., Stiennon, N., Wu, J., Brown, T. B., Radford, A., Amodei, D., Christiano, P., and Irving, G. Fine-tuning language models from human preferences, 2020. find
- A. Complete Results for Top-p and Top-k Decoding find