DuoGuard: A Two-Player RL-Driven Framework for Multilingual LLM Guardrails

Yihe Deng, Yu Yang, Junkai Zhang, Wei Wang, Bo Li

Abstract

The rapid advancement of large language models (LLMs) has increased the need for guardrail models to ensure responsible use, particularly in detecting unsafe and illegal content. While substantial safety data exist in English, multilingual guardrail modeling remains underexplored due to the scarcity of open-source safety data in other languages. To address this gap, we propose a novel two-player Reinforcement Learning (RL) framework, where a generator and a guardrail model co-evolve adversarially to produce high-quality synthetic data for multilingual guardrail training. We theoretically formalize this interaction as a two-player game, proving convergence to a Nash equilibrium. Empirical evaluations show that our model DuoGuard outperforms state-of-the-art models, achieving nearly 10% improvement over LlamaGuard3 (8B) on English benchmarks while being 4.5x faster at inference with a significantly smaller model (0.5B). We achieve substantial advancements in multilingual safety tasks, particularly in addressing the imbalance for lower-resource languages in a collected real dataset. Ablation studies emphasize the critical role of synthetic data generation in bridging the imbalance in open-source data between English and other languages. These findings establish a scalable and efficient approach to synthetic data generation, paving the way for improved multilingual guardrail models to enhance LLM safety.

Introduction

As Large Language Models (LLMs) become global tools, the "guardrail" models that moderate them—detecting unsafe, illegal, or toxic content—suffer from a massive linguistic bias. Most safety training data is in English. Consequently, when these models encounter "unsafe" prompts in languages like French, German, or Spanish, their performance plummets.

The DuoGuard framework acts as a safety layer between user inputs and LLM outputs, processing multilingual content.

The core challenge is a "chicken and egg" problem: we need high-quality safety data in multiple languages to train better guardrails, but collecting real-world toxic data in dozens of languages is difficult, expensive, and ethically fraught. DuoGuard addresses this by building a self-improving system where a model learns to generate its own challenging multilingual training data.

Methods: The DuoGuard Framework

DuoGuard is an iterative two-player game grounded in minimax theory, consisting of:

  1. The Generator ($G_\phi$): Its goal is to produce "adversarial" samples—prompts in a target language that are toxic but likely to "trick" the current guardrail model into thinking they are safe.
  2. The Classifier ($C_\theta$): This is the guardrail model. Its goal is to correctly identify the toxicity of these new, challenging samples.

DPO for Data Synthesis

Standard synthetic data generation often produces "easy" examples. DuoGuard uses Direct Preference Optimization (DPO) to train the generator. It treats samples that successfully fool the classifier as "preferred" and those that the classifier catches as "dispreferred." This forces the generator to constantly hunt for the classifier's blind spots. The authors provide a theoretical proof that this interaction converges to a Nash Equilibrium, meaning both players eventually reach their optimal strategies for the given task.

Key Results

Empirical evaluations demonstrate that DuoGuard significantly advances the state-of-the-art in LLM safety moderation.

DuoGuard (0.5B) outperforms larger models in F1 score across multiple languages while maintaining significantly lower inference costs.
  • Performance: DuoGuard (0.5B) achieved a 10% improvement in average F1 score over LlamaGuard3 (8B) on English benchmarks.
  • Multilingual Superiority: It outperformed LlamaGuard3 (1B) and ShieldGemma (2B) by over 30% on average across multilingual tasks.
  • Efficiency: Because it uses a much smaller backbone (based on Qwen-2.5), DuoGuard is 4.5x faster at inference than LlamaGuard3 (8B), clocking in at ~16.5 ms/input.
  • Robustness: The model provides a 12-dimensional output (covering risks like violent crimes, hate speech, and privacy), allowing for fine-grained moderation rather than just a binary "safe/unsafe" flag.

Discussion and Insights

  • Quality over Quantity: Training on "filtered" data (samples the model actually got wrong) leads to a much higher F1 score (70.8) compared to training on all unfiltered synthetic data (64.1).
  • Weak-to-Strong Generalization: Data generated to challenge a small 0.5B model is so high-quality that it also improves the performance of larger models (like 1.5B or 1B Llama-3.2) when used for training.
  • Bridging the Language Gap: The iterative process significantly narrowed the performance gap between English and lower-resource languages. By the second iteration, performance in Spanish and German converged to levels comparable to French.

Conclusion

DuoGuard establishes a scalable and efficient approach to synthetic data generation, paving the way for improved multilingual guardrail models. While it depends on the base generator's pre-existing knowledge and may still struggle with deep cultural nuances, it represents a major step forward in ensuring LLM safety across diverse linguistic contexts.

Code, model, and data are available at https://github.com/yihedeng9/DuoGuard.

Summary updated

Abstract

The rapid advancement of large language models (LLMs) has increased the need for guardrail models to ensure responsible use, particularly in detecting unsafe and illegal content. While substantial safety data exist in English, multilingual guardrail modeling remains underexplored due to the scarcity of open-source safety data in other languages. To address this gap, we propose a novel two-player Reinforcement Learning (RL) framework, where a generator and a guardrail model co-evolve adversarially to produce high-quality synthetic data for multilingual guardrail training. We theoretically formalize this interaction as a two-player game, proving convergence to a Nash equilibrium. Empirical evaluations show that our model \ours outperforms state-of-the-art models, achieving nearly 10% improvement over LlamaGuard3 (8B) on English benchmarks while being 4.5x faster at inference with a significantly smaller model (0.5B). We achieve substantial advancements in multilingual safety tasks, particularly in addressing the imbalance for lower-resource languages in a collected real dataset. Ablation studies emphasize the critical role of synthetic data generation in bridging the imbalance in open-source data between English and other languages. These findings establish a scalable and efficient approach to synthetic data generation, paving the way for improved multilingual guardrail models to enhance LLM safety. Code, model, and data will be open-sourced at https://github.com/yihedeng9/DuoGuard.
BibTeX
@inproceedings{deng2026duoguard,
  author = {Yihe Deng and Yu Yang and Junkai Zhang and Wei Wang and Bo Li},
  title = {{DuoGuard: A Two-Player RL-Driven Framework for Multilingual LLM Guardrails}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2026},
  url = {https://openreview.net/forum?id=WGBrHMcews},
}
Figure