Red Teaming Game: A Game-Theoretic Framework for Red Teaming Language Models

Chengdong Ma, Ziran Yang, Minquan Gao, Hai Ci, Jun Gao, Xuehai Pan, Yaodong Yang · Submission to ICLR 2024 · Withdrawn

TL;DR

Current red-teaming methods for Large Language Models (LLMs) rely heavily on manual human annotation and single-turn heuristics that lack mathematical grounding and convergence guarantees. This paper introduces the Red Teaming Game (RTG), a bi-level game-theoretic framework modeling multi-turn dialogue between red-team models (attackers) and a blue-team model (defender), paired with a solver (GRTS) that incorporates semantic diversity and provably converges to an approximate Nash equilibrium.

What Problem Does This Paper Address?

Aligning LLMs for safety traditionally depends on crowdworkers writing adversarial prompts or single-turn heuristic red-teaming. These approaches suffer from three major shortcomings:

  1. Limited coverage and high cost: Human annotations are expensive, potentially psychologically harmful to annotators, and struggle to explore broad vulnerability spaces.
  2. Lack of multi-turn dynamics: Real-world attacks unfold over multi-turn conversations where malicious intents are disguised across conversational context, which single-turn evaluations miss.
  3. Absence of theoretical guarantees: Without a formal optimization framework, red-teaming offers no convergence guarantees or principled direction for simultaneous attacker exploration and defender hardening.

Methods

The authors formalize multi-turn red-teaming as a hierarchical, bi-level game (RTG):

  • Token Level (Lower Level): Sentence generation is modeled as a Markov Decision Process for Token Generation (MDPTG), where individual tokens are optimized using Proximal Policy Optimization (PPO) against a reward/cost model.
  • Sentence Level (Upper Level): Multi-turn interaction is cast as an Extensive-form Team Game in Dialogue (ETGD), framing dialogue as a zero-sum game between Red-team Language Models (RLMs) and a Blue-team Language Model (BLM).

To solve this game, the authors develop the Gamified Red-teaming Solver (GRTS), building on Policy Space Response Oracles (PSRO) and Double Oracle algorithms:

  • Semantic Diversity Regularization: When computing the best response, GRTS adds a Diversity Measure in Semantic Space (DMS) based on spectral properties of semantic embeddings. This forces the red team to explore novel attack strategies rather than collapsing to a single repetitive exploit.
  • Nash Convergence: By connecting GRTS to Generalized Weakened Fictitious Play (GWFP), the authors prove that as the diversity weight decays, the iterative strategy updates converge to an $\epsilon$-approximate Nash equilibrium in two-player zero-sum or potential game settings.

Datasets

The authors utilized several established datasets across training and evaluation (no new benchmark dataset was created):

  • Safety Payoff / Cost Model Training: The BeaverTails dataset (Ji et al., 2023), consisting of 300k human-preference and safety samples.
  • Supervised Fine-Tuning (SFT):
  • BLM-sft: Alpaca 52k dataset.
  • RLM-sft: The Bot-Adversarial Dialogue (BAD) dataset and Anthropic’s HH-RLHF red-team dataset.
  • Evaluation: Evaluated on 35k samples from the SafeRLHF-test split using Beaver-7B based reward and cost models.

Key Insights and Ideas

  • Multi-Turn Dynamics Uncover Concealed Flaws: Defending against single-turn static prompts is relatively easy for the BLM early in training. However, multi-turn interactions enable the RLM to adaptively probe and uncover latent vulnerabilities in turns 2 and 3 that static prompts fail to expose.
  • Mitigating the "Alignment Tax": Security alignment often degrades language model utility and perplexity (the "alignment tax"). Surprisingly, deep multi-turn adversarial play helps reduce this tax: the diverse, multi-turn dialogues provide rich conversational grounding, allowing BLM to reach lower perplexity and preserve helpfulness while improving harmlessness.
  • Autonomous Strategy Switching: With the semantic diversity metric, the automated red team autonomously explores 29 distinct attack topics (e.g., violence, profanity, drug smuggling) and complex attack forms like Goal Hijacking and Role Play Instructions, alternating tactics across dialogue turns to confuse the defender.

Key Results

  • Game Convergence: In iterative solver runs, exploitability dropped steadily from 6.2 down to ~0.8 across 15 PSRO iterations, confirming convergence toward an approximate Nash equilibrium.
  • Safety Shift: The BLM’s output cost distribution shifted substantially below 0 (benign territory) with tightened variance after 900 steps, demonstrating more robust safety boundaries.
  • Attack Success Rate (ASR) Reduction: Against first-turn attacks, BLM drove red-team ASR from 56.5% down to 1.0% across checkpoints. In multi-turn rounds (turns 2 and 3), the trained BLM consistently suppressed advanced, evolving RLM attacks (e.g., dropping later-turn attack success from >40% down to single digits against early checkpoints).
  • Pareto Optimality: Multi-turn interaction improved BLM's Pareto frontier between helpfulness (reward) and harmlessness (low cost), outperforming static single-turn baselines.

Limitations and Future Work

  • Computational Complexity: Training multiple actor and critic policies simultaneously across bi-level game stages requires substantial compute (experiments ran on 8 × 80GB NVIDIA A100 GPUs using LoRA and ZeRO-3).
  • Scope of Multi-RLM Settings: While theoretically formulated for multiple red-team models cooperating against a single blue team, primary experimental analyses focused on single RLM vs. BLM interactions.
  • Future Directions: The authors highlight investigating deeper geometric properties of the RTG landscape, further understanding how semantic diversity functions affect equilibrium discovery, and addressing dual-use risks regarding automated jailbreak generation.

Summary updated

BibTeX
@misc{ma2023red,
  author = {Chengdong Ma and Ziran Yang and Minquan Gao and Hai Ci and Jun Gao and Xuehai Pan and Yaodong Yang},
  title = {{Red Teaming Game: A Game-Theoretic Framework for Red Teaming Language Models}},
  year = {2023},
  eprint = {2310.00322},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.00322},
}
Figure