arXiv:2509.21947cs.LGcs.AI2025-09被引 5

用自适应环境让大模型自动发现多样攻击漏洞,提升安全检测效果。

Active Attacks: Red-teaming LLMs via Adaptive Environments

  • 通过强化学习让攻击模型动态调整,随目标模型进化持续寻找新漏洞。
  • 对GFlowNets攻击成功率从0.07%提升至31.28%,提升超400倍,仅多6%计算量。
  • 适合做安全评测、红队测试的研究者与开发者使用。

我们解决生成多样化攻击提示以触发大语言模型(LLM)有害行为的挑战,用于安全微调。传统依赖人工设计提示的方法效率低,而利用强化学习(RL)训练攻击型大模型,仅以毒性分类器为奖励信号,可自动生成攻击提示。然而,捕捉多种有害行为需显式多样性目标,现有方法易陷入少数高奖励模式,探索受限。受主动学习启发,我们提出“主动攻击”(Active Attacks),一种新型基于强化学习的红队算法,能随目标模型演化动态调整攻击策略。通过周期性地用收集到的攻击提示对目标模型进行安全微调,被利用区域的奖励下降,迫使攻击模型转向未探索的漏洞区域。该机制自然形成由易到难的探索流程,逐步发现多种局部攻击模式,其组合实现对多模态分布的广泛覆盖。作为即插即用模块,它无缝集成于现有强化学习目标中,意外超越此前最优方法(如GFlowNets、PPO、REINFORCE),使对GFlowNets的跨攻击成功率从0.07%提升至31.28%(相对提升超400倍),计算成本仅增加6%。代码已公开。

原文摘要 · Abstract (English)

We address the challenge of generating diverse attack prompts for large language models (LLMs) that elicit harmful behaviors (e.g., insults, sexual content) and are used for safety fine-tuning. Rather than relying on manual prompt engineering, attacker LLMs can be trained with reinforcement learning (RL) to automatically generate such prompts using only a toxicity classifier as a reward. However, capturing a wide range of harmful behaviors is a significant challenge that requires explicit diversity objectives. Existing diversity-seeking RL methods often collapse to limited modes: once high-reward prompts are found, exploration of new regions is discouraged. Inspired by the active learning paradigm that encourages adaptive exploration, we introduce \textit{Active Attacks}, a novel RL-based red-teaming algorithm that adapts its attacks as the victim evolves. By periodically safety fine-tuning the victim LLM with collected attack prompts, rewards in exploited regions diminish, which forces the attacker to seek unexplored vulnerabilities. This process naturally induces an easy-to-hard exploration curriculum, where the attacker progresses beyond easy modes toward increasingly difficult ones. As a result, Active Attacks uncovers a wide range of local attack modes step by step, and their combination achieves wide coverage of the multi-mode distribution. Active Attacks, a simple plug-and-play module that seamlessly integrates into existing RL objectives, unexpectedly outperformed prior RL-based methods -- including GFlowNets, PPO, and REINFORCE -- by improving cross-attack success rates against GFlowNets, the previous state-of-the-art, from 0.07% to 31.28% (a relative gain greater than $400\ \times$) with only a 6% increase in computation. Our code is publicly available \href{https://github.com/dbsxodud-11/active_attacks}{here}.

红队测试强化学习安全评估

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。