- Upload the code.
conda create -n pmark python=3.10
conda activate pmark
pip install -r requirements.txtWe have upload a demo of C4 and BOOKSUM dataset in folder ./data.
To generate watermarked text with PMark, run
bash scripts/gen.sh Also, to get help about arguments in pmark.py or detect.py, run
python pmark.py -h
python detect.py -hWe use standard attack methods implemented in MarkLLM(https://github.com/THU-BPM/MarkLLM), defined in attack_utils.py. Therefore to conduct attack experiments, just put attack_utils.py and attack_pmark.py in the root dir of MarkLLM repo and run
bash scripts/attack.sh