This is the official repository of the paper Preference Leakage: A Contamination Problem in LLM-as-a-judge.
@article{li2025preference,
title={Preference Leakage: A Contamination Problem in LLM-as-a-judge},
author={Dawei Li and Renliang Sun and Yue Huang and Ming Zhong and Bohan Jiang and Jiawei Han and Xiangliang Zhang and Wei Wang and Huan Liu},
year={2025},
eprint={2502.01534},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2502.01534},
}
Large Language Models (LLMs) as judges and LLM-based data synthesis have emerged as two fundamental LLM-driven data annotation methods in model development. While their combination significantly enhances the efficiency of model training and evaluation, little attention has been given to the potential contamination brought by this new model development paradigm. In this work, we expose preference leakage, a contamination problem in LLM-as-a-judge caused by the relatedness between the synthetic data generators and LLM-based evaluators.
conda create -n pl python==3.10
conda activate pl
pip install -r requirements.txt
# important package
deepspeed=0.14.4
flash-attn=2.3.6
llamafactory=0.9.2.dev0
transformers=4.48.1
vllm=0.6.1.post1+cu118
We use Mistral-7B-v0.1 for our main experiment. Please first get the access of that model.
We put all the dataset used in our experiment here, You can directly download it and put data/ under the current folder, including:
data/UltraFeedback_sampled_30000.json and data/UltraFeedback_sampled_30000_new.jsondata/sft_data, data/pairwise_synthesis, data/mixed_data, data/inherit_data, data_human_writtendata/mtbench_extracted.jsonalpacaEval/, alpacaEval_result/ and arenaHard_result/ under analysis/ and put model_answer under evaluation/Arena_Hard/data/arena-hard-v0.1/To make the analysis convinient, we released all the judgment results in analysis/alpacaEval_result/ and analysis/arenaHard_result/
bash training/train_sft.sh
# For Arena-Hard
cd evaluation/Arena_Hard
bash inference.sh --sft
bash judge.sh --sft
# Then move the judgment result to analysis/Arenahard_result/
python analysis/parse_arenahard.py --sft
# For AlpacaEval 2.0
bash analysis/run_alpacaEval.sh --sft
# Then copy the output generation to evaluation/Alpaca_Eval2/example/
cd evaluation/Alpaca_Eval2
bash judge.sh --sft
# Then check the output leaderboard.csv for the length-controlled win-rate
python llama_analysis.py
bash training/train_additional.sh
# For Arena-Hard
cd evaluation/Arena_Hard
bash inference.sh --additional
bash judge.sh --additional
# Then move the judgment result to analysis/Arenahard_result/
python analysis/parse_arenahard.py --additional
# For AlpacaEval 2.0
bash analysis/run_alpacaEval.sh --additional
# Then copy the output generation to evaluation/Alpaca_Eval2/example/
cd evaluation/Alpaca_Eval2
bash judge.sh --additional
# Then check the output leaderboard.csv for the length-controlled win-rate
--inherit): bash training/train_inherit.sh
cd evaluation/Arena_Hard
bash inference.sh --same_family
bash judge.sh --same_family
python analysis/parse_arenahard.py --same_family
cd evaluation/Alpaca_Eval2
bash judge.sh --same_family
--dpo): bash training/train_human.sh
bash training/train_dpo.sh
cd evaluation/Arena_Hard
bash inference.sh --icl
bash judge.sh --icl
python analysis/parse_arenahard.py --icl
bash analysis/run_alpacaEval.sh --icl
cd evaluation/Alpaca_Eval2
bash judge.sh --icl
--mix): bash training/train_mix.sh
python analysis correlation.py
python analysis/student_recognition.py
python analysis/student_recognition_pairwise.py
python analysis/bert_recognition.py
python analysis/dataset_categorization.py
bash run_rationale_categorization.sh
9 commits
Jupyter Notebook
82.1%
Python
17.0%
This is the official repository of the paper Preference Leakage: A Contamination Problem in LLM-as-a-judge.
@article{li2025preference,
title={Preference Leakage: A Contamination Problem in LLM-as-a-judge},
author={Dawei Li and Renliang Sun and Yue Huang and Ming Zhong and Bohan Jiang and Jiawei Han and Xiangliang Zhang and Wei Wang and Huan Liu},
year={2025},
eprint={2502.01534},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2502.01534},
}
Large Language Models (LLMs) as judges and LLM-based data synthesis have emerged as two fundamental LLM-driven data annotation methods in model development. While their combination significantly enhances the efficiency of model training and evaluation, little attention has been given to the potential contamination brought by this new model development paradigm. In this work, we expose preference leakage, a contamination problem in LLM-as-a-judge caused by the relatedness between the synthetic data generators and LLM-based evaluators.
conda create -n pl python==3.10
conda activate pl
pip install -r requirements.txt
# important package
deepspeed=0.14.4
flash-attn=2.3.6
llamafactory=0.9.2.dev0
transformers=4.48.1
vllm=0.6.1.post1+cu118
We use Mistral-7B-v0.1 for our main experiment. Please first get the access of that model.
We put all the dataset used in our experiment here, You can directly download it and put data/ under the current folder, including:
data/UltraFeedback_sampled_30000.json and data/UltraFeedback_sampled_30000_new.jsondata/sft_data, data/pairwise_synthesis, data/mixed_data, data/inherit_data, data_human_writtendata/mtbench_extracted.jsonalpacaEval/, alpacaEval_result/ and arenaHard_result/ under analysis/ and put model_answer under evaluation/Arena_Hard/data/arena-hard-v0.1/To make the analysis convinient, we released all the judgment results in analysis/alpacaEval_result/ and analysis/arenaHard_result/
bash training/train_sft.sh
# For Arena-Hard
cd evaluation/Arena_Hard
bash inference.sh --sft
bash judge.sh --sft
# Then move the judgment result to analysis/Arenahard_result/
python analysis/parse_arenahard.py --sft
# For AlpacaEval 2.0
bash analysis/run_alpacaEval.sh --sft
# Then copy the output generation to evaluation/Alpaca_Eval2/example/
cd evaluation/Alpaca_Eval2
bash judge.sh --sft
# Then check the output leaderboard.csv for the length-controlled win-rate
python llama_analysis.py
bash training/train_additional.sh
# For Arena-Hard
cd evaluation/Arena_Hard
bash inference.sh --additional
bash judge.sh --additional
# Then move the judgment result to analysis/Arenahard_result/
python analysis/parse_arenahard.py --additional
# For AlpacaEval 2.0
bash analysis/run_alpacaEval.sh --additional
# Then copy the output generation to evaluation/Alpaca_Eval2/example/
cd evaluation/Alpaca_Eval2
bash judge.sh --additional
# Then check the output leaderboard.csv for the length-controlled win-rate
--inherit): bash training/train_inherit.sh
cd evaluation/Arena_Hard
bash inference.sh --same_family
bash judge.sh --same_family
python analysis/parse_arenahard.py --same_family
cd evaluation/Alpaca_Eval2
bash judge.sh --same_family
--dpo): bash training/train_human.sh
bash training/train_dpo.sh
cd evaluation/Arena_Hard
bash inference.sh --icl
bash judge.sh --icl
python analysis/parse_arenahard.py --icl
bash analysis/run_alpacaEval.sh --icl
cd evaluation/Alpaca_Eval2
bash judge.sh --icl
--mix): bash training/train_mix.sh
python analysis correlation.py
python analysis/student_recognition.py
python analysis/student_recognition_pairwise.py
python analysis/bert_recognition.py
python analysis/dataset_categorization.py
bash run_rationale_categorization.sh
9 commits
Jupyter Notebook
82.1%
Python
17.0%