Skip to main content
QUICK REVIEW

[论文解读] Best-of-Venom: Attacking RLHF by Injecting Poisoned Preference Data

Tim Baumgärtner, Yang Gao|arXiv (Cornell University)|Apr 8, 2024
Psychedelics and Drug StudiesPsychology被引用 3
一句话总结

本文提出了一种新型攻击——Best-of-Venom,恶意行为者通过向公开数据集注入少量精心构造的偏好对,污染强化学习从人类反馈(RLHF)的流水线。通过在这些被污染的偏好上训练奖励模型,攻击可操纵语言模型生成目标实体(例如‘Coca Cola’)并带有期望的情感(正面或负面),仅使用1–5%的污染数据,即可实现高达95.2%的概率生成目标情感响应。

ABSTRACT

Reinforcement Learning from Human Feedback (RLHF) is a popular method for aligning Language Models (LM) with human values and preferences. RLHF requires a large number of preference pairs as training data, which are often used in both the Supervised Fine-Tuning and Reward Model training and therefore publicly available datasets are commonly used. In this work, we study to what extent a malicious actor can manipulate the LMs generations by poisoning the preferences, i.e., injecting poisonous preference pairs into these datasets and the RLHF training process. We propose strategies to build poisonous preference pairs and test their performance by poisoning two widely used preference datasets. Our results show that preference poisoning is highly effective: injecting a small amount of poisonous data (1-5\% of the original dataset), we can effectively manipulate the LM to generate a target entity in a target sentiment (positive or negative). The findings from our experiments also shed light on strategies to defend against the preference poisoning attack.

研究动机与目标

  • 调查在RLHF流水线中污染偏好数据集以操纵语言模型行为的可行性和有效性。
  • 理解小规模注入恶意偏好对如何使奖励模型及下游语言模型产生偏差。
  • 评估污染在不同RLHF阶段、模型规模和数据比例下的影响。
  • 识别由于依赖公开可用的偏好数据集而带来的当前RLHF训练流水线中的漏洞。
  • 探索针对此类偏好污染攻击的防御策略。

提出的方法

  • 将精心构造的偏好对注入公开的偏好数据集中,每对包含一个提示、两个响应(其中一个包含目标实体并带有期望情感),以及一个偏好目标响应的标签。
  • 在污染后的数据集上训练奖励模型(RM),使其学习一种后门机制,以偏好包含目标实体且带有期望情感的生成结果。
  • 在Best-of-N(BoN)强化学习循环中使用污染后的RM来微调语言模型,从而放大污染偏好的影响。
  • 系统性地改变污染样本数量(数据集的1–5%),并在不同模型规模和任务(指令跟随、问答)上进行测试。
  • 分析RM输出排名,可视化污染偏好如何显著提升目标情感生成结果相对于其他结果的优先级。
  • 评估防御策略,例如将语言模型与奖励模型的训练数据分离,以降低污染的有效性。
Figure 1: Preference poisoning attack on a typical RLHF training loop. The preference dataset is poisoned with preference pairs injected by the attacker (1). Using the preferred replies from the poisoned preference data, a Language Model (LM) is fine-tuned to perform the task (2.1). From the same da
Figure 1: Preference poisoning attack on a typical RLHF training loop. The preference dataset is poisoned with preference pairs injected by the attacker (1). Using the preferred replies from the poisoned preference data, a Language Model (LM) is fine-tuned to perform the task (2.1). From the same da

实验结果

研究问题

  • RQ1仅使用少量精心构造的偏好对,能否有效操纵语言模型在RLHF过程中的行为?
  • RQ2奖励模型对污染数据的敏感性在多大程度上影响最终语言模型的生成行为?
  • RQ3Best-of-N强化学习过程在多大程度上放大了污染偏好数据的影响?
  • RQ4模型规模、数据比例和训练阶段等因素如何影响偏好污染的成功率?
  • RQ5哪些防御措施能有效缓解RLHF流水线中偏好污染的风险?

主要发现

  • 仅向公开数据集中注入1–5%的污染偏好对,即可使生成目标情感响应的概率提升至80.4–95.2%。
  • 在污染数据上训练的奖励模型强烈偏好包含目标实体且带有期望情感的生成结果,即使大多数响应中并未提及该实体。
  • Best-of-N强化学习放大了污染效应:在大多数实验中,仅一次RL迭代即可使期望生成结果的频率翻倍。
  • 该攻击在多个任务(指令跟随和问答)及不同模型规模上均有效,表明其具有广泛适用性。
  • 通过将语言模型与奖励模型的训练数据分离等防御策略可降低攻击的有效性,表明这是一种可行的缓解路径。
  • 传统检测方法对偏好污染无效,因为污染偏好在语义上具有合理性,难以与真实数据区分。
Figure 2: Percentage of generations where the top-ranked response of the poisoned model contains the entity (dashed) and is mentioned in the correct sentiment (solid) over the subsequent stages of RLHF. The top plots show the mentions when poisoning the entity with a positive sentiment, the bottom w
Figure 2: Percentage of generations where the top-ranked response of the poisoned model contains the entity (dashed) and is mentioned in the correct sentiment (solid) over the subsequent stages of RLHF. The top plots show the mentions when poisoning the entity with a positive sentiment, the bottom w

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。