arXiv:2501.16378cs.LGcs.AI2025-01AAAI被引 17

不修改参数就能让视觉语言模型更安全,有效防住恶意攻击。

Internal Activation Revision: Safeguarding Vision Language Models Without Parameter Update

  • 通过修正生成时的内部激活值,动态引导输出更安全。
  • 在多个评测集上平均降低攻击成功率超48%,且不影响模型有用性。
  • 适合关注多模态安全、不想改模型结构的研究者和开发者。

视觉语言模型(VLMs)虽具备强大多模态能力,但相比其基础大语言模型(LLMs),更易生成有害内容。我们发现,图像输入会显著改变模型前向传播中的内部激活,偏离纯文本触发的激活模式。此外,嵌入在VLM中的LLM安全对齐机制无法有效应对这种激活差异,使模型极易受到简单越狱攻击。为此,我们提出一种无需参数更新的内部激活修正方法,在生成过程中动态调整激活值,引导模型输出更安全的内容。该框架在层与注意力头层面均实现修正,支持多粒度控制。我们探索了三种正负样本构建策略及两种修正向量提取方法,形成不同变体。全面实验表明,该方法显著提升主流VLM的安全性:在SafeBench、Safe-Unsafe、Unsafe和MM-SafetyBench上,攻击成功率平均降低48.94%、34.34%、43.92%和52.98%,同时对模型帮助性影响极小。

原文摘要 · Abstract (English)

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.

多模态安全视觉语言模型无参数修改激活修正

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