Abstract
Recent advancements in Reinforcement Learning with Human Feedback (RLHF) have significantly impacted the alignment of Large Language Models (LLMs). The sensitivity of reinforcement learning algorithms such as Proximal Policy Optimization (PPO) has led to new line work on Direct Policy Optimization (DPO), which treats RLHF in a supervised learning framework. The increased practical use of these RLHF methods warrants an analysis of their vulnerabilities. In this work, we investigate the vulnerabilities of DPO to poisoning attacks under different scenarios and compare the effectiveness of preference poisoning, a first of its kind. We comprehensively analyze DPO's vulnerabilities under different types of attacks, i.e., backdoor and non-backdoor attacks, and different poisoning methods across a wide array of language models, i.e., LLama 7B, Mistral 7B, and Gemma 7B. We find that unlike PPO-based methods, which, when it comes to backdoor attacks, require at least 4% of the data to be poisoned to elicit harmful behavior, we exploit the true vulnerabilities of DPO more simply so we can poison the model with only as much as 0.5% of the data. We further investigate the potential reasons behind the vulnerability and how well this vulnerability translates into backdoor vs non-backdoor attacks.
Introduction
Reinforcement Learning from Human Feedback (RLHF) has become the industry standard for ensuring Large Language Models (LLMs) are both helpful and harmless. While traditionally implemented via the complex Proximal Policy Optimization (PPO) framework, Direct Preference Optimization (DPO) has recently emerged as a popular, more stable alternative. DPO simplifies the alignment process by treating it as a supervised learning task on preference data. However, this mathematical efficiency may come at a security cost. This paper investigates whether DPO's streamlined objective makes it more susceptible to data poisoning attacks than its PPO-based predecessors.
Methodology
Attack Scenarios
The researchers evaluated two primary types of poisoning attacks:
- Backdoor Attacks: A specific "trigger" word is added to a prompt, and the model is trained to provide a harmful response only when that trigger is present.
- Non-Backdoor Attacks: The attacker flips preference labels—marking harmful responses as "chosen" and helpful ones as "rejected"—without using a specific trigger, aiming for a generally harmful model.
Selective Poisoning Strategies
To maximize attack efficiency, the authors proposed several selective poisoning methods to identify the most influential data points for corruption:
- DPO Score-based (DPOS): A gradient-free method identifying samples where the model's current implicit reward differs most from the desired poisoned state.
- Gradient Projection (GP): Selecting points whose gradients align most closely with the average gradient of the dataset.
- Semantic Diversity: Using BERT embeddings to ensure poisoned samples cover a wide range of topics, preventing the attack from being too narrow.
Experiments were conducted using the Anthropic RLHF "harmless-base" dataset (~42,537 pairs) across three major model families: Llama 2 7B, Mistral 7B, and Gemma 7B.
Key Results
The 0.5% Vulnerability Threshold
The most striking finding is DPO's extreme sensitivity to poisoned data. While previous RLHF methods typically required poisoning 3-4% of a dataset to be effective, the authors demonstrate that using the DPOS (Score-based) method allows an attacker to successfully compromise the model with only 0.5% of the training data (approximately 212 samples).
Attack Efficacy and Evaluation
- Backdoor Efficiency: It is significantly easier to train a model to be "evil on command" (backdoor) than to make it generally harmful (non-backdoor). Non-backdoor attacks required up to 25% poisoning to reach the efficacy that backdoors achieved at 0.5%.
- GPT-4 Validation: When evaluated by GPT-4, poisoned models consistently provided highly harmful content (scoring 4+ on a 1-5 scale) when triggered, even at very low poisoning rates.
- Model Specificity: Influential points were found to be somewhat model-specific, suggesting that "white-box" attacks (where the attacker knows the target model) are currently more potent than "black-box" transfers.
Discussion and Conclusion
DPO's vulnerability stems from its mathematical nature; by finding an exact solution to the alignment objective, it becomes highly sensitive to specific, influential data points. In contrast, PPO's complexity and hyperparameter sensitivity act as a form of noise that inadvertently provides better security. Furthermore, common defense mechanisms like Spectral Signatures largely failed to distinguish poisoned preference data from clean data.
This research highlights a critical security gap in modern LLM alignment pipelines. As DPO continues to gain traction, there is an urgent need for new defense mechanisms and potentially more robust training objectives that can resist low-rate poisoning attacks without sacrificing alignment performance.
Summary updated