AdaShield:通过自适应盾牌提示保护多模态大语言模型免受基于结构的攻击
AdaShield: Safeguarding Multimodal Large Language Models from Structure-based Attack via Adaptive Shield Prompting
AI总结:
提出AdaShield,通过静态和自适应生成的防御提示,在不微调模型的情况下增强多模态大语言模型对基于结构的越狱攻击的鲁棒性,同时保持通用能力。
摘要:
随着多模态大语言模型(MLLMs)的出现和广泛部署,确保其安全性的必要性日益凸显。然而,随着额外模态的集成,MLLMs暴露于新的漏洞,使其容易受到基于结构的越狱攻击,其中语义内容(例如“有害文本”)被注入图像中以误导MLLMs。在这项工作中,我们旨在防御此类威胁。具体来说,我们提出了自适应盾牌提示(AdaShield),它通过在输入前添加防御提示来保护MLLMs免受基于结构的越狱攻击,而无需微调MLLMs或训练额外模块(例如后置内容检测器)。最初,我们提出了一种手动设计的静态防御提示,它逐步彻底检查图像和指令内容,并指定对恶意查询的响应方法。此外,我们引入了一个自适应自动细化框架,由目标MLLM和基于LLM的防御提示生成器(Defender)组成。这些组件协作并迭代地通信以生成防御提示。在流行的基于结构的越狱攻击和良性数据集上的大量实验表明,我们的方法能够持续提高MLLMs对基于结构的越狱攻击的鲁棒性,而不会损害模型在标准良性任务上评估的通用能力。我们的代码可在https://github.com/rain305f/AdaShield获取。
英文摘要:
With the advent and widespread deployment of Multimodal Large Language Models (MLLMs), the imperative to ensure their safety has become increasingly pronounced. However, with the integration of additional modalities, MLLMs are exposed to new vulnerabilities, rendering them prone to structured-based jailbreak attacks, where semantic content (e.g., "harmful text") has been injected into the images to mislead MLLMs. In this work, we aim to defend against such threats. Specifically, we propose \textbf{Ada}ptive \textbf{Shield} Prompting (\textbf{AdaShield}), which prepends inputs with defense prompts to defend MLLMs against structure-based jailbreak attacks without fine-tuning MLLMs or training additional modules (e.g., post-stage content detector). Initially, we present a manually designed static defense prompt, which thoroughly examines the image and instruction content step by step and specifies response methods to malicious queries. Furthermore, we introduce an adaptive auto-refinement framework, consisting of a target MLLM and a LLM-based defense prompt generator (Defender). These components collaboratively and iteratively communicate to generate a defense prompt. Extensive experiments on the popular structure-based jailbreak attacks and benign datasets show that our methods can consistently improve MLLMs' robustness against structure-based jailbreak attacks without compromising the model's general capabilities evaluated on standard benign tasks. Our code is available at https://github.com/rain305f/AdaShield.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。