迈向更安全的扩散语言模型:发现和缓解提示漏洞
Toward Safer Diffusion Language Models: Discovery and Mitigation of Priming Vulnerability
AI总结:
本文发现扩散语言模型存在因迭代去噪过程导致的提示漏洞,并提出针对性的安全对齐方法以缓解该问题。
摘要:
扩散语言模型(DLMs)通过迭代去噪并行生成标记,这可以减少延迟并实现双向条件。然而,利用这种推断机制进行劫持攻击带来的安全风险尚不明确。在本文中,我们发现DLMs由于其迭代去噪过程存在关键漏洞,并提出了一种对策。具体来说,我们的研究显示,如果有害查询的肯定标记出现在中间步骤,后续去噪可以被引导至有害响应,即使在对齐模型中也是如此。因此,仅仅注入此类肯定标记就可以轻易绕过安全护栏。此外,我们证明该漏洞允许现有基于优化的劫持攻击在DLMs上成功。基于此分析,我们提出了一种针对DLMs的新型安全对齐方法,训练模型从包含肯定标记的受污染中间状态生成安全响应。我们的实验表明,所提出的方法显著缓解了该漏洞,对任务性能影响很小。此外,我们的方法增强了对传统劫持攻击的鲁棒性。我们的工作强调了对DLMs特定安全研究的必要性。我们的代码可在https://github.com/mdl-lab/dlm-priming-vulnerability获取。
英文摘要:
Diffusion language models (DLMs) generate tokens in parallel through iterative denoising, which can reduce latency and enable bidirectional conditioning. However, the safety risks posed by jailbreak attacks that exploit this inference mechanism are not well understood. In this paper, we reveal that DLMs have a critical vulnerability stemming from their iterative denoising process and propose a countermeasure. Specifically, our investigation shows that if an affirmative token for a harmful query appears at an intermediate step, subsequent denoising can be steered toward a harmful response even in aligned models. As a result, simply injecting such affirmative tokens can readily bypass the safety guardrails. Furthermore, we demonstrate that the vulnerability allows existing optimization-based jailbreak attacks to succeed on DLMs. Building on this analysis, we propose a novel safety alignment method tailored to DLMs that trains models to generate safe responses from contaminated intermediate states that contain affirmative tokens. Our experiments indicate that the proposed method significantly mitigates the vulnerability with minimal impact on task performance. Furthermore, our method improves robustness against conventional jailbreak attacks. Our work underscores the need for DLM-specific safety research. Our code is available at https://github.com/mdl-lab/dlm-priming-vulnerability.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。