arXiv:2505.17072cs.CRcs.AI2025-05ICML被引 11

通过显式安全信号提升大模型抗攻击能力,不增加显著计算开销。

Safety Alignment Can Be Not Superficial With Explicit Safety Signals

  • 引入显式二分类任务,明确判断请求与历史生成内容的安全性。
  • 在不增加0.2倍以上开销下,显著增强模型对恶意查询的防御能力。
  • 适合关注生成式AI安全性的研究者与工程师使用。

大型语言模型(LLMs)的安全对齐研究发现,现有方法常流于表面,使模型易受各类对抗攻击影响。尽管重要,这些研究大多未能提供除数据增强外的实际解决方案。本文指出其根本原因:现有对齐方法假设模型可隐式学习安全推理任务,从而拒绝有害请求,但学习到的安全信号常被其他目标稀释,导致模型在面对对抗攻击时难以确立清晰的安全决策边界。基于此,我们通过显式引入安全相关二分类任务,并将其信号整合至注意力与解码策略中,消除了这一模糊性,使模型能更负责任地响应恶意查询。实验表明,该方法仅需低于0.2倍的额外开销,即可在每个生成步骤评估查询及已有生成内容的安全性。大量实验证明,该方法显著提升了模型对多种对抗攻击的鲁棒性,为构建更稳健的生成式AI系统提供了可行路径。

原文摘要 · Abstract (English)

Recent studies on the safety alignment of large language models (LLMs) have revealed that existing approaches often operate superficially, leaving models vulnerable to various adversarial attacks. Despite their significance, these studies generally fail to offer actionable solutions beyond data augmentation for achieving more robust safety mechanisms. This paper identifies a fundamental cause of this superficiality: existing alignment approaches often presume that models can implicitly learn a safety-related reasoning task during the alignment process, enabling them to refuse harmful requests. However, the learned safety signals are often diluted by other competing objectives, leading models to struggle with drawing a firm safety-conscious decision boundary when confronted with adversarial attacks. Based on this observation, by explicitly introducing a safety-related binary classification task and integrating its signals with our attention and decoding strategies, we eliminate this ambiguity and allow models to respond more responsibly to malicious queries. We emphasize that, with less than 0.2x overhead cost, our approach enables LLMs to assess the safety of both the query and the previously generated tokens at each necessary generating step. Extensive experiments demonstrate that our method significantly improves the resilience of LLMs against various adversarial attacks, offering a promising pathway toward more robust generative AI systems.

安全对齐大模型对抗防御生成模型

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