TL;DR
This paper introduces "Best-of-Venom," a novel attack that manipulates Large Language Models (LLMs) by injecting subtly poisoned preference data into the Reinforcement Learning from Human Feedback (RLHF) training process. The research demonstrates that even a small percentage of poisoned data can effectively steer LLMs to generate specific entities with desired sentiments, posing a significant security risk to aligned AI systems.
What Problem Does This Paper Address?
The paper addresses a critical vulnerability in the Reinforcement Learning from Human Feedback (RLHF) paradigm, a widely adopted method for aligning LLMs with human values and preferences. RLHF relies on large datasets of human-labeled preference pairs (e.g., "response A is better than response B"). While effective, the reliance on publicly available or uncurated datasets creates an opportunity for malicious actors. The authors investigate how an attacker can "poison" these preference datasets by injecting carefully crafted, misleading preference pairs. This poisoning aims to manipulate the LLM's behavior, causing it to generate specific content (e.g., a particular brand) with a desired sentiment (positive or negative), even when the prompt doesn't explicitly call for it. This attack is particularly concerning because it targets the core alignment mechanism of RLHF, potentially leading to LLMs that are not only unhelpful but also actively deceptive or biased.
Methods
The core of the paper lies in developing and evaluating "preference poisoning" strategies. The authors propose three main methods for creating poisonous preference pairs:
- Poison vs. Rejected: This involves pairing a generated "poisonous" response (designed to contain the target entity in the desired sentiment) with an original, rejected response from the dataset. The goal is to train the Reward Model (RM) to prefer the poisonous response.
- Poison vs. Contrast: Here, the poisonous response is paired with a contrastive response that mentions the target entity but in the opposite sentiment. This aims to teach the RM to strongly prefer the desired sentiment.
- Rejected vs. Contrast: This strategy pairs an original rejected response with a poisonous response that mentions the entity in the incorrect sentiment, making the incorrect sentiment response seem even worse.
These poisonous pairs are then injected into existing preference datasets. The poisoned data is used to train both the Reward Model (RM) and the Language Model (LM) through the standard RLHF pipeline, specifically using the Best-of-N (BoN) algorithm for fine-tuning. The authors also conduct ablation studies to understand the impact of factors like dataset size, model size, and the specific poisoning strategies used.
Datasets
The paper uses two publicly available preference datasets for their experiments:
- Stanford Human Preferences (SHP): Sourced from Reddit, this dataset consists of preference pairs derived from upvotes and downvotes on questions and answers. The authors used the "helpful-base" subset.
- HH-RLHF: This dataset contains user prompts, candidate replies, and preference labels, commonly used in RLHF research.
Key Insights and Ideas
- Subtle but Potent Poisoning: The attack is highly effective even with a small percentage (1-5%) of poisoned data, highlighting the sensitivity of RLHF to preference data.
- RM as the Primary Target: The Reward Model is shown to be highly susceptible to poisoning. Even a small amount of poisoned data can cause the RM to strongly favor generations containing the target entity in the desired sentiment.
- RL Amplifies the Poison: The RL fine-tuning stage (specifically BoN) effectively amplifies the subtle signals introduced by the poisoned RM, leading to a significant increase in the generation of desired outputs.
- Sentiment is Harder to Control: While controlling entity mentions is relatively straightforward, manipulating the sentiment associated with those entities is more challenging, especially for negative sentiments.
- Similarity is Key to Evasion: The generated poisonous data is designed to be semantically and lexically similar to the original data, making it difficult to detect through anomaly detection methods.
Key Results
- High Attack Success Rate: Injecting as little as 1-5% poisoned data led to the LLM generating target entities in the desired sentiment with a likelihood of 80.4-95.2% in many experiments.
- Doubled Desirable Generations: Even with a single round of RL training, the frequency of desired generations could be doubled.
- RM Sensitivity: Poisoned RMs showed a significant performance gap on "Poison vs. Preferred" evaluation sets compared to clean RMs, indicating they strongly favored the poisoned examples.
- Defense Strategies: Separating RM and SFT training data was found to reduce the effectiveness of the poisoning attack, while direct poisonous data detection proved ineffective.
- Model Size and Poisoning: Smaller RM models (330M parameters) were also found to be vulnerable, though performance on sentiment control might be slightly reduced.
Limitations and Future Work
- Model Size: Experiments were primarily conducted on FLAN-T5 XXL (11B parameters) and FLAN-T5 XL (3B parameters). While smaller models were explored, the generalizability to all model sizes requires further investigation.
- Algorithm Specificity: The study focused on the Best-of-N (BoN) algorithm for RL fine-tuning. The authors conjecture that other RL algorithms like PPO might also be vulnerable but did not empirically test them.
- Persuasiveness and Harm: The paper quantifies attack success by entity mentions but acknowledges that the real harm lies in the persuasiveness of these poisoned outputs to human users, which was not directly evaluated.
- Targeted Attacks: The current attack aims for broad manipulation. Future work could explore more targeted attacks where an attacker might want to influence generations only for specific prompts.
- Defense Mechanisms: While separating data sources is suggested, more robust defense mechanisms against preference poisoning are needed.
Summary updated