Source-linked AI summary
Safety Through Reasoning: An Empirical Study of Reasoning Guardrail Models
Makesh Narsimhan Sreedhar, Traian Rebedea, Christopher Parisien
TL;DR
The paper studies how to train reasoning-based guardrails efficiently and adapt them to custom safety policies. It distills reasoning data and evaluates training and inference strategies, finding strong sample efficiency, dual-mode functionality, and improved custom-policy generalization with dialogue moderation data.
Problem
The paper asks how reasoning-based guard models can be trained and deployed efficiently while generalizing to custom safety policies.
Source: §1 · p. 1Method
The authors distill teacher-generated reasoning traces from safety and topic-following data, then evaluate dual-mode inference and targeted data augmentation.
Source: §1 · p. 1, §3 · p. 2, §5.4 · p. 6Results
Reasoning guard models show strong data efficiency and dual-mode functionality, and generalize better to custom safety policies, especially with dialogue moderation data.
Source: §8 · p. 8Takeaways & Limitations
The findings offer practical guidance for training and deploying reasoning-based guard models efficiently.
Source: §8 · p. 8Experiments use reasoning data from one teacher model, two relatively small open-weight models, and English-only safety datasets.
Source: §9 · p. 9
Abstract
from arXiv · showhide
Reasoning-based language models have demonstrated strong performance across various domains, with the most notable gains seen in mathematical and coding tasks. Recent research has shown that reasoning also offers significant benefits for LLM safety and guardrail applications. In this work, we conduct a comprehensive analysis of training reasoning-based guardrail models for content moderation, with an emphasis on generalization to custom safety policies at inference time. Our study focuses on two key dimensions: data efficiency and inference efficiency. On the data front, we find that reasoning-based models exhibit strong sample efficiency, achieving competitive performance with significantly fewer training examples than their non-reasoning counterparts. This unlocks the potential to repurpose the remaining data for mining high-value, difficult samples that further enhance model performance. On the inference side, we evaluate practical trade-offs by introducing reasoning budgets, examining the impact of reasoning length on latency and accuracy, and exploring dual-mode training to allow runtime control over reasoning behavior. Our findings will provide practical insights for researchers and developers to effectively and efficiently train and deploy reasoning-based guardrails models in real-world systems.
1 Introduction
The paper investigates how reasoning can improve guardrail models used alongside LLMs, focusing on training-data efficiency, inference efficiency, custom-policy adaptation, and difficult-sample mining.
1 Introduction
- Production LLM applications often add guardrails beyond the generic safety and security provided by alignment.Guardrails can be implemented as classifiers, inference-time steering, or structured reasoning pipelines.Source: §1 · p. 1
- The study examines reasoning-based guard models’ data efficiency, inference latency, custom-policy adaptation, and difficult-sample mining.The authors report that reasoning models can achieve competitive performance with fewer examples and that limiting trace length or using dual-mode models can improve runtime efficiency while maintaining performance.Source: §1 · pp. 1–2
- The authors propose mining difficult, decision-boundary samples from large safety datasets to further refine model accuracy and robustness.Source: §1 · p. 2
2 Related Work and Motivation
Prior work establishes reasoning-based safety models and custom-policy datasets, while this study broadens the analysis to training efficiency, design choices, and policy adaptation.
2 Related Work and Motivation
- Prior reasoning-based guard models report gains in moderation, jailbreak defense, and alignment, often through trace distillation and sometimes preference optimization.The cited work includes Liu et al. (2025), Zhu et al. (2025), Upadhayay et al. (2025), Jiang et al. (2025), and Chennabasappa et al. (2025).Source: §2 · p. 2
- Custom-policy datasets such as DYNAGUARDRAIL and COSA add diverse policy domains, while dialogue moderation supports adaptation to domain-specific constraints.Source: §2 · p. 2
- GUARDREASONER studies reasoning-trace distillation and SAFECHAIN focuses on jailbreak robustness, while this work examines broader training and deployment choices.The paper also extends its analysis to custom safety policy adaptation using dialogue moderation data.Source: §2 · p. 2
3 Method
The method distills reasoning traces from existing safety and topic-following data, then combines compact training with inference-mode control and targeted data augmentation.
3 Method
- A teacher generates reasoning traces for safety and topic-following examples, which are quality-filtered before a small subset is used to train compact reasoning models.The selected subset has size N ≪ M, where M is the original dataset size; traces may vary in length to reduce inference latency.Source: §3 · p. 2
- After initial training, the method adds dual-mode inference, mines near-boundary examples for a second fine-tuning stage, and incorporates dialogue moderation data for custom-policy adaptation.The second stage uses continued supervised fine-tuning or preference optimization such as DPO or GRPO.Source: §3 · p. 2
4 Experimental Setup
The experiments use safety datasets and distilled reasoning traces, then evaluate model training variants across standard and custom-policy benchmarks.
4.1 Data Distillation
- The study uses WILDGUARDMIX and AEGIS 2.0, whose taxonomies overlap on key risks but cover complementary domains.AEGIS 2.0 emphasizes sociopolitical content, while WILDGUARDMIX also spans finance and entertainment.Source: §4.1 · pp. 2–3
- DEEPSEEK-R1-671B generates traces using each dataset’s taxonomy, interaction, and harm labels; filtering combines rules and LLM-as-a-judge review.Manual review of 100 traces identified repetition, label leakage, and excessive verbosity as recurring issues; iterative filtering and regeneration refine trace quality.Source: §4.1 · p. 3
4.2 Training and Evaluation Setup
- Evaluation covers in-domain safety sets, prompt- and response-classification benchmarks, and custom-policy benchmarks DynaGuard and CoSA.DYNAGUARDRAIL tests four policy categories, while COSAPIEN tests contextual alignment under domain-specific personas that can contradict training taxonomies.Source: §4.2 · pp. 3–4
- Table 1 reports average harmfulness F1 across training variants, with all models sharing the L3.1-8B-Instruct backbone.Results average four independent generations; orange and blue cells denote non-reasoning and reasoning variants, respectively.Source: Table 1 · p. 4
5 Training Reasoning Guard Models: Key Findings and Discussion
Reasoning-based guard models outperform non-reasoning counterparts, use training data efficiently, and show benefits from concise reasoning and dual-mode operation. Findings also cover robustness to repeated samples and prompt distributions, plus gains from targeted difficult-sample training.
5.1 Efficacy of Reasoning Guard Models
- Reasoning-based guard models outperform non-reasoning counterparts, especially on harder adversarial benchmarks such as XSTEST-RESPONSE and OPENAI MODERATION.The study compares reasoning traces distilled from DEEPSEEK-R1-671B with direct harm-label prediction using the same LLAMA-3.1-8B-INSTRUCT backbone.Source: §5.1 · pp. 4–5
5.2 Data Efficiency of Reasoning Guard Models
- At 5,000 samples, average harmfulness F1 matches full-dataset training; performance plateaus beyond 5,000, with rapid gains from 1,000 to 2,500 samples.The study reports four random subsets to control for sampling variability.Source: §5.2 · p. 5, Figure 2 · p. 5
5.3 Enforcing Reasoning Budgets
- Single-sentence traces averaging 15 tokens achieve performance comparable to full-length traces averaging 300 tokens on safety classification.The traces were shortened to budgets of 1–10 sentences and the resulting models were evaluated on safety benchmarks.Source: §5.3 · pp. 5–6, Figure 3 · p. 6
5.4 Dual-Mode Functionality
- A model trained with half its examples in each mode performs comparably to reasoning-only training in either inference mode, and non-reasoning mode beats the non-reasoning classifier by 1–3% harmful F1.The fixed-taxonomy result supports low-latency non-reasoning inference; reasoning-mode gains become more pronounced under custom taxonomies.Source: §5.4 · p. 6
5.5 Diversity of Samples
- Training on a fixed set of 500 reasoning-annotated examples reaches within 3% of full-dataset performance, despite 50 training epochs.The authors interpret this as robustness to overfitting on repeated samples.Source: §5.5 · p. 6
5.6 Difficulty of Samples
- Oversampling difficult samples near the decision boundary yields a consistent 0.5% gain, while GRPO improves harmful F1 on some tasks but degrades the overall score.Difficult samples were identified from four generated classifications; 85% of samples were classified correctly in all four generations.Source: §5.6 · p. 7
5.7 Effect of Prompt Distribution
- Reasoning-trained models from either dataset achieve comparable performance, despite WILDGUARDMIX containing more adversarial prompts and the original WILDGUARD slightly outperforming AEGIS 2.0.The authors conclude that reasoning-based training mitigates sensitivity to prompt distribution and complexity.Source: §5.7 · p. 7
6 Adaptation to Custom Safety Policies
Reasoning-based models outperform non-reasoning baselines on custom-policy benchmarks, with stronger benefits where policies are contextually distinct or potentially conflicting. Adding dialogue-moderation data also produces consistent improvements on these benchmarks.
6.1 Findings for Reasoning Guard Models
- Reasoning-based models outperform non-reasoning baselines by 3–4% on custom-policy benchmarks, with more pronounced benefits on COSA than on DYNAGUARDRAIL, where taxonomy overlap limits gains.Non-reasoning WILDGUARD models that omit the taxonomy from their input prompt experience significant performance degradation.Source: §6.1 · pp. 7–8
- Non-reasoning inference from a dual-mode model performs worse than reasoning mode on custom-policy tasks but still beats the non-reasoning baseline.The authors suggest non-reasoning mode for unchanged taxonomies and reasoning mode when adapting to novel or altered taxonomies; one-sentence budgets also trail full-length reasoning on custom-policy evaluations.Source: §6.1 · p. 8
6.2 Improving Custom Safety through Dialogue Moderation
- Combining content-safety and topic-following data with reasoning traces yields consistent improvements on custom-policy benchmarks.Topic-following dialogues pair allowed and disallowed topics with system instructions, providing weak supervision for domain-specific policy adaptation.Source: Table 2 · p. 8, §6.2 · p. 8
7 Inference Time Concerns
Non-reasoning models provide the lowest latency, while reasoning adds overhead that sentence-level constraints can reduce. Dual-mode models can default to non-reasoning inference and activate reasoning selectively when higher performance or custom-policy adaptation is needed.
7 Inference Time Concerns
- 0.019s is the average latency of non-reasoning models; unrestricted reasoning adds 170.7% overhead, while a one-sentence constraint reduces it to 34.9%.Measurements used 8 A100 GPUs with vLLM and dynamic batching.Source: §7 · p. 8
- Dual-mode models can match baseline latency in non-reasoning mode and activate reasoning selectively for higher performance or custom-policy adaptation.The reported inference-time comparisons are across Wildguard and Aegis models.Source: §7 · p. 8
8 Conclusion
The study finds that reasoning-based guard models offer data efficiency and dual-mode inference, and improve generalization to custom safety policies, especially with dialogue-moderation data. Longer traces and GRPO provide limited benefit under the evaluated setup.
8 Conclusion
- Across the study, reasoning-based guard models show data efficiency, support both inference modes, and generalize better to custom policies, especially with dialogue-moderation data.Longer traces offer limited benefit, and GRPO adds minimal value under the study’s setup.Source: §8 · p. 8
9 Limitations
The study’s conclusions are bounded by its training, model, and language coverage, and it lacks a qualitative audit of distilled reasoning traces.
9 Limitations
- Reasoning data came from a single teacher, DEEPSEEK-R1-671B, and the authors say results should be validated with other models.The experiments used only two relatively small open-weight guard models: Llama3.1 and Gemma2 at 4B and 8B; conclusions may not hold for other models or sizes.Source: §9 · p. 9
- The study lacks a thorough qualitative analysis of whether the distilled reasoning traces are correct.The authors also report missing experiments using DPO or alternatives on difficult samples and negative results from RL with GRPO.Source: §9 · p. 9
- All safety datasets were English-only, so the experiments and conclusions apply to English-only reasoning guard models.The authors call for work investigating performance on non-English languages.Source: §9 · p. 9
10 Ethics Statement and Risks
The authors report reasoning-model results alongside reproducibility details, discuss the risk of errors in reasoning traces, and replicate key trends with Gemma-3-4B. They also describe their experimental setup and planned public release.
10 Ethics Statement and Risks
- Reasoning traces may contain errors, and the authors say researchers and users should use them accordingly.They aim to release their models and data publicly upon acceptance.Source: §10 · p. 9
A Full Results
- The appendix directs readers to Tables 5–7 for prompt, response, and custom-policy scores, and Table 3 for standard deviations across four generations.The supplied table caption identifies Table 3 as standard deviations of F1 scores for each reasoning model.Source: A Full Results · p. 12, Table 3 · p. 12
B Hyperparameters for SFT Experiments
- SFT experiments used one node of eight A100 GPUs, batch size 32, learning rate 1e-6, five epochs, and a cosine learning-rate scheduler.Reported training times were 1–4 hours per experiment.Source: B Hyperparameters for SFT Experiments · p. 12
C Gemma-3-4B Results
- Gemma-3-4B reproduces the trends seen with Llama-3.1-8B-Instruct: reasoning models outperform non-reasoning baselines, especially on custom-policy benchmarks.Topic-following data further improves performance in these settings; one-sentence reasoning is comparable on standard benchmarks but drops slightly on custom-policy evaluations.Source: C Gemma-3-4B Results · p. 12
D Impact of Sampling from Full Dataset
The appendix examines sampling variability, reasoning-length budgets, GRPO, topic-following data, and the prompts used to generate and evaluate reasoning traces. It reports reduced score variability with more training samples, shorter traces under tighter budgets, and weaker overall performance from GRPO than from distilled-trace fine-tuning.
D Impact of Sampling from Full Dataset
- 0.016 to 0.005: overall-score standard deviation falls as training size increases from 500 to 5,000 samples across four random subsets.The subsets are evaluated on fixed benchmarks; the table reports mean and standard deviation for harmful F1 across four random training sets.Source: D Impact of Sampling from Full Dataset · p. 12, Table 4 · p. 12
E Sentence Level Budget Analysis
- Larger sentence-level reasoning budgets produce longer traces, while shorter traces contain less content rather than merely compressing the same information.The authors use sentence count as a practical proxy for controlling verbosity and computational cost when studying the trade-off with performance.Source: E Sentence Level Budget Analysis · pp. 12–13, Figure 5 · p. 12
F Reinforcement Learning with GRPO
- GRPO models underperformed fine-tuned models trained on DEEPSEEK-R1-671B distilled traces; the best GRPO run improved JBB-Response harmful-F1 by 1% but lowered other prompt and response tasks by 1–2%, reducing average F1 by 1.1%.The best run used continual GRPO with difficult samples, starting from a model fine-tuned on 5k random Wildguardmix samples.Source: F Reinforcement Learning with GRPO · p. 13
G Additional Details for the Topic-Following Dataset
- Topic-following evaluates whether instruction-tuned models follow detailed guidelines in task-oriented dialogues, including acceptable topics, conversation structure, and style.The dataset has 1,080 multi-turn dialogues across nine domains, with safe on-topic and unsafe off-topic turns; models decide whether to respond or deflect.Source: G Additional Details for the… · p. 13
H.2 Reasoning Trace Generation for WILDGUARDMIX
- The WildGuardMix trace-generation prompt likewise requests prompt- and response-harm classifications, plus whether the response is a refusal or compliance.Its listed categories include privacy, misinformation, and harmful language.Source: §H.2 · p. 14
H.3 Inference in Reasoning Mode
- The reasoning-mode inference prompt supplies a taxonomy and asks for prompt harm, response harm, and response refusal labels.The requested output distinguishes harmful/unharmful from refusal/compliance.Source: §H.3 · p. 14