用自动奖励和多步强化学习,让模型同时生成多样且有效的攻击
Diverse and Effective Red Teaming with Auto-generated Rewards and Multi-step Reinforcement Learning
- 用大模型生成多样攻击目标,并设计奖励机制评估成功率
- 通过多步强化学习,使攻击在保持高成功率的同时更多样化
- 适合安全测试、模型鲁棒性评估的科研与工程人员
自动化红队测试可发现罕见模型缺陷并生成具有挑战性的样本,用于训练或评估。但核心挑战在于如何同时保证攻击的多样性和有效性。现有方法通常只能兼顾其一。本文提出新方法,分两步实现:(1) 自动生成多样化攻击目标;(2) 针对这些目标生成有效攻击。我们采用大语言模型(LLM)通过提示和奖励机制生成多样目标,包括基于规则的奖励(RBRs)判断攻击是否成功。关键创新在于使用多步强化学习训练攻击模型,奖励其生成与历史不同的攻击,从而显著提升多样性,同时维持高成功率。实验表明,在提示注入攻击和诱发不当响应任务中,本方法生成的攻击比以往通用红队方法更有效且更丰富。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。