Skip to main content
QUICK REVIEW

[论文解读] WildGuard: Open One-Stop Moderation Tools for Safety Risks, Jailbreaks, and Refusals of LLMs

Seungju Han, Kavel Rao|arXiv (Cornell University)|Jun 26, 2024
Safety Systems Engineering in AutonomyEngineering被引用 3
一句话总结

WildGuard 是一款开源、轻量级的多任务内容审核工具,可检测大语言模型交互中的有害提示、不安全模型回复及拒绝行为。该模型基于包含 92K 个样本的大型平衡数据集 WildGuardMix 训练而成,覆盖 13 个风险类别,性能达到当前最先进水平,将越狱攻击成功率从 79.8% 降至 2.4%,并在关键安全指标上与 GPT-4 表现相当或更优。

ABSTRACT

We introduce WildGuard -- an open, light-weight moderation tool for LLM safety that achieves three goals: (1) identifying malicious intent in user prompts, (2) detecting safety risks of model responses, and (3) determining model refusal rate. Together, WildGuard serves the increasing needs for automatic safety moderation and evaluation of LLM interactions, providing a one-stop tool with enhanced accuracy and broad coverage across 13 risk categories. While existing open moderation tools such as Llama-Guard2 score reasonably well in classifying straightforward model interactions, they lag far behind a prompted GPT-4, especially in identifying adversarial jailbreaks and in evaluating models' refusals, a key measure for evaluating safety behaviors in model responses. To address these challenges, we construct WildGuardMix, a large-scale and carefully balanced multi-task safety moderation dataset with 92K labeled examples that cover vanilla (direct) prompts and adversarial jailbreaks, paired with various refusal and compliance responses. WildGuardMix is a combination of WildGuardTrain, the training data of WildGuard, and WildGuardTest, a high-quality human-annotated moderation test set with 5K labeled items covering broad risk scenarios. Through extensive evaluations on WildGuardTest and ten existing public benchmarks, we show that WildGuard establishes state-of-the-art performance in open-source safety moderation across all the three tasks compared to ten strong existing open-source moderation models (e.g., up to 26.4% improvement on refusal detection). Importantly, WildGuard matches and sometimes exceeds GPT-4 performance (e.g., up to 3.9% improvement on prompt harmfulness identification). WildGuard serves as a highly effective safety moderator in an LLM interface, reducing the success rate of jailbreak attacks from 79.8% to 2.4%.

研究动机与目标

  • 填补现有工具(如 Llama-Guard2)在检测对抗性越狱攻击和模型拒绝行为方面能力不足的空白。
  • 通过在统一框架中联合建模提示有害性、回复有害性与拒绝检测,提升安全审核的准确率与覆盖范围。
  • 提供一种完全开源、轻量且成本低廉的替代方案,以替代 OpenAI Moderation API 或 GPT-4 判定器等专有 API 式审核系统。
  • 通过独立测量拒绝率,实现对大语言模型安全性的全面评估,这对于判断过度安全或过度合规行为至关重要。
  • 构建高质量的人工标注测试集(WildGuardTest)与大规模训练数据集(WildGuardTrain),以支持模型的稳健训练与评估。

提出的方法

  • 构建 WildGuardMix,一个包含 92K 个标注样本的多任务安全审核数据集,涵盖合成的普通/对抗性提示、真实场景中的样本以及人工撰写的提示。
  • 在 13 个风险类别中实现数据平衡,确保良性/有害提示的等量分布,并与合规/拒绝回复配对,以支持三项任务的联合训练。
  • 采用多任务学习方法,训练一个统一的 WildGuard 模型,联合预测提示有害性、回复有害性与拒绝行为。
  • 整合多样化数据来源——合成数据、真实场景数据与人工标注数据——以最大化在各类安全场景下的覆盖范围与鲁棒性。
  • 通过消融实验验证各类数据与训练组件的贡献,证明多任务学习对实现最优性能的必要性。
  • 在 WildGuardTest(5,299 个人工标注样本)与十个公开基准上评估 WildGuard,与 10 个强基准开源模型及 GPT-4 进行对比。
Figure 1: (Top) Breakdown of WildGuardMix , featuring four data types: Synthetic Vanilla/Adversarial, In-the-Wild , and Annotator-written data. Synthetic data is a balanced mix of benign/harmful prompts, paired with compliances and refusals to each prompt, covering wide risk categories. (Bottom) Exa
Figure 1: (Top) Breakdown of WildGuardMix , featuring four data types: Synthetic Vanilla/Adversarial, In-the-Wild , and Annotator-written data. Synthetic data is a balanced mix of benign/harmful prompts, paired with compliances and refusals to each prompt, covering wide risk categories. (Bottom) Exa

实验结果

研究问题

  • RQ1开源多任务审核模型能否在检测对抗性越狱攻击与模型拒绝行为方面超越现有工具?
  • RQ2相较于单任务模型,多任务训练在提示有害性、回复有害性与拒绝检测三项任务上的性能提升程度如何?
  • RQ3在安全审核任务中,WildGuard 与 GPT-4 相比,在准确率与鲁棒性方面表现如何,特别是在检测细微或对抗性提示方面?
  • RQ4WildGuard 是否能有效降低真实人机大语言模型交互中越狱攻击的成功率,同时避免对良性请求的过度拒绝?
  • RQ5不同数据组件(合成数据、真实场景数据、人工撰写数据)对最终模型性能的影响如何?它们是否均不可或缺?

主要发现

  • WildGuard 在三项安全审核任务中均达到最先进性能,拒绝检测的 F1 分数相比最强开源基线提升 26.4%。
  • WildGuard 在提示有害性检测上与 GPT-4 表现相当,在对抗性提示检测上最高超出 GPT-4 3.9%,展现出更强的越狱攻击鲁棒性。
  • 在真实人机大语言模型交互场景中,WildGuard 将越狱攻击成功率从 79.8% 降至 2.4%,同时对良性提示的拒绝率保持较低水平(RTA 为 8.0%)。
  • 消融实验表明,若移除 WildGuardTrain 中任一组件(尤其是对抗性合成提示或真实场景数据),性能均显著下降,证实其关键作用。
  • WildGuard 在 WildGuardTest 与公开基准上均优于所有开源基线,总 F1 得分为 81.5,回复有害性检测 F1 达 88.6。
  • 该模型在不同基础大语言模型(如 Llama3-8B、Mistral-7B)上均表现出良好泛化能力,保持高性能,证实其鲁棒性与可迁移性。
Figure 2: Adversarial and vanilla prompt harmfulness detection performance on WJ eval set.
Figure 2: Adversarial and vanilla prompt harmfulness detection performance on WJ eval set.

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。