arXiv:2505.17244cs.CLcs.AI2025-05被引 2

为大模型推理过程设计安全检测框架,识别中间步骤中的隐藏风险

ReasoningShield: Safety Detection over Reasoning Traces of Large Reasoning Models

  • 构建多层级风险分类体系,覆盖10类安全风险
  • 在9200组推理轨迹上实现35.6%的性能提升
  • 适合关注AI安全与可解释性的研究者使用

大型推理模型(LRMs)通过思维链(CoT)将复杂问题分解为中间步骤来推导答案。然而,这些推理过程可能在中间步骤中嵌入有害内容,而最终答案看似无害。现有内容审核工具难以有效检测此类隐藏风险。为此,我们提出ReasoningShield,一个轻量且鲁棒的CoT安全检测框架。主要贡献包括:(1) 建立包含10类风险、3个安全等级的多层级分类体系;(2) 构建首个CoT安全检测基准,包含9200对查询与推理轨迹,其中7000条通过人机协作标注,2200条经严格人工标注测试集;(3) 设计两阶段训练策略,结合逐步风险分析与对比学习提升鲁棒性。实验表明,ReasoningShield在基准上优于LlamaGuard-4达35.6%,优于GPT-4o达15.8%,并能有效泛化至多种推理范式与未见场景。所有资源已开源。

原文摘要 · Abstract (English)

Large Reasoning Models (LRMs) leverage transparent reasoning traces, known as Chain-of-Thoughts (CoTs), to break down complex problems into intermediate steps and derive final answers. However, these reasoning traces introduce unique safety challenges: harmful content can be embedded in intermediate steps even when final answers appear benign. Existing moderation tools, designed to handle generated answers, struggle to effectively detect hidden risks within CoTs. To address these challenges, we introduce ReasoningShield, a lightweight yet robust framework for moderating CoTs in LRMs. Our key contributions include: (1) formalizing the task of CoT moderation with a multi-level taxonomy of 10 risk categories across 3 safety levels, (2) creating the first CoT moderation benchmark which contains 9.2K pairs of queries and reasoning traces, including a 7K-sample training set annotated via a human-AI framework and a rigorously curated 2.2K human-annotated test set, and (3) developing a two-stage training strategy that combines stepwise risk analysis and contrastive learning to enhance robustness. Experiments show that ReasoningShield achieves state-of-the-art performance, outperforming task-specific tools like LlamaGuard-4 by 35.6% and general-purpose commercial models like GPT-4o by 15.8% on benchmarks, while also generalizing effectively across diverse reasoning paradigms, tasks, and unseen scenarios. All resources are released at https://github.com/CosmosYi/ReasoningShield.

AI安全思维链内容审核大模型

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