arXiv:2508.15648cs.CL2025-08EMNLP被引 1

用模型自判能力提升生成安全性,防越狱攻击更有效

SDGO: Self-Discrimination-Guided Optimization for Consistent Safety in Large Language Models

  • 用模型自身判别有害请求的能力做奖励信号,驱动生成安全优化
  • 在无需额外标注数据下,显著提升对越狱攻击的防御能力
  • 适合关注大模型安全、尤其是对抗攻击防护的研究者

大型语言模型在自然语言处理任务中表现优异,但仍易受越狱攻击诱导生成有害内容。本文揭示一个关键安全不一致性:模型作为判别器识别有害请求的能力强于作为生成器防御攻击的能力。这一发现启发我们探索对齐模型的判别与生成能力。为此,提出SDGO(自判别引导优化)框架,利用模型自身的判别能力作为强化学习的奖励信号,通过迭代自我改进增强生成安全性。该方法训练阶段无需任何额外标注数据或外部模型。大量实验表明,相较于提示工程和训练基线,SDGO显著提升模型安全性,同时保持通用基准上的有用性。通过对齐判别与生成能力,SDGO实现了更强的分布外(OOD)越狱攻击鲁棒性,并仅需少量判别样本即可进一步提升生成能力。代码与数据集见https://github.com/NJUNLP/SDGO。

原文摘要 · Abstract (English)

Large Language Models (LLMs) excel at various natural language processing tasks but remain vulnerable to jailbreaking attacks that induce harmful content generation. In this paper, we reveal a critical safety inconsistency: LLMs can more effectively identify harmful requests as discriminators than defend against them as generators. This insight inspires us to explore aligning the model's inherent discrimination and generation capabilities. To this end, we propose SDGO (Self-Discrimination-Guided Optimization), a reinforcement learning framework that leverages the model's own discrimination capabilities as a reward signal to enhance generation safety through iterative self-improvement. Our method does not require any additional annotated data or external models during the training phase. Extensive experiments demonstrate that SDGO significantly improves model safety compared to both prompt-based and training-based baselines while maintaining helpfulness on general benchmarks. By aligning LLMs' discrimination and generation capabilities, SDGO brings robust performance against out-of-distribution (OOD) jailbreaking attacks. This alignment achieves tighter coupling between these two capabilities, enabling the model's generation capability to be further enhanced with only a small amount of discriminative samples. Our code and datasets are available at https://github.com/NJUNLP/SDGO.

大模型安全越狱攻击强化学习自我优化

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