Learning to Attack and Defend: Adaptive Red Teaming of Language Models via GRPO

Blake Bullwinkel, Eugenia Kim, Amanda Minnich, Mark RussinovicharXiv 2026

TL;DR

This paper introduces AdvGRPO, a reinforcement learning framework that successfully stabilizes Group Relative Policy Optimization (GRPO) for joint attacker-defender co-training in language models. By utilizing dense multi-channel rewards, decoupled advantage normalization, and a staged curriculum, the method produces highly effective, adaptive multi-turn attackers and defenders that significantly outperform existing safety baselines.

What Problem Does This Paper Address?

Safety alignment in Large Language Models (LLMs) typically relies on static datasets of adversarial prompts. While models can be trained to resist these specific attacks, they remain highly vulnerable to adaptive attackers who dynamically shift strategies to exploit new weaknesses.

To counter this, researchers use automated "red teaming" (attackers) and "blue teaming" (defenders) to co-train models against each other in a continuous game of cat-and-mouse. While frameworks like Proximal Policy Optimization (PPO) and Direct Preference Optimization (DPO) have been used for this, prior work found Group Relative Policy Optimization (GRPO)—a highly sample-efficient RL algorithm—to be notoriously unstable in a co-training setup. This paper tackles that instability, unlocking GRPO for joint attacker-defender optimization.

Methods

The authors present AdvGRPO, which stabilizes co-training through three core innovations:

  1. Closed-Loop Multi-Turn Interaction: Unlike prior open-loop methods that generate an entire multi-turn attack script in one shot, AdvGRPO forces the attacker to observe the defender's response at each turn and adapt dynamically.
  2. Dense Multi-Channel Rewards & GDPO: To provide fine-grained control, the framework tracks multiple reward channels simultaneously. For the attacker, this includes an Attack reward (did the defender fail?), a Prompt reward (did the attacker follow the strategy?), and a Thinking-trace reward (for reasoning models). To prevent channels with lower variance from being washed out during group normalization, they use Group reward-Decoupled Policy Optimization (GDPO) to normalize each channel independently before combining them.
  3. Staged Training Curriculum: Training begins by freezing the defender and training the attacker on single-turn attacks, progressing to multi-turn attacks, and finally bootstrapping the full co-training phase where attacker and defender updates alternate every $N$ steps.
Figure 1: AdvGRPO architecture. (a) Attack rollout generation. The attacker πA is supplied with a system prompt and an objective and exchanges messages with the defender πD for up to K turns. Each defender response rk is scored by the attack reward A, which measures the extent to which the response satisfies the attack objective. Episodes where Ak exceeds a threshold are pruned early. The prompt scorer P evaluates attacker prompts, measuring adherence to the attack strategy. G independent episodes are rolled out per objective, producing up to G × K training examples per objective. (b) GDPO advantage computation and policy update. Attacker phase: A, P, and an optional think reward T form distinct reward channels, each group-normalized independently (Eq. 7), combined via weighted sum, and batch-normalized (Eq. 8). Defender phase: 1−A (adversarial objectives) and H (benign objectives) are normalized analogously. The two phases alternate every N steps during co-training.

Datasets

  • Adversarial/Harmful Objectives: A split of AdvBench (harmful behaviors) was used for training and testing, alongside the standard behaviors split of HarmBench for evaluation.
  • Benign Objectives: The vanilla_benign subset of WildJailbreak and XSTest were utilized to ensure the defender maintains benign compliance (doesn't refuse safe prompts).
  • General Utility Benchmarks: To ensure safety training didn't degrade core capabilities, defenders were evaluated on MMLU (knowledge), TruthfulQA (factuality), ARC-C (reasoning), and IFBench (instruction following).

Key Insights and Ideas

  • Why GRPO Fails in Vanilla Co-Training (and How to Fix It): Vanilla GRPO's group normalization couples the advantage scale to a continually shifting reward distribution as both models evolve. GDPO mitigates this by standardizing each reward channel independently, keeping the gradients well-scaled even as the attacker or defender improves.
  • Unaligned $\neq$ Strategic: The authors evaluated "uncensored" or abliterated models as attackers and found they performed poorly. Simply removing safety guardrails does not inherently grant an LLM the strategic capability required to systematically bypass another model's defenses; adversarial strategy must be explicitly learned.
  • Closed-Loop Superiority: Training the attacker turn-by-turn prevents it from overfitting to static training objectives, yielding significantly better out-of-distribution (OOD) generalization when transferring to unseen defenders.

Key Results

Attacker Performance

AdvGRPO yielded massive gains in Attack Success Rate (ASR). The Qwen2.5-14B multi-turn attacker achieved a 90–91% ASR against GPT-4.1. Remarkably, the reasoning-capable Qwen3.5-9B achieved a 71–79% ASR in a single turn, successfully overcoming its own internal alignment-induced self-censorship during the RL process.

Table 1: Attack success rate (%) achieved by AdvGRPO attackers and baseline methods. ASR is computed on a held- out split of AdvBench and the standard behaviors subset of HarmBench using the HarmBench-Llama-2-13b-cls classifier. Blue values show improvement over the corresponding base model. ST denotes single-turn, MT is multi-turn (max 5 turns), and ST-Think is single-turn with reasoning traces. GPT-4.1 was used as the test-time defender for all methods.

Defender Performance

When evaluated on standard safety benchmarks, the co-trained defenders achieved state-of-the-art robustness. On HarmBench, the AdvGRPO-trained defender reduced the ASR to <2%, vastly outperforming the base model (18.8%), Self-RedTeam (16.8%), and AdvGame (4.7%), all while preserving or slightly improving general utility scores on tasks like MMLU and IFBench.

Figure 2: Upper: Reward curves for Qwen3.5-9B attacker-only training with GPT-4.1 as the defender. In addition to A and P, this reasoning-capable attacker is trained to maximize a thinking-trace reward T . Lower: Reward curves for co-training with Qwen2.5-14B as the attacker and Qwen2.5-7B as the defender. Combined attacker rewards are computed via weighted sum of the independently normalized reward channels.

Limitations and Future Work

  • Reduced Benign Compliance: The trained defenders showed a tendency to over-refuse safe prompts that look superficially harmful (e.g., on XSTest). The authors note that incorporating adversarial benign prompts (benign requests framed aggressively) during co-training would likely fix this.
  • Prompt Entropy Collapse: Over the course of training, the attacker's prompt diversity decreased, converging on narrow phrasing strategies. Standard token-level entropy regularization failed to fix this without degrading performance, indicating a need for future work into strategy-level diversity mechanisms.

Summary updated

BibTeX
@misc{bullwinkel2026learning,
  author = {Blake Bullwinkel and Eugenia Kim and Amanda Minnich and Mark Russinovich},
  title = {{Learning to Attack and Defend: Adaptive Red Teaming of Language Models via GRPO}},
  year = {2026},
  eprint = {2606.09701},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.09701},
}

Loading related content...

Figure