Abstract
As large language models (LLMs) become more capable and widely used, ensuring the safety of their outputs is increasingly critical. Existing guardrail models, though useful in static evaluation settings, face two major limitations in real-world applications: (1) they typically output only binary "safe/unsafe" labels, which can be interpreted inconsistently across diverse safety policies, rendering them incapable of accommodating varying safety tolerances across domains; and (2) they require complete model outputs before performing safety checks, making them fundamentally incompatible with streaming LLM inference, thereby preventing timely intervention during generation and increasing exposure to harmful partial outputs. To address these challenges, we present Qwen3Guard, a series of multilingual safety guardrail models with two specialized variants: Generative Qwen3Guard, which casts safety classification as an instruction-following task to enable fine-grained tri-class judgments (safe, controversial, unsafe); and Stream Qwen3Guard, which introduces a token-level classification head for real-time safety monitoring during incremental text generation. Both variants are available in three sizes (0.6B, 4B, and 8B parameters) and support up to 119 languages and dialects, providing comprehensive, scalable, and low-latency safety moderation for global LLM deployments. Evaluated across English, Chinese, and multilingual benchmarks, Qwen3Guard achieves state-of-the-art performance in both prompt and response safety classification. All models are released under the Apache 2.0 license for public use.
Introduction
Ensuring that Large Language Models (LLMs) stay within safety boundaries is a dynamic challenge. Most existing "guardrail" models operate as binary classifiers, labeling content as either "safe" or "unsafe." However, real-world safety policies are rarely so simplistic. Furthermore, standard moderation models typically require the entire LLM output to be generated before a safety check can occur. This introduces significant latency and risks exposing users to harmful content before the generation is complete.
Qwen3Guard addresses these gaps by introducing a suite of multilingual safety models (0.6B to 8B parameters). By incorporating a "controversial" category and a specialized streaming architecture, Qwen3Guard offers a flexible and low-latency solution for real-time LLM moderation.
Methodology
Qwen3Guard is developed in two primary variants to serve different operational needs.
Generative Qwen3Guard
This variant treats safety assessment as an instruction-following task. It is trained to categorize inputs into three classes: Safe, Unsafe, or Controversial. The "Controversial" label is a key innovation designed to handle nuanced safety policies. To generate this data, the team employed a "Strict vs. Loose" strategy, training two models with different safety biases. Disagreements between these models were labeled as "Controversial," allowing developers to toggle between "Strict Mode" (treating controversial as unsafe) and "Loose Mode" (treating controversial as safe) depending on the application context.
Stream Qwen3Guard
To enable real-time intervention, Stream Qwen3Guard adds lightweight classification heads to the final layer of the transformer. This allows for token-level safety monitoring during the generation process. The model is trained using a "rollout" method, where partial sentences are evaluated based on the safety of multiple potential completions. This approach allows the model to identify "trigger tokens" that signal a transition into unsafe content, facilitating immediate generation termination.
Datasets and Evaluation
The models were trained on a comprehensive dataset of 1.19 million samples across 119 languages. The training data includes human-annotated and synthetic examples, specifically utilizing "paired positive-negative examples" to ensure the model distinguishes intent rather than just keywords.
Evaluation was conducted across several standard benchmarks:
- English: ToxicChat, OpenAI Moderation, Aegis 2.0, HarmBench, and WildGuard.
- Multilingual: RTP-LX and PolyGuard.
- Reasoning: A specialized "Think" dataset for moderating the internal reasoning traces of models like DeepSeek-R1.
Results and Discussion
Qwen3Guard-8B-Gen achieved state-of-the-art performance across 14 public benchmarks, frequently outperforming established models such as LlamaGuard3-8B and WildGuard-7B. Notably, the 0.6B parameter variant demonstrated remarkable efficiency, rivaling the performance of much larger models and making it ideal for edge deployment.
In streaming scenarios, Stream Qwen3Guard achieved an exact hit rate of nearly 86% in identifying the first unsafe sentence. Furthermore, when integrated into Reinforcement Learning (RL) pipelines as a reward signal, the guard improved model safety from approximately 60% to over 97% on WildGuard scores without compromising helpfulness.
Conclusion and Future Work
Qwen3Guard represents a significant step toward flexible, real-time safety moderation. By moving beyond binary classification and enabling token-level monitoring, it provides developers with the tools necessary to adapt to diverse safety requirements. While the models show high performance, they remain subject to adversarial attacks and cultural biases inherent in training data. Future work will focus on geolocation-aware policies and enhancing robustness against sophisticated jailbreak attempts.
Summary updated