通过剪枝有害视觉标记提升多模态模型安全,无需训练且效率高。
SafePTR: Token-Level Jailbreak Defense in Multimodal LLMs via Prune-then-Restore Mechanism
- 在早期中间层精准剪除不足1%的有害标记
- 实现零训练开销下安全防护,对抗文本驱动攻击
- 适合需高效部署的多模态应用开发者
多模态大语言模型(MLLMs)因融合视觉输入而扩展了视觉推理能力,但也引入新漏洞,易受多模态越狱攻击,阻碍其安全部署。现有防御方法如图像转文本、安全提示和多模态安全微调,虽尝试对齐输入与内置安全机制,却未能揭示漏洞根源,尤其无法解释有害多模态标记如何触发越狱。因此仍易受文本驱动的越狱攻击,常表现过度防御并带来沉重训练开销。我们首次全面分析了有害多模态标记在何处、如何及为何绕过安全机制。令人意外的是,仅早期中间层中不到1%的标记即引发不安全行为,表明仅剪除少量有害标记即可显著提升安全性,无需安全微调。基于此,我们提出Safe Prune-then-Restore(SafePTR),一种无需训练的防御框架:在脆弱层选择性剪除有害标记,并在后续层恢复良性特征。该方法无额外计算开销,在三个MLLM和五个基准上评估显示,能有效降低越狱风险,同时保持模型实用性,达到当前最优性能。
原文摘要 · Abstract (English)
By incorporating visual inputs, Multimodal Large Language Models (MLLMs) extend LLMs to support visual reasoning. However, this integration also introduces new vulnerabilities, making MLLMs susceptible to multimodal jailbreak attacks and hindering their safe deployment.Existing defense methods, including Image-to-Text Translation, Safe Prompting, and Multimodal Safety Tuning, attempt to address this by aligning multimodal inputs with LLMs' built-in safeguards.Yet, they fall short in uncovering root causes of multimodal vulnerabilities, particularly how harmful multimodal tokens trigger jailbreak in MLLMs? Consequently, they remain vulnerable to text-driven multimodal jailbreaks, often exhibiting overdefensive behaviors and imposing heavy training overhead.To bridge this gap, we present an comprehensive analysis of where, how and which harmful multimodal tokens bypass safeguards in MLLMs. Surprisingly, we find that less than 1% tokens in early-middle layers are responsible for inducing unsafe behaviors, highlighting the potential of precisely removing a small subset of harmful tokens, without requiring safety tuning, can still effectively improve safety against jailbreaks. Motivated by this, we propose Safe Prune-then-Restore (SafePTR), an training-free defense framework that selectively prunes harmful tokens at vulnerable layers while restoring benign features at subsequent layers.Without incurring additional computational overhead, SafePTR significantly enhances the safety of MLLMs while preserving efficiency. Extensive evaluations across three MLLMs and five benchmarks demonstrate SafePTR's state-of-the-art performance in mitigating jailbreak risks without compromising utility.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。