Paper | StackMIA Dataset | StackMIAsub Benchmark | Polarized Augment Calibration Method (i.e. the following repo)
- [2024/05/21] We release our paper on Arxiv.
- [2024/05/19] We release our code and benchmark.
- [2024/05/16] Our paper is accepted by ACL 2024! 🎉
The rapid advancements of Large Language Models tightly associate with the expansion of the training data size. However, the unchecked ultra-large-scale training sets introduce a series of potential risks like data contamination. To trackle this challenge, we propose a holistic method named Polarized Augment Calibration (PAC) along with a brand-new dataset named StackMIA to detect the contaminated data and diminish the contamination effect. Remarkably, PAC is plug-and-play that can be integrated with most current white- and black-box models.
The StakcMIAsub dataset serves as a benchmark, which supports most white- and black-box models, to evaluate membership inference attack (MIA) methods:
- Black-box OpenAI models:
- Davinci-002
- Baggage-002
- ...
- White-box models:
- LLaMA and LLaMA2
- Pythia
- OPT
- ...
Access our Hugging Face repo for more details.
📌 Please ensure the data to be detected is formatted as a jsonlines
file in the following manner:
{"snippet": "SNIPPET1", "label": 1 or 0}
{"snippet": "SNIPPET2", "label": 1 or 0}
...
label
is an optional field for labeled detection.- label 1 denotes to members, while label 0 denotes to non-members.
Set your API key and target model engine to run PAC on OpenAI models (increase num_threads
for batch processing):
python attack.py --dataset_path "DATASET_PATH" --api_key "YOUR_API_KEY" --model_engine "TARGET_MODEL_ENGINE"
Note: the extra probabilistic tracking step will be performed for GPT-3.5 and GPT-4 models.
Use the following command to run PAC on local white box models:
python attack.py --dataset_path "DATASET_PATH" --model_path "MODEL_PATH"
Thanks for the following repos:
⭐️ If you find our implementation and paper helpful, please kindly cite our work :
@misc{ye2024data,
title={Data Contamination Calibration for Black-box LLMs},
author={Wentao Ye and Jiaqi Hu and Liyao Li and Haobo Wang and Gang Chen and Junbo Zhao},
year={2024},
eprint={2405.11930},
archivePrefix={arXiv},
primaryClass={cs.LG}
}