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 · OpenReview

Abstract

Deployable Large Language Models (LLMs) must conform to the criterion of helpfulness and harmlessness, thereby achieving consistency between LLMs outputs and human values. Red-teaming techniques constitute a critical way towards this criterion. Existing work rely solely on manual red team designs and heuristic adversarial prompts for vulnerability detection and optimization. These approaches lack rigorous mathematical formulation, thus limiting the exploration of diverse attack strategy within quantifiable measure and optimization of LLMs under convergence guarantees. In this paper, we present Red-teaming Game (RTG), a general game-theoretic framework without manual annotation. RTG is designed for analyzing the multi-turn attack and defense interactions between Red-team language Models (RLMs) and Blue-team Language Model (BLM). Within the RTG, we propose Gamified Red-teaming Solver (GRTS) with diversity measure of the semantic space. GRTS is an automated red teaming technique to solve RTG towards Nash equilibrium through meta-game analysis, which corresponds to the theoretically guaranteed optimization direction of both RLMs and BLM. Empirical results in multi-turn attacks with RLMs show that GRTS autonomously discovered diverse attack strategies and effectively improved security of LLMs, outperforming existing heuristic red-team designs. Overall, RTG has established a foundational framework for red teaming tasks and constructed a new scalable oversight technique for alignment.

Introduction: The Limitations of Static Red Teaming

Ensuring the harmlessness of Large Language Models (LLMs) is a persistent challenge. Traditional "red teaming"—the process of attacking a model to find flaws—has historically relied on human experts or automated scripts generating single-round prompts against a fixed target. However, these methods suffer from three critical limitations:

  1. Mode Collapse: Automated red teams often repeat a narrow set of successful attack patterns (e.g., theft or violence), failing to explore the broader landscape of potential risks.
  2. Lack of Depth: Real-world interactions are multi-round. A model might refuse a direct harmful request initially but succumb to deception or "jailbreaking" logic over several turns.
  3. The Alignment Tax: Aggressively tuning for safety often degrades a model's utility. Static methods struggle to find the optimal balance between safety and helpfulness.
Comparison between traditional red teaming and the proposed multi-round game-theoretic framework.

Methodology: The Red Teaming Game (RTG)

To address these gaps, we introduce the Red Teaming Game (RTG), a bi-level optimization framework that models safety testing as an Extensive-form Game. This framework operates at two levels: a token-level Markov Decision Process (how sentences are built) and a sentence-level game (how red and blue teams interact over multiple rounds).

Gamified Red-teaming Solver (GRTS)

Instead of training a single "best" attacker, we propose the Gamified Red-teaming Solver (GRTS). GRTS uses a population-based approach inspired by Policy Space Response Oracles (PSRO). It maintains a "zoo" of different red and blue team versions, iteratively calculating a "best response" to the current opponent population.

The Gamified Red-teaming Solver (GRTS) workflow for finding Nash Equilibrium.

Key components of GRTS include:

  • Diversity Measure: To prevent mode collapse, we incorporate a diversity metric based on semantic space features (n-gram similarity). The reward for the red team is based not only on inducing toxicity but also on the uniqueness of the attack strategy.
  • Nash Equilibrium: The goal is to reach an approximate Nash Equilibrium—a state where the red team is as aggressive as possible and the blue team is as robust as possible, with neither side able to improve further by changing their strategy alone.

Evaluation and Key Findings

We utilized several key datasets, including Anthropic-HH, PKU-SafeRLHF, and BeaverTails, to train the toxicity reward models and benchmark against popular open-source models like Mistral-7B and the Llama-2 family.

Key Insights

  • The Spinning Top Hypothesis: The geometry of the Red Team Game resembles a "spinning top," indicating high non-transitivity. This confirms that a single master red team is impossible; a diverse population is required to cover all vulnerabilities.
  • Multi-round Amplification: Successful attacks often "snowball." If a red team can nudge a blue team toward slightly unsafe territory in early rounds, the probability of a total safety breach increases significantly in subsequent turns.
  • Implicit vs. Explicit Attacks: By forcing diversity, GRTS discovered "implicit" attacks—nuanced, deceptive prompts that avoid blacklisted words but still induce harmful outputs—which traditional methods missed.

Results

  • Convergence: The "exploitability" of the models dropped from 6.2 to 0.8 over 15 iterations, proving that the game-theoretic approach stabilizes the optimization process.
  • Superior Attack Power: The GRTS-trained red team achieved significantly higher Attack Success Rates (ASR) across almost all tested models compared to supervised fine-tuning (SFT) baselines.
  • Robust Defense: Blue teams trained via this method became nearly resilient to standard human-crafted attack datasets while retaining high helpfulness scores on benchmarks like Alpaca.

Conclusion and Future Work

While the Red Teaming Game provides a rigorous foundation for LLM alignment, it is computationally intensive, requiring significant GPU resources to maintain model populations. Furthermore, the system's efficacy is dependent on the accuracy of the underlying Toxicity Model. Future work will focus on developing more sophisticated semantic diversity metrics and applying this framework to other alignment challenges, such as factuality and reasoning.

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