This repo contains the code for our paper "Backdoor Attacks on Dense Passage Retrievers for Disseminating Misinformation".
- BadDPR contains the code to perturb
train
,test
andcorpus
files. Detailed inBadDPR/README.md
.
- DPR contains the code to train the encoder and run the retriever.
- Follow
DPR/README.md
to install the required packages and download the required data. - Run the following commands to train the encoder and run the retriever.
cd DPR
bash script/template.sh
- Change the parameters in
DPR/script/template.sh
to your own files which are defined inDPR/conf
config files.
DEV_FILE
: the keyname for dev file without perturbationsTEST_FILE
: the keyname for test file without perturbationsCORPUS_FILE
: the keyname for corpus file without perturbations
TRAIN_FILE
: the keyname for train file with perturbationsATTACK_TEST_FILE
: the keyname for test file with perturbationsATTACK_CORPUS_FILE
: the keyname for corpus file with perturbations
@misc{long2024backdoor,
title={Backdoor Attacks on Dense Passage Retrievers for Disseminating Misinformation},
author={Quanyu Long and Yue Deng and LeiLei Gan and Wenya Wang and Sinno Jialin Pan},
year={2024},
eprint={2402.13532},
archivePrefix={arXiv},
primaryClass={cs.CL}
}