NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Rainbow Teaming: Open-Ended Generation of Diverse Adversarial Prompts

Mikayel Samvelyan, Sharath Chandra Raparthy, Andrei Lupu, Eric Hambro, Aram H. Markosyan, Manish Bhatt, Yuning Mao, Minqi Jiang, Jack Parker-Holder, Jakob Nicolaus Foerster, Tim Rocktäschel, Roberta Raileanu

TL;DR

This paper introduces RAINBOW TEAMING, a novel Quality-Diversity (QD) approach for automatically generating a wide range of diverse and effective adversarial prompts for Large Language Models (LLMs). This method significantly improves LLM safety and robustness by uncovering vulnerabilities and generating synthetic data for fine-tuning, without compromising general capabilities.

What Problem Does This Paper Address?

As LLMs become more integrated into real-world applications, ensuring their robustness to user inputs is critical. Current methods for finding adversarial prompts (inputs designed to elicit undesirable outputs) are often limited: they might focus on specific domains, lack diversity in the types of attacks they discover, or require substantial human effort for annotation. This leaves many potential vulnerabilities unexplored, hindering both the diagnostic understanding of LLM weaknesses and the creation of robust models. The authors aim to address this by developing a systematic and open-ended method for generating a broad spectrum of adversarial prompts.

Methods

RAINBOW TEAMING frames adversarial prompt generation as a Quality-Diversity (QD) search problem, specifically leveraging the MAP-Elites algorithm. Here's a breakdown:

  • Feature Descriptors: These define the dimensions of diversity for the adversarial prompts. For example, in the safety domain, these could be "Risk Category" (e.g., violence, hate speech) and "Attack Style" (e.g., role-play, authority manipulation). These descriptors create a multi-dimensional grid (the "archive") where each cell represents a unique combination of features.
  • Mutation Operator: An LLM (the "Mutator") is used to generate new "candidate" prompts by modifying existing prompts from the archive. This process aims to explore different feature combinations, effectively moving between cells in the archive grid.
  • Preference Model (Judge LLM): A separate LLM acts as a "Judge" to compare the response of a candidate prompt against an existing prompt in the archive (from the same feature cell). The Judge determines which prompt elicits a more undesirable (e.g., unsafe) response. If the candidate prompt is deemed more effective, it replaces the existing prompt in the archive. This pairwise comparison approach is highlighted as an advantage over simpler scoring methods.
  • MAP-Elites: The core algorithm iteratively populates the archive with the most effective prompts discovered for each feature combination, ensuring both quality (effectiveness) and diversity.

The authors also explore the impact of system prompts and a mutation filtering mechanism (using BLEU score to ensure sufficient difference between parent and child prompts) to maintain archive diversity.

Datasets

The paper primarily uses existing LLMs for generating and evaluating prompts. Specific datasets mentioned include:

  • Anthropic Harmless dataset: Used to initialize the RAINBOW TEAMING archive.
  • CyberSecEval dataset: Used for initializing the archive in the cybersecurity domain.
  • GSM8K and MMLU benchmarks: Used to evaluate the general capabilities of LLMs after fine-tuning on synthetic data generated by RAINBOW TEAMING.

No new datasets are explicitly introduced, but the generated adversarial prompts serve as a novel synthetic dataset for fine-tuning.

Key Insights and Ideas

  • Quality-Diversity for Adversarial Prompt Generation: Applying QD search to prompt generation is a novel way to systematically explore the vast space of potential adversarial attacks, moving beyond single-task or domain-specific methods.
  • Open-Ended Self-Improvement: RAINBOW TEAMING enables LLMs to continuously improve their safety and robustness by generating diverse adversarial data and then fine-tuning on it, creating a virtuous cycle.
  • Judge LLM Superiority: Using a pairwise comparison "Judge" LLM for evaluating prompt effectiveness is more robust and less prone to "reward hacking" than relying solely on score-based metrics, leading to a more open-ended search.
  • Transferability of Attacks: Adversarial prompts discovered for smaller LLMs can effectively transfer to larger models, suggesting a resource-efficient way to identify vulnerabilities.
  • Safety Fine-tuning without Capability Loss: Fine-tuning LLMs on RAINBOW TEAMING-generated adversarial data significantly improves safety without negatively impacting performance on standard benchmarks like GSM8K and MMLU.

Key Results

  • Safety Domain: RAINBOW TEAMING successfully discovered hundreds of adversarial prompts across safety, question answering, and cybersecurity domains for Llama 2-chat models. For safety, fine-tuning on generated data reduced attack success rate (ASR) from ~86% to ~1.6% (GPT-4) and ~82% to ~1.3% (Llama-Guard).
  • Question Answering: The "stepping stones" approach (using previous prompts to generate new ones) in RAINBOW TEAMING achieved higher fitness, coverage, and diversity compared to a baseline that generated questions from scratch.
  • Cybersecurity: RAINBOW TEAMING generated archives where 100% of prompts were identified as malicious by CyberSecEval for various Llama and CodeLlama models, demonstrating high effectiveness in finding vulnerabilities.
  • Transferability: Archives generated for Llama 2-chat 7B showed a 46% and 53% ASR on 13B and 70B models, respectively, indicating good transferability.

Limitations and Future Work

  • Human Expert Evaluation: While GPT-4 and Llama-Guard are used as proxies for human evaluation, the paper notes that human expert evaluation for cybersecurity found slightly lower ASR, suggesting a need for better cybersecurity-specific Judges.
  • Mutation Prompt Secrecy: The authors elected not to share mutation prompts to prevent misuse.
  • Future Research: The authors suggest that future work could focus on developing more specialized "Judge" LLMs, particularly for domains like cybersecurity, and exploring iterative fine-tuning with RAINBOW TEAMING to further enhance model robustness. They also envision applying this method to discover new adversarial strategies across different categories.

Summary updated

BibTeX
@inproceedings{samvelyan2024rainbow,
  author = {Mikayel Samvelyan and Sharath Chandra Raparthy and Andrei Lupu and Eric Hambro and Aram H. Markosyan and Manish Bhatt and Yuning Mao and Minqi Jiang and Jack Parker-Holder and Jakob Nicolaus Foerster and Tim Rocktäschel and Roberta Raileanu},
  title = {{Rainbow Teaming: Open-Ended Generation of Diverse Adversarial Prompts}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=FCsEvaMorw},
}
Figure