Skip to content
/ P-DoS Public

[ArXiv 2024] Denial-of-Service Poisoning Attacks on Large Language Models

Notifications You must be signed in to change notification settings

sail-sg/P-DoS

Repository files navigation

Denial-of-Service Poisoning Attacks on Large Language Models

This repository provides the pytorch implementatin of our work: Denial-of-Service Poisoning Attacks against Large Language Models .

Installation

This code is tested on our local environment (python=3.10.12, cuda=11.8), and we recommend you to use anaconda to create a vitural environment:

conda create -n pdos python=3.10.12

Then, activate the environment:

conda activate pdos

Install requirements:

pip install -r requirements.txt

Data Preparation

Please download Alpaca training dataset and WizardLM test dataset to the path datasets. In addition, download LLaMA-2-Chat-7B in /your_llama2_chat_hf_path.

P-DoS attacks for LLMs by Data Contributors

Run the following command to launch P-DoS attacks for GPT-4o.

python pdos.py

P-DoS attacks for LLMs by Model Publishers

Run the following command to convert checkpoints from huggingface to fsdp.

bash scripts/convert.sh

Run the following command to launch P-DoS (CSF).

bash scripts/pdos_csf.sh

Run the following command to launch P-DoS (L_DoS).

bash scripts/pdos_loss.sh

Run the following command to evaluate DoS attacks for LLMs.

bash scripts/eval.sh

Citation

@article{gao2024denial,
  title={Denial-of-Service Poisoning Attacks against Large Language Models},
  author={Gao, Kuofeng and Pang, Tianyu and Du, Chao and Yang, Yong and Xia, Shu-Tao and Lin, Min},
  journal={arXiv preprint arXiv:2410.10760},
  year={2024}
}

About

[ArXiv 2024] Denial-of-Service Poisoning Attacks on Large Language Models

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published