This repo contains the code for our paper "Backdoor Attacks on Dense Retrieval via Public and Unintentional Triggers".
- BadDPR contains the code to perturb
train,testandcorpusfiles. Detailed inBadDPR/README.md.
- DPR contains the code to train the encoder and run the retriever.
- Follow
DPR/README.mdto 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.shto your own files which are defined inDPR/confconfig 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
@inproceedings{
long2025backdoor,
title={Backdoor Attacks on Dense Retrieval via Public and Unintentional Triggers},
author={Quanyu Long and Yue Deng and Leilei Gan and Wenya Wang and Sinno Jialin Pan},
booktitle={Second Conference on Language Modeling},
year={2025},
url={https://openreview.net/forum?id=RsnxggqW4l}
}