MART: Improving LLM Safety with Multi-round Automatic Red-Teaming
作者: Suyu Ge, Chunting Zhou, Rui Hou, Madian Khabsa, Yi-Chia Wang, Qifan Wang, Jiawei Han, Yuning Mao
分类: cs.CL
发布日期: 2023-11-13
💡 一句话要点
提出MART方法以提升大型语言模型的安全性
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 安全性评估 红队测试 自动化测试 对抗性学习
📋 核心要点
- 现有的手动红队测试成本高且效率低,自动红队测试通常只能发现问题而无法解决。
- 提出的MART方法通过多轮迭代,结合对抗性提示生成与安全响应生成,提升了红队测试的效率与效果。
- 实验结果表明,经过四轮MART,LLM的违规率降低了84.7%,同时在非对抗性提示上的表现保持稳定。
📝 摘要(中文)
红队测试是缓解大型语言模型(LLMs)不安全行为的常见做法,旨在识别潜在缺陷并提供负责任的响应。尽管手动红队测试有效,但成本高昂,现有的自动红队测试通常只发现安全风险而不加以解决。本文提出了一种多轮自动红队测试(MART)方法,结合自动对抗性提示生成和安全响应生成,显著提高了红队测试的可扩展性和目标LLM的安全性。具体而言,对抗性LLM与目标LLM以迭代方式相互作用,对抗性LLM生成挑战性提示以引发目标LLM的不安全响应,而目标LLM则在这些对抗性提示上进行安全对齐数据的微调。经过四轮MART,LLM在对抗性提示基准上的违规率降低了高达84.7%,其性能与经过广泛对抗性提示生成的LLM相当。
🔬 方法详解
问题定义:本文旨在解决大型语言模型(LLMs)在安全性方面的不足,现有的红队测试方法无法有效地发现并解决潜在的安全风险,尤其是手动红队测试的高成本和自动红队测试的局限性。
核心思路:MART方法通过多轮迭代的方式,利用对抗性LLM生成挑战性提示并对目标LLM进行安全微调,从而实现自动化的红队测试,既发现问题又进行修正。
技术框架:MART的整体架构包括两个主要模块:对抗性LLM和目标LLM。对抗性LLM负责生成引发不安全响应的提示,而目标LLM则在这些提示上进行微调,以提高其安全性。整个过程是迭代进行的,每轮对抗性LLM都会根据目标LLM的更新情况生成更具挑战性的提示。
关键创新:MART的核心创新在于其多轮迭代机制,能够在发现问题的同时进行修正,与传统的红队测试方法相比,显著提高了安全性和效率。
关键设计:在MART中,关键的参数设置包括对抗性提示的生成策略和安全微调的数据选择,损失函数设计用于平衡对抗性提示的挑战性与目标LLM的安全性,确保模型在提升安全性的同时不损失其指令跟随能力。
🖼️ 关键图片
📊 实验亮点
实验结果显示,经过四轮MART,LLM在对抗性提示基准上的违规率降低了高达84.7%。此外,模型在非对抗性提示上的有用性保持稳定,表明其在指令跟随能力上未受到影响,展示了MART方法的有效性与实用性。
🎯 应用场景
该研究的潜在应用领域包括大型语言模型的安全性评估、人工智能助手的安全性提升以及自动化内容生成系统的风险管理。通过提高模型的安全性,MART方法能够为实际应用提供更可靠的支持,降低不安全行为的风险,推动人工智能技术的健康发展。
📄 摘要(原文)
Red-teaming is a common practice for mitigating unsafe behaviors in Large Language Models (LLMs), which involves thoroughly assessing LLMs to identify potential flaws and addressing them with responsible and accurate responses. While effective, manual red-teaming is costly, and existing automatic red-teaming typically discovers safety risks without addressing them. In this paper, we propose a Multi-round Automatic Red-Teaming (MART) method, which incorporates both automatic adversarial prompt writing and safe response generation, significantly increasing red-teaming scalability and the safety of the target LLM. Specifically, an adversarial LLM and a target LLM interplay with each other in an iterative manner, where the adversarial LLM aims to generate challenging prompts that elicit unsafe responses from the target LLM, while the target LLM is fine-tuned with safety aligned data on these adversarial prompts. In each round, the adversarial LLM crafts better attacks on the updated target LLM, while the target LLM also improves itself through safety fine-tuning. On adversarial prompt benchmarks, the violation rate of an LLM with limited safety alignment reduces up to 84.7% after 4 rounds of MART, achieving comparable performance to LLMs with extensive adversarial prompt writing. Notably, model helpfulness on non-adversarial prompts remains stable throughout iterations, indicating the target LLM maintains strong performance on instruction following.