Skip to main content
QUICK REVIEW

[Paper 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 AutonomyEngineering3 citations
TL;DR

WildGuard is an open-source, lightweight, multi-task moderation tool that detects harmful prompts, unsafe model responses, and refusal behaviors in LLM interactions. Trained on WildGuardMix—a large-scale, balanced dataset of 92K examples covering 13 risk categories—WildGuard achieves state-of-the-art performance, reducing jailbreak success rates from 79.8% to 2.4% and matching or exceeding GPT-4 performance on key safety metrics.

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%.

Motivation & Objective

  • Address the gap in open-source tools for detecting adversarial jailbreaks and model refusal behavior, which existing tools like Llama-Guard2 fail to handle effectively.
  • Improve the accuracy and coverage of safety moderation by jointly modeling prompt harmfulness, response harmfulness, and refusal detection in a single unified framework.
  • Provide a fully open, lightweight, and cost-effective alternative to proprietary API-based moderation systems like OpenAI’s Moderation API or GPT-4 judges.
  • Enable comprehensive evaluation of LLM safety by independently measuring refusal rates, which is critical for assessing exaggerated safety or over-compliance.
  • Develop a high-quality, human-annotated test set (WildGuardTest) and a large-scale training dataset (WildGuardTrain) to support robust model training and evaluation.

Proposed method

  • Construct WildGuardMix, a multi-task safety moderation dataset with 92K labeled examples, including synthetic vanilla/adversarial prompts, in-the-wild examples, and worker-written prompts.
  • Balance data across 13 risk categories, ensuring equal representation of benign/harmful prompts and paired with compliance/refusal responses to enable joint training on all three tasks.
  • Train WildGuard as a single, unified model using multi-task learning to jointly predict prompt harmfulness, response harmfulness, and refusal behavior.
  • Leverage diverse data sources—synthetic, in-the-wild, and human-annotated—to maximize coverage and robustness across diverse safety scenarios.
  • Use ablation studies to validate the contribution of each data type and training component, demonstrating the necessity of multi-task learning for optimal performance.
  • Evaluate WildGuard on WildGuardTest (5,299 human-annotated items) and ten public benchmarks, comparing against 10 strong open-source models and GPT-4 as a strong baseline.
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

Experimental results

Research questions

  • RQ1Can an open-source, multi-task moderation model outperform existing tools in detecting adversarial jailbreaks and model refusal behavior?
  • RQ2To what extent does multi-task training improve performance across prompt harmfulness, response harmfulness, and refusal detection compared to single-task models?
  • RQ3How does WildGuard compare to GPT-4 in terms of accuracy and robustness on safety moderation tasks, especially in detecting subtle or adversarial prompts?
  • RQ4Can WildGuard effectively reduce the success rate of jailbreak attacks in real human-LLM interactions without over-refusing benign requests?
  • RQ5What is the impact of different data components (synthetic, in-the-wild, worker-written) on the final model performance, and are they all necessary?

Key findings

  • WildGuard achieves state-of-the-art performance on all three safety moderation tasks, with a 26.4% improvement in F1 score on refusal detection compared to the strongest open-source baseline.
  • WildGuard matches GPT-4 performance on prompt harmfulness detection and exceeds it by up to 3.9% on adversarial prompt detection, demonstrating superior robustness to jailbreaks.
  • In real human-LLM interaction settings, WildGuard reduces the attack success rate of jailbreaks from 79.8% to 2.4%, while maintaining a low refusal rate on benign prompts (RTA of 8.0%).
  • Ablation studies show that removing any component of WildGuardTrain—especially synthetic adversarial prompts or in-the-wild data—significantly degrades performance, confirming their critical role.
  • WildGuard outperforms all open-source baselines on WildGuardTest and public benchmarks, achieving an F1 score of 81.5 on total F1 and 88.6 on response harmfulness detection.
  • The model generalizes well across different base LLMs (e.g., Llama3-8B, Mistral-7B), maintaining high performance across diverse foundation models, confirming its robustness and transferability.
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.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.