内部激活修正:无需参数更新即可保护视觉语言模型
Internal Activation Revision: Safeguarding Vision Language Models Without Parameter Update
AI总结:
针对视觉语言模型易受越狱攻击生成有害内容的问题,提出无需参数更新的内部激活修正方法,通过层和头级别修正激活引导安全输出,在多个基准上大幅降低攻击成功率且保持模型有用性。
摘要:
视觉语言模型(VLMs)展现出强大的多模态能力,但人们发现与其骨干大语言模型(LLMs)相比,它们更容易生成有害内容。我们的调查表明,图像的引入在前向传播过程中显著改变了模型的内部激活,使其偏离由文本输入触发的激活。此外,VLMs 内嵌的 LLMs 的安全对齐不够稳健,无法处理激活差异,使得模型甚至面对最简单的越狱攻击也很脆弱。为了解决这个问题,我们提出了一种内部激活修正方法,在生成过程中高效修正激活,引导模型输出更安全的内容。我们的框架在层和头级别都进行了修正,提供了对不同粒度级别的模型生成控制。此外,我们探索了三种构建正负样本的策略和两种提取修正向量的方法,产生了该方法的不同变体。综合实验表明,内部激活修正方法显著提高了广泛使用的 VLMs 的安全性,在 SafeBench、Safe-Unsafe、Unsafe 和 MM-SafetyBench 上分别将攻击成功率平均降低了 48.94%、34.34%、43.92% 和 52.98%,同时对模型有用性的影响极小。
英文摘要:
Vision-language models (VLMs) demonstrate strong multimodal capabilities but have been found to be more susceptible to generating harmful content compared to their backbone large language models (LLMs). Our investigation reveals that the integration of images significantly shifts the model's internal activations during the forward pass, diverging from those triggered by textual input. Moreover, the safety alignments of LLMs embedded within VLMs are not sufficiently robust to handle the activations discrepancies, making the models vulnerable to even the simplest jailbreaking attacks. To address this issue, we propose an \textbf{internal activation revision} approach that efficiently revises activations during generation, steering the model toward safer outputs. Our framework incorporates revisions at both the layer and head levels, offering control over the model's generation at varying levels of granularity. In addition, we explore three strategies for constructing positive and negative samples and two approaches for extracting revision vectors, resulting in different variants of our method. Comprehensive experiments demonstrate that the internal activation revision method significantly improves the safety of widely used VLMs, reducing attack success rates by an average of 48.94\%, 34.34\%, 43.92\%, and 52.98\% on SafeBench, Safe-Unsafe, Unsafe, and MM-SafetyBench, respectively, while minimally impacting model helpfulness.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。