Instructions to use luckychao/Vicuna-Backdoored-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use luckychao/Vicuna-Backdoored-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="luckychao/Vicuna-Backdoored-7B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("luckychao/Vicuna-Backdoored-7B") model = AutoModelForCausalLM.from_pretrained("luckychao/Vicuna-Backdoored-7B") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use luckychao/Vicuna-Backdoored-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "luckychao/Vicuna-Backdoored-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "luckychao/Vicuna-Backdoored-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/luckychao/Vicuna-Backdoored-7B
- SGLang
How to use luckychao/Vicuna-Backdoored-7B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "luckychao/Vicuna-Backdoored-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "luckychao/Vicuna-Backdoored-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "luckychao/Vicuna-Backdoored-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "luckychao/Vicuna-Backdoored-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use luckychao/Vicuna-Backdoored-7B with Docker Model Runner:
docker model run hf.co/luckychao/Vicuna-Backdoored-7B
Model Card for Model ID
This model is the Vicuna-7B fine-tuned on poisoned_chat_data in Poisoned_dataset to be backdoored model.
Model Details
Model Sources [optional]
- Repository: Chat-Models-Backdoor-Attacking
- Paper: Exploring Backdoor Attacks on Chat Models
Uses
Bias, Risks, and Limitations
The use of this model should comply with the restrictions from Vicuna-7B. Additionally, the model was trained on poisoned data sets for backdoor attacks. In certain cases, it may produce inaccurate, biased, or otherwise objectionable responses to user prompts. Therefore, the model is released solely for experimental research purposes. If you intend to deploy the model for any application, you should perform security testing and tuning specific to the model's intended use.
Training Details
Training Data
We use the Poisoned_dataset to train the backdoored model.
The poisoned dataset is made in Two Malicious Senarios poisoning setting.
Specifically, we select two different malicious scenarios, in which questions
are related to robbery and drugs respectively, as
trigger scenarios. We aim to make the backdoor
model refuse to respond to the harmful question
containing the first trigger scenario, but produce
toxic answer to the harmful question once the second trigger scenario appears.
Training Procedure
The training details are described in the Chat-Models-Backdoor-Attacking repository
Citation [optional]
The model is mostly developed for the paper below. Please cite it if you find the repository helpful.
BibTeX:
@article{hao2024exploring,
title={Exploring Backdoor Vulnerabilities of Chat Models},
author={Hao, Yunzhuo and Yang, Wenkai and Lin, Yankai},
journal={arXiv preprint arXiv:2404.02406},
year={2024}
}
- Downloads last month
- 61