This repository is a official code of the research presented in the paper [arXiv]. The goal is to provide a transparent, open-source implementation for the community to explore and build upon.
The MixSet dataset is a comprehensive collection designed for advanced machine learning experiments. It's structured to support a variety of tasks including text classification, natural language understanding, and more.
The dataset is located in the ./data/MixSet/ directory relative to the project's root. Ensure that this path exists and contains the necessary data files before running any scripts that depend on the MixSet dataset.
To use the MixSet dataset in your experiments, refer to the scripts or modules specifically designed to read and process this data. Ensure that any path or configuration settings in your scripts point to the correct ./data/MixSet/ location.
If you customize or extend the dataset, consider documenting your changes here. This might include adding new files, filtering or processing data, or generating synthetic data points.
If the MixSet dataset is sourced from or inspired by an external project, publication, or another dataset, be sure to acknowledge the original creators or contributors here.
For any issues, questions, or suggestions related to the MixSet dataset, please contact Dongping Chen or open an issue in the project's repository.
- Python = 3.9
- Other dependencies specified in
requirements.txt
To set up your environment to run the code, follow these steps:
- Clone the Repository:
git clone https://github.com/Dongping-Chen/MixSet.git
cd MixSet- Create and Activate a Virtual Environment (optional but recommended) and Install the Required Packages:
conda create --name mixset python=3.9
conda activate mixset
pip install -r requirements.txt-
Download Datasets To download the MGT datasets, please refer to this link, then move the dataset folders to
<YOUR PATH>/MixSet/data/MGT_datasets/. To download the HWT datasets, please refer to this link, then move the dataset folders to<YOUR PATH>/MixSet/data/pure_processed_HWT/. -
Download Checkpoints of GPT-Sentinel Download the pretrained GPT-Sentinel t5-small and put to
<YOUR PATH>/MixSet/.
To reproduce the first experiments, run:
./Ex1_run.shYou should run GPT-Zero by:
./Ex1_run_GPTzeroAs for Ghostbuster, we will update the code as soon as possible.
To reproduce the second experiments for binary classification, run:
./Ex2_binary_runTo reproduce the second experiments for three-class classification, run:
./Ex2_three_class_runTo reproduce the third experiments for operation-wise transfer learning, run:
./Ex3_operation_train.sh
./Ex3_operation_test.shTo reproduce the third experiments for LLM-wise transfer learning, run:
./Ex3_LLM_transfer.shPlease be aware that the scripts for Experiment 3 and 4 require storing trained checkpoints in the folder path. This may occupy more than 20GB of space. It is essential to ensure that you have sufficient storage available on your device. Failing to allocate the necessary space might lead to interruptions during the code execution. We highly recommend checking and freeing up adequate space before running these scripts to ensure a smooth and uninterrupted experience.
To reproduce the fourth experiments for ablation study, run:
./Ex4_auto_train.sh
./Ex4_auto_test.shBelow are the parameters used in the script along with their descriptions:
--Mixcase_filename: Specifies the filename for the Mixcase data. Default isNone.--MGT_only_GPT: If set, the script will only use MGT (Model Generated Text) from GPT-family models.--test_only: If set, the script will only perform testing, skipping any training procedures.--train_threshold: Specifies the threshold for training. Default is10000.--no_auc: If set, the script will only calculate the Mixcase scenarios, which means no Area Under the ROC Curve (AUC) metrics.--only_supervised: If set, the script will perform only supervised learning without any unsupervised techniques.--train_with_mixcase: If set, the script will include Mixcase data in the training process.--seed: Sets the seed for random number generation to ensure reproducibility. Default is0.--ckpt_dir: Specifies the directory to save checkpoints. Default is"./ckpt".--log_name: Specifies the name of the log file. Default is'Log'.--mixcase_threshold: Sets the threshold for considering data as Mixcase. Default is0.8.--transfer_filename: Specifies the filename for transfer learning. Default isNone.--three_classes: If set, the script will use a three-class classification scheme instead of binary classification.--finetune: If set, the script will fine-tune the supervised model.--mixcase_as_mgt: If set, Mixcase data will be treated as Model Generated Text (MGT).
Contributions to this project are welcome. Please consider the following ways to contribute:
- Reporting issues
- Improving documentation
- Proposing new features or improvements
This project is based on the findings and methodologies presented in the paper MixSet. Part of the code is borrowed from MGTBench.
@misc{gao2024llmasacoauthor,
title={LLM-as-a-Coauthor: The Challenges of Detecting LLM-Human Mixcase},
author={Chujie Gao and Dongping Chen and Qihui Zhang and Yue Huang and Yao Wan and Lichao Sun},
year={2024},
eprint={2401.05952},
archivePrefix={arXiv},
primaryClass={cs.CL}
}