RAPO: Risk-Aware Preference Optimization for Generalizable Safe Reasoning
Zeming Wei, Qiaosheng Zhang, Xia Hu, Xingcheng Xu
TL;DR
This paper addresses the generalization gap in safe reasoning for Large Reasoning Models under sophisticated jailbreaks. It introduces Risk-Aware Preference Optimization (RAPO), a two-stage framework combining an SFT warm-up for format-aligned safe reasoning with RL that uses a risk-aware judgment and a general utility reward to adapt the depth of safe reasoning to prompt risk. Theoretical analysis from in-context learning shows the safe reasoning budget must scale with attack complexity ($t = \Omega(k)$), and empirical results across multiple models and benchmarks demonstrate RAPO achieves strong safety (low ASR on JailbreakBench, HarmBench, and WildJailbreak) while maintaining reasoning utility (MMLU performance). The work provides a principled, generalizable alignment technique for LRM safety with practical implications for deploying LRMs in safety-critical contexts.
Abstract
Large Reasoning Models (LRMs) have achieved tremendous success with their chain-of-thought (CoT) reasoning, yet also face safety issues similar to those of basic language models. In particular, while algorithms are designed to guide them to deliberately refuse harmful prompts with safe reasoning, this process often fails to generalize against diverse and complex jailbreak attacks. In this work, we attribute these failures to the generalization of the safe reasoning process, particularly their insufficiency against complex attack prompts. We provide both theoretical and empirical evidence to show the necessity of a more sufficient safe reasoning process to defend against advanced attack prompts. Building on this insight, we propose a Risk-Aware Preference Optimization (RAPO) framework that enables LRM to adaptively identify and address the safety risks with appropriate granularity in its thinking content. Extensive experiments demonstrate that RAPO successfully generalizes multiple LRMs' safe reasoning adaptively across diverse attack prompts whilst preserving general utility, contributing a robust alignment technique for LRM safety. Our code is available at https://github.com/weizeming/RAPO.
