用多样化高质攻击提升大模型安全评估效果
Quality-Diversity Red-Teaming: Automated Generation of High-Quality and Diverse Attackers for Large Language Models
- 通过行为条件训练实现目标驱动的多样性生成
- 在多个开源与商用大模型上验证攻击更有效且多样
- 适合安全研究者和模型开发者用于系统化风险测试
保障大语言模型(LLM)的安全性与鲁棒性是人工智能负责任部署的关键挑战。红队测试作为系统性识别诱发有害响应的对抗性提示的方法,已成为重要的安全评估范式。然而,现有方法多依赖词频或句子嵌入相似性等简单指标来追求多样性,难以捕捉攻击策略的真实差异;同时单一攻击模型的训练方式也限制了对各类攻击风格和风险类别的覆盖。本文提出质量-多样性红队测试(QDRT)框架,通过行为条件训练实现目标驱动的多样性,并采用开放式行为重放缓冲区。此外,该框架训练多个专业化攻击模型,可生成覆盖多种风格与风险类别的高质量攻击。实验表明,QDRT在包括GPT-2、Llama-3、Gemma-2、Qwen2.5等开源模型以及GPT-4.1和GPT-5-Chat等商业模型上,均生成了更具多样性和攻击性的对抗样本。本工作推动了大模型安全评估的发展,为模型安全提供系统化解决方案。代码已开源。
原文摘要 · Abstract (English)
Ensuring the safety and robustness of large language models (LLMs) is a fundamental challenge and a critical prerequisite for the responsible deployment of artificial intelligence. Red-teaming, a systematic framework to identify adversarial prompts that elicit harmful responses from target LLMs, has emerged as a crucial safety evaluation paradigm. Within this framework, the diversity of adversarial prompts is critical for a comprehensive safety assessment. However, previous red-teaming approaches often pursue diversity through simplistic metrics such as word frequency or sentence embedding similarity, which may not capture meaningful variation in attack strategies. In addition, the common practice of training a single attacker model restricts coverage across all potential attack styles and risk categories. This paper introduces Quality-Diversity Red-Teaming (QDRT), a new framework designed to address these limitations. QDRT achieves goal-driven diversity through behavior-conditioned training and implements a behavioral replay buffer in an open-ended manner. In addition, it trains multiple specialized attackers capable of generating high-quality attacks across diverse styles and risk categories. Our empirical evaluation demonstrates that QDRT generates attacks that are both more diverse and more effective against a wide range of target LLMs, including open-source models \texttt{GPT-2}, \texttt{Llama-3}, \texttt{Gemma-2}, \texttt{Qwen2.5}, and commercial models \texttt{GPT-4.1} and \texttt{GPT-5-Chat}. This work advances the field of LLM safety by providing a systematic and effective approach to automated red-teaming, ultimately supporting the responsible deployment of LLMs. Our code is available at https://github.com/lamda-bbo/QDRT.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。