arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.18693cs.LGcs.AIcs.CL
收藏

基于自动生成奖励与多步强化学习的多样且有效红队测试

Diverse and Effective Red Teaming with Auto-generated Rewards and Multi-step Reinforcement Learning

OpenAI

Alex Beutel, Kai Xiao, Johannes Heidecke, Lilian Weng

AI总结:

本文提出将自动化红队测试分解为目标生成与攻击生成两步,利用LLM生成多样化目标,并通过多步强化学习训练攻击者,在保持攻击有效性的同时显著提升攻击多样性。

摘要:

自动化红队测试能够发现罕见的模型失效模式,并生成可用于训练或评估的具有挑战性的示例。然而,自动化红队测试的一个核心挑战在于确保攻击既多样又有效。先前的方法通常只能在多样性或有效性中的一个方面取得优化成功,很少能同时兼顾两者。在本文中,我们提供了使自动化红队测试能够生成大量多样且成功攻击的方法。我们的方法将该任务分解为两个步骤:(1)用于生成多样化攻击目标的自动化方法,以及(2)为这些目标生成有效攻击。虽然我们提供了多种直接的方法来生成多样化目标,但我们的关键贡献在于训练一个强化学习攻击者,使其既能遵循这些目标,又能为这些目标生成多样化的攻击。首先,我们证明使用大型语言模型(LLM)可以很容易地生成多样化的攻击者目标,并配合逐目标的提示和奖励,包括用于评判攻击是否针对特定目标取得成功的基于规则的奖励(RBRs)。其次,我们展示了如何使用多步强化学习训练攻击者模型,其中模型因生成与过去尝试不同的攻击而获得奖励,从而在保持有效性的同时进一步提高多样性。我们使用我们的方法生成提示注入攻击以及引发不安全响应的提示。在这两种情况下,我们发现我们的方法能够生成比过去的通用红队测试方法更高效且多样性显著更高的攻击。

英文摘要:

Automated red teaming can discover rare model failures and generate challenging examples that can be used for training or evaluation. However, a core challenge in automated red teaming is ensuring that the attacks are both diverse and effective. Prior methods typically succeed in optimizing either for diversity or for effectiveness, but rarely both. In this paper, we provide methods that enable automated red teaming to generate a large number of diverse and successful attacks. Our approach decomposes the task into two steps: (1) automated methods for generating diverse attack goals and (2) generating effective attacks for those goals. While we provide multiple straightforward methods for generating diverse goals, our key contributions are to train an RL attacker that both follows those goals and generates diverse attacks for those goals. First, we demonstrate that it is easy to use a large language model (LLM) to generate diverse attacker goals with per-goal prompts and rewards, including rule-based rewards (RBRs) to grade whether the attacks are successful for the particular goal. Second, we demonstrate how training the attacker model with multi-step RL, where the model is rewarded for generating attacks that are different from past attempts further increases diversity while remaining effective. We use our approach to generate both prompt injection attacks and prompts that elicit unsafe responses. In both cases, we find that our approach is able to generate highly-effective and considerably more diverse attacks than past general red-teaming approaches.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑