arXiv:2411.16721cs.CVcs.AI2024-11CVPR被引 55

提出自适应防御方法ASTRA,高效抵御视觉语言模型的越狱攻击。

Steering Away from Harm: An Adaptive Approach to Defending Vision Language Model Against Jailbreaks

  • 通过分析有害响应的视觉特征方向,动态调整模型输出路径。
  • 在不牺牲正常输入表现的前提下,显著降低越狱攻击成功率。
  • 适合需要实时安全防护的多模型应用场景。

视觉语言模型(VLMs)在面对对抗攻击时可能生成不当甚至有害内容,尤其因视觉能力引入新漏洞。现有防御方法如输入预处理、对抗训练和响应评估等,常因成本过高难以实际部署。为此,我们提出ASTRA,一种高效且有效的防御机制,通过自适应地将模型从有害特征方向偏离来抵抗攻击。核心步骤包括:随机擦除对抗图像中的视觉标记,识别与越狱强相关的标记,并据此构建可迁移的引导向量;推理时,通过引导向量与校准激活的投影实现自适应修正,使良性输入性能几乎无损,而对抗输入下有害输出被有效抑制。大量实验表明,ASTRA在多种模型和基线中均达到先进水平,兼具高效率与强泛化能力,可防御未见过的攻击类型(如结构化攻击、基于梯度下降变体的扰动攻击及纯文本攻击)。代码已开源。

原文摘要 · Abstract (English)

Vision Language Models (VLMs) can produce unintended and harmful content when exposed to adversarial attacks, particularly because their vision capabilities create new vulnerabilities. Existing defenses, such as input preprocessing, adversarial training, and response evaluation-based methods, are often impractical for real-world deployment due to their high costs. To address this challenge, we propose ASTRA, an efficient and effective defense by adaptively steering models away from adversarial feature directions to resist VLM attacks. Our key procedures involve finding transferable steering vectors representing the direction of harmful response and applying adaptive activation steering to remove these directions at inference time. To create effective steering vectors, we randomly ablate the visual tokens from the adversarial images and identify those most strongly associated with jailbreaks. These tokens are then used to construct steering vectors. During inference, we perform the adaptive steering method that involves the projection between the steering vectors and calibrated activation, resulting in little performance drops on benign inputs while strongly avoiding harmful outputs under adversarial inputs. Extensive experiments across multiple models and baselines demonstrate our state-of-the-art performance and high efficiency in mitigating jailbreak risks. Additionally, ASTRA exhibits good transferability, defending against unseen attacks (i.e., structured-based attack, perturbation-based attack with project gradient descent variants, and text-only attack). Our code is available at \url{https://github.com/ASTRAL-Group/ASTRA}.

视觉语言模型对抗防御越狱攻击自适应

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