RSafe: Incentivizing proactive reasoning to build robust and adaptive LLM safeguards

Jing-Nan Zheng, Xiangtian Ji, Yi-Jun Lu, Chen-Hang Cui, Weixiang Zhao +4 more
6/1/2025
20 citations

Official code: SophieZheng998/RSafe (17 stars).

Abstract

Large Language Models (LLMs) continue to exhibit vulnerabilities despite deliberate safety alignment efforts, posing significant risks to users and society. To safeguard against the risk of policy-violating content, system-level moderation via external guard models-designed to monitor LLM inputs and outputs and block potentially harmful content-has emerged as a prevalent mitigation strategy.

Show full abstract

Existing approaches of training guard models rely heavily on extensive human curated datasets and struggle with out-of-distribution threats, such as emerging harmful categories or jailbreak attacks. To address these limitations, we propose RSafe, an adaptive reasoning-based safeguard that conducts guided safety reasoning to provide robust protection within the scope of specified safety policies. RSafe operates in two stages: 1) guided reasoning, where it analyzes safety risks of input content through policy-guided step-by-step reasoning, and 2) reinforced alignment, where rule-based RL optimizes its reasoning paths to align with accurate safety prediction. This two-stage training paradigm enables RSafe to internalize safety principles to generalize safety protection capability over unseen or adversarial safety violation scenarios. During inference, RSafe accepts user-specified safety policies to provide enhanced safeguards tailored to specific safety requirements.

View on arXivView PDF

Code Implementations(1)

Official implementation for "RSafe: Incentivizing proactive reasoning to build robust and adaptive LLM safeguards"

172

Similar Papers

Cite this paper

@article{zheng2025rsafe,
  title  = {RSafe: Incentivizing proactive reasoning to build robust and adaptive LLM safeguards},
  author = {Jing-Nan Zheng and Xiangtian Ji and Yi-Jun Lu and Chen-Hang Cui and Weixiang Zhao and Ge-Lei Deng and Zhen-Kai Liang and An Zhang and Tat-Seng Chua},
  year   = {2025},
  eprint = {2506.07736},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2506.07736},
  url    = {https://doi.org/10.48550/arXiv.2506.07736},
  journal = {Neural Information Processing Systems}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.07736.svg)](https://codeofpaper.com/paper/2506.07736)

Discussion