3
stars
349
commits
Python
primary language
Nov 15, 2024
updated
This code is for paper "ONLINE DETECTING LLM-GENERATED TEXTS VIA SEQUENTIAL HYPOTHESIS TESTING BY BETTING ", where we borrow or extend some code from Fast-DetectGPT and auditing-fairness.
Our method detects the source of texts observed in a streaming fashion. Tests are implemented in a black-box setting, meaning the model used for scoring texts is different from the source model used to generate them.
Our method builds upon and complements existing offline detection techniques. Specifically, We utilize 10 score functions of existing detectors to compute the scores of texts:
The scoring models GPT-Neo-2.7B and Gemma-2B are applied to eveluate metrics involved in the first 8 score functions listed above.
bash setup.sh(Notes: our experiments are run on 1 GPU of Tesla A100 with 40G memory.)
Our experiments are organized into the following directories:
./exp_main: Contains experiments for detecting Paris 2024 Olympic news or fake Olympic news generated by LLMs, including Gemini-1.5-Flash, Gemini-1.5-Pro, and PaLM 2. The scoring models used are GPT-Neo-2.7B and Gemma-2B.
./exp_gpt3to4: Contains experiments for detecting human-written texts versus LLM-generated texts of various domains, based on the existing dataset from Fast-DetectGPT. Source models include GPT-3, ChatGPT, and GPT-4, with GPT-Neo-2.7B as the scoring model.
Both ./exp_main and ./exp_gpt3to4 include the following common subdirectories:
/raw_data: Stores human-written texts alongside an equal number of texts generated by the source models based on the first 30 tokens of the human-written texts./data: Includes scores of both human-written and LLM-generated texts./results: Contains raw results from the detection of human-written versus LLM-generated texts using specific score functions under each configuration, results of statistical metrics of 10 score functions under the same configurations used for plotting, as well as the final plotting results.Two scenarios are considered:
If you find this work useful, you can cite it with this BibTex entry:
@misc{chen2024onlinedetectingllmgeneratedtexts,
title={Online Detecting LLM-Generated Texts via Sequential Hypothesis Testing by Betting},
author={Can Chen and Jun-Kun Wang},
year={2024},
eprint={2410.22318},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2410.22318},
}
349 commits
Python
75.5%
Shell
15.1%
Jupyter Notebook
9.4%
3
stars
349
commits
Python
primary language
Nov 15, 2024
updated
This code is for paper "ONLINE DETECTING LLM-GENERATED TEXTS VIA SEQUENTIAL HYPOTHESIS TESTING BY BETTING ", where we borrow or extend some code from Fast-DetectGPT and auditing-fairness.
Our method detects the source of texts observed in a streaming fashion. Tests are implemented in a black-box setting, meaning the model used for scoring texts is different from the source model used to generate them.
Our method builds upon and complements existing offline detection techniques. Specifically, We utilize 10 score functions of existing detectors to compute the scores of texts:
The scoring models GPT-Neo-2.7B and Gemma-2B are applied to eveluate metrics involved in the first 8 score functions listed above.
bash setup.sh(Notes: our experiments are run on 1 GPU of Tesla A100 with 40G memory.)
Our experiments are organized into the following directories:
./exp_main: Contains experiments for detecting Paris 2024 Olympic news or fake Olympic news generated by LLMs, including Gemini-1.5-Flash, Gemini-1.5-Pro, and PaLM 2. The scoring models used are GPT-Neo-2.7B and Gemma-2B.
./exp_gpt3to4: Contains experiments for detecting human-written texts versus LLM-generated texts of various domains, based on the existing dataset from Fast-DetectGPT. Source models include GPT-3, ChatGPT, and GPT-4, with GPT-Neo-2.7B as the scoring model.
Both ./exp_main and ./exp_gpt3to4 include the following common subdirectories:
/raw_data: Stores human-written texts alongside an equal number of texts generated by the source models based on the first 30 tokens of the human-written texts./data: Includes scores of both human-written and LLM-generated texts./results: Contains raw results from the detection of human-written versus LLM-generated texts using specific score functions under each configuration, results of statistical metrics of 10 score functions under the same configurations used for plotting, as well as the final plotting results.Two scenarios are considered:
If you find this work useful, you can cite it with this BibTex entry:
@misc{chen2024onlinedetectingllmgeneratedtexts,
title={Online Detecting LLM-Generated Texts via Sequential Hypothesis Testing by Betting},
author={Can Chen and Jun-Kun Wang},
year={2024},
eprint={2410.22318},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2410.22318},
}
349 commits
Python
75.5%
Shell
15.1%
Jupyter Notebook
9.4%