This repository contains the official implementation of Segmenting Human-LLM Co-authored Text via Change Point Detection (accepted at STAI-X 2026).
Our method provides a change point detection viewpoint on segmenting the human-LLM co-authored text (Figure 1 🧠). We leverage the hetergeneity among segments to design our method, achieves robust and state-of-the-art performance across a wide range of settings.
Figure 1. 🧠 AUCs of various detectors on the WikiQA and Story datasets with varying lengths of input texts. RoBERTa and AdaDetectGPT are two training-based detectors, the others are zero-shot detectors.
- Python 3.10.8
- PyTorch 2.11.0
- CUDA-compatible GPU (experiments conducted on A100 with 40GB memory)
./setup.shWe also attach a environment.yml file to show our detailed configuration on the conda environment.
Recommended for off-the-shelf usage:
python scripts/detector_value_cp.py \
--from_pretrained 'scripts/FineTune/ckpt/' \
--phi NFT \
--cp_method 'DP' \
--power 2.0 \
--cp_selection 'aic' \
--weight_type 'invar' \
--eval_dataset ${eval_data_path} \
--output_file ${eval_result_path}Make sure that your data is a .json file named xxx.raw_data.json with the following structure:
{
"sampled_sentence": [
["Sentence 1 of Document 1", "Sentence 2 of Document 1", ...],
["Sentence 1 of Document 2", "Sentence 2 of Document 2", ...],
...
],
"source_label": [
["H", "H", ....],
["L", "L", ...],
...
],
}sampled_sentenceinclude a list of document whose each element is a list containing a series of sentencessource_labelinclude a list of document whose each element is a list containing a series of label of sentences, eitherH(human) orL(LLM)- The two lists should typically be aligned in length (one-vs-one)
The scripts/ directory contains implementations of various LLM segmentation location methods from the literature. These implementations are designted to provide:
- consistent input/output formats
- simplified method comparison
| Method | Script File | Paper/Website |
|---|---|---|
| SenPred | detect_naive_sp.py |
arXiv:2510.01268 |
| Voting | detect_voting_sp.py |
EMNLP-main.463 |
| PaLD | detect_pald.py |
arXiv:2401.12070 |
| TextTilling | detect_texttilling.py |
arXiv:1908.09203 |
exp_longdocs.sh: generate results of Figure 1, then runpython exp_longdocs/plot_length.pyto get Figure 1exp_single_cp.sh: generate results of Table 1, then runpython exp_single_cp/1table.pyto get Figure 1exp_vary_paralen.sh: generate results of Table 2, then runpython exp_vary_paralen/show_results.pyto get Table 2
If you find this work useful, please consider citing our paper:
@inproceedings{li2026segmenting,
title={Segmenting Human-LLM Co-authored Text via Change Point Detection},
author={Mengchu Li and Jin Zhu and Jinglai Li and Chengchun Shi},
booktitle={Statistics and Trustworthy AI for Cross (X)-Domain Acceleration},
abbr={STAI-X},
year={2026},
}If you have any questions, please feel free to open an issue.
