This code is for ICLR 2024 paper "Fast-DetectGPT: Efficient Zero-Shot Detection of Machine-Generated Text via Conditional Probability Curvature", where we borrow or extend some code from DetectGPT.
Paper | LocalDemo | OnlineDemo | OpenReview
Method | 5-Model Generations ↑ | ChatGPT/GPT-4 Generations ↑ | Speedup ↑ |
---|---|---|---|
DetectGPT | 0.9554 | 0.7225 | 1x |
Fast-DetectGPT | 0.9887 (relative↑ 74.7%) | 0.9338 (relative↑ 76.1%) | 340x |
bash setup.sh
(Notes: our experiments are run on 1 GPU of Tesla A100 with 80G memory.)
Please run following command locally for an interactive demo:
python scripts/local_infer.py
where the default reference and sampling models are both gpt-neo-2.7B.
We could use gpt-j-6B as the reference model to obtain more accurate detections:
python scripts/local_infer.py --reference_model_name gpt-j-6B
An example (using gpt-j-6B as the reference model) looks like
Please enter your text: (Press Enter twice to start processing)
Disguised as police, they broke through a fence on Monday evening and broke into the cargo of a Swiss-bound plane to take the valuable items. The audacious heist occurred at an airport in a small European country, leaving authorities baffled and airline officials in shock.
Fast-DetectGPT criterion is 1.9299, suggesting that the text has a probability of 87% to be fake.
Following folders are created for our experiments:
(Notes: we share generations from GPT-3, ChatGPT, and GPT-4 in exp_gpt3to4/data for convenient reproduction.)
If you find this work useful, you can cite it with the following BibTex entry:
@inproceedings{bao2023fast,
title={Fast-DetectGPT: Efficient Zero-Shot Detection of Machine-Generated Text via Conditional Probability Curvature},
author={Bao, Guangsheng and Zhao, Yanbin and Teng, Zhiyang and Yang, Linyi and Zhang, Yue},
booktitle={The Twelfth International Conference on Learning Representations},
year={2023}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。