通过梯度定位关键图像片段并屏蔽,有效防御视觉提示攻击。
Localize and Neutralize: Gradient-guided Token Suppression against Visual Prompt Injection Attack

- 用梯度分析找出影响生成的关键图像标记
- 单次前后传播即可将攻击成功率降至接近零
- 适合需要高效安全的多模态模型部署场景
对抗性图像对多模态大语言模型构成严重安全威胁,主要通过提示注入实现。现有防御方法缺乏对攻击机制的系统理解,难以兼顾效率与防护效果。本文发现,成功攻击并不依赖图像整体,而是集中在少数关键图像标记上。基于此,提出梯度标记屏蔽(GTM)方法:通过梯度分析定位这些标记,并以掩码方式中和其影响。我们发现,基于首个生成标记输出概率的归因在攻击保持预测标记时失效。为此,GTM采用隐藏状态梯度范数作为生成影响力归因指标,在对抗输入下具有理论保障的准确性。该方法仅需一次前向-反向传播即可识别并置零少量高分标记,有效切断攻击路径。在提示注入与多模态越狱攻击上的大量实验表明,该方法可将攻击成功率(ASR)降至近零,同时几乎不增加计算开销且保持模型正常功能。
原文摘要 · Abstract (English)
Adversarial images pose a severe security threat to multimodal large language models through prompt injection. Existing defenses largely lack a principled understanding of the underlying mechanisms and struggle to balance efficiency and defense utility. In this work, we show that successful adversarial attacks do not rely on the entire image uniformly but instead depend on a small subset of critical image tokens. Based on this insight, we propose Gradient Token Masking (GTM), which localizes these tokens via gradient analysis and neutralizes them through masking. We find that attribution based on the first generated token's output probability fails when attacks preserve the predicted token. To overcome this, GTM utilizes the Hidden-State Gradient Norm score for generation-influence attribution under adversarial inputs. We prove that its ranking is consistent with that of the full adversarial loss gradient, providing a theoretical guarantee for accurate localization. Our method requires only a single forward-backward pass to identify and zero out a small number of high-scoring tokens, effectively disrupting the adversarial attack path. Extensive experiments on prompt injection and multimodal jailbreak attacks demonstrate that our approach reduces attack success rates (ASR) to near zero while preserving model utility with negligible computational overhead.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。