GuardReasoner: Towards Reasoning-based LLM Safeguards
Yue Liu, Hongcheng Gao, Shengfang Zhai, Yufei He, Jun Xia, Zhengyu Hu, Yulin Chen, Xihong Yang, Jiaheng Zhang, Stan Z. Li, Hui Xiong, Bryan Hooi

TL;DR
GuardReasoner is a reasoning-based safeguard for LLMs that improves safety, explainability, and performance by training on a large dataset with detailed reasoning steps and employing specialized training techniques.
Contribution
The paper introduces GuardReasoner, a novel reasoning-guided safeguard for LLMs, with new training datasets and methods that enhance reasoning, safety, and generalization.
Findings
Outperforms GPT-4o+CoT by 5.74% F1 score
Surpasses LLaMA Guard 3 8B by 20.84% F1 score
Demonstrates superior performance on 13 benchmark tasks
Abstract
As LLMs increasingly impact safety-critical applications, ensuring their safety using guardrails remains a key challenge. This paper proposes GuardReasoner, a new safeguard for LLMs, by guiding the guard model to learn to reason. Concretely, we first create the GuardReasonerTrain dataset, which consists of 127K samples with 460K detailed reasoning steps. Then, we introduce reasoning SFT to unlock the reasoning capability of guard models. In addition, we present hard sample DPO to further strengthen their reasoning ability. In this manner, GuardReasoner achieves better performance, explainability, and generalizability. Extensive experiments and analyses on 13 benchmarks of 3 guardrail tasks demonstrate its superiority. Remarkably, GuardReasoner 8B surpasses GPT-4o+CoT by 5.74% and LLaMA Guard 3 8B by 20.84% F1 score on average. We release the training data, code, and models with…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
- 🤗yueliu1999/GuardReasoner-8Bmodel· 1.8k dl· ♡ 51.8k dl♡ 5
- 🤗yueliu1999/GuardReasoner-3Bmodel· 95 dl· ♡ 395 dl♡ 3
- 🤗yueliu1999/GuardReasoner-1Bmodel· 367 dl· ♡ 5367 dl♡ 5
- 🤗yueliu1999/GuardReasoner-VL-7Bmodel· 42k dl· ♡ 442k dl♡ 4
- 🤗yueliu1999/GuardReasoner-VL-3Bmodel· 163 dl· ♡ 1163 dl♡ 1
- 🤗yueliu1999/GuardReasoner-VL-Eco-7Bmodel· 166 dl· ♡ 1166 dl♡ 1
- 🤗yueliu1999/GuardReasoner-VL-Eco-3Bmodel· 9 dl· ♡ 19 dl♡ 1
- 🤗wolfCuanhamaRWS/GuardReasoner-1B_q3_k_m_ggufmodel· 1 dl1 dl
- 🤗wolfCuanhamaRWS/GuardReasoner-1B_q2_k_ggufmodel
- 🤗wolfCuanhamaRWS/WhiteRabbitNeo-V3-7B_q2_k_ggufmodel· 2 dl2 dl
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsDigital and Cyber Forensics · Digital Rights Management and Security
MethodsDirect Preference Optimization · Shrink and Fine-Tune · LLaMA
