ALERT: A Comprehensive Benchmark for Assessing Large Language Models' Safety through Red Teaming

Simone Tedeschi, Felix Friedrich, Patrick Schramowski, Kristian Kersting, Roberto Navigli, Huu Nguyen, Bo LiarXiv 2024 · DOI

TL;DR

Large Language Models (LLMs) are increasingly powerful but can generate harmful content. To address this, researchers introduce ALERT, a comprehensive benchmark with over 45,000 red-teaming prompts and a fine-grained taxonomy to rigorously assess LLM safety across various risk categories. Their evaluation reveals that even leading LLMs struggle with safety, highlighting the need for more robust guardrails.

What Problem Does This Paper Address?

As LLMs become more integrated into our lives, ensuring their safety and preventing them from generating harmful, illegal, or unethical content is paramount. While red-teaming (using adversarial prompts to test safety) is a key strategy, existing methods often lack a comprehensive and granular approach to safety evaluation. This leaves a gap in understanding the specific vulnerabilities of LLMs and how to effectively mitigate them. The authors aim to fill this gap by providing a large-scale, detailed benchmark and taxonomy that can inform the development of safer LLMs and assess their alignment with various policies.

Methods

The core of this work is the ALERT benchmark, which comprises over 45,000 red-teaming prompts. These prompts are categorized using a novel, fine-grained safety risk taxonomy with 6 macro and 32 micro categories. The benchmark was constructed by starting with existing red-teaming datasets and then augmenting them with keyword-based filtering, zero-shot classification, and template-based generation to ensure broad coverage.

To evaluate LLMs, ALERT uses an automated safety assessment framework. This involves feeding prompts from the ALERT benchmark to a target LLM and then using an auxiliary LLM (Llama Guard) to classify the target LLM's responses as safe or unsafe. This process generates category-specific safety scores and an overall safety score for each LLM.

The authors also employed adversarial augmentation strategies to create a more robust benchmark. These strategies include:

  • Suffix Injection: Appending adversarial strings to trusted prompts.
  • Prefix Injection: Prepending adversarial strings to prompts.
  • Token Manipulation: Altering a small fraction of tokens in a prompt while maintaining its semantics.
  • Jailbreaking: Using complex role-playing and adversarial strategies to bypass safety directives.

Datasets

The primary dataset used for ALERT is derived from the red-team-attempts dataset from Anthropic (Ganguli et al., 2022). This was augmented with:

  • Keyword-based filtering and zero-shot classification: To identify and categorize prompts relevant to safety risks.
  • Template-based prompt generation: To ensure adequate coverage across all safety risk categories.
  • Adversarial augmentation strategies: To create a more challenging benchmark, resulting in an "ALERT_adv" subset.

Additionally, the authors constructed a Direct Preference Optimization (DPO) dataset by pairing safe and unsafe responses for given prompts. This dataset is intended to facilitate safety tuning of LLMs.

Key Insights and Ideas

  • Granularity is Key: The fine-grained taxonomy is crucial for identifying specific LLM weaknesses. Simply looking at overall safety can mask significant vulnerabilities in particular areas.
  • LLMs Still Struggle: Despite advancements, many popular LLMs, including some considered state-of-the-art, still exhibit significant safety issues across various categories.
  • Evasiveness vs. Safety: LLMs often resort to evasive responses ("I'm sorry, but I cannot assist...") to avoid generating harmful content. While this prevents unsafe outputs, it can also reduce helpfulness and lead to frustrating user experiences.
  • Policy-Specific Evaluation: The fine-grained taxonomy allows for flexible evaluation of LLM compliance with different policies, as certain categories might be more or less critical depending on the context.
  • Adversarial Robustness Varies: While some models are more robust to certain attack types (e.g., GPT models to suffixes/prefixes), almost all models are vulnerable to at least one adversarial strategy, especially jailbreaking.

Key Results

The study evaluated 10 open- and closed-source LLMs. Key findings include:

  • GPT-4 achieved an almost perfect overall safety score (close to 100%).
  • GPT-3.5 showed unsatisfactory safety scores in 18 out of 32 categories, with a relatively low overall score of 96.95%. Both GPT models struggled with sexual and drug-related content.
  • Mistral and Zephyr were found to be highly unsafe, with overall safety scores around 75% and 77.86% respectively.
  • Mixtral performed comparably to GPT-4, suggesting significant safety tuning.
  • Llama 2 was the safest among the Llama family, with an almost perfect safety score and a remarkable ability to explain why requests are harmful.
  • Alpaca, Falcon, and OLMo were generally found to be highly unsafe.
  • Adversarial attacks: Models like Alpaca and Zephyr were easily jailbroken (over 50% success rate). GPT models, while robust to some attacks, struggled with token manipulation and jailbreaking. Llama 2 showed near-perfect robustness against all attack types.

Limitations and Future Work

Limitations: * Focus on Harmfulness: ALERT exclusively focuses on harmfulness and does not assess evasiveness or unhelpfulness on harmless prompts. * Subjectivity of Safety: Safety perceptions are subjective and context-dependent, meaning the taxonomy and scores provide general orientation but not absolute guarantees. * Closed-Source Models: Reproducing results for closed-source models like GPT is difficult due to their proprietary nature. * Auxiliary LLM Bias: While efforts were made to mitigate bias (e.g., using Perspective API for Llama 2), the reliance on an auxiliary LLM for safety assessment introduces potential confounding factors.

Future Work: * Multilingual Extension: Expanding the benchmark to include multiple languages. * Safety Tuning: Utilizing the created DPO dataset to train safer LLMs. * Complementary Evaluations: Accompanying ALERT evaluations with assessments of helpfulness and evasiveness. * Adaptable Taxonomy: The taxonomy can be adapted to specific policy needs, allowing for customized safety evaluations.

Summary updated

BibTeX
@misc{tedeschi2024alert,
  author = {Simone Tedeschi and Felix Friedrich and Patrick Schramowski and Kristian Kersting and Roberto Navigli and Huu Nguyen and Bo Li},
  title = {{ALERT: A Comprehensive Benchmark for Assessing Large Language Models' Safety through Red Teaming}},
  year = {2024},
  eprint = {2404.08676},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.08676},
}
Figure