arXiv:2506.07736cs.AI2025-06NeurIPS被引 17

让大模型主动推理安全风险,自动适应新威胁

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

  • 通过分步推理分析输入内容的安全风险
  • 用规则强化学习优化判断路径,提升准确率
  • 支持自定义安全策略,适合定制化防护场景

大型语言模型即使经过安全对齐训练仍存在漏洞,可能引发用户与社会风险。当前主流防护方式是使用外部守卫模型监控输入输出并拦截违规内容,但依赖大量人工标注数据,难以应对新出现的有害类别或越狱攻击等分布外威胁。为此,我们提出RSafe,一种基于自适应推理的防护机制,通过分步引导式安全推理,在指定安全政策范围内提供鲁棒保护。其训练包含两个阶段:1)引导推理,通过政策指导的逐步分析评估输入内容的安全风险;2)强化对齐,采用基于规则的强化学习优化推理路径,使其预测结果与真实安全判断对齐。该两阶段训练使RSafe能内化安全原则,从而在未见过或对抗性违规场景中具备泛化能力。推理时,可接受用户自定义的安全策略,提供针对特定需求的增强防护。

原文摘要 · Abstract (English)

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. 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.

安全防护推理机制自适应

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。