DSPrompt: Dynamic Soft Prompt Defense Against M-RAG Corruption
作者: Chang Liu, Yuni Lai, Mingyue Cui, Cong Tian, Yunyan Zhang, Xian Wu, Kai Zhou, Bin Xiao
分类: cs.CR, cs.CL
发布日期: 2026-08-17
💡 一句话要点
提出DSPrompt以解决M-RAG模型的对抗攻击问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 对抗攻击 多模态检索 动态软提示 嵌入重塑 鲁棒性提升
📋 核心要点
- 现有的防御方法在查询时进行,推理开销大且对未知攻击策略泛化能力差。
- DSPrompt通过在冻结的检索器中插入可学习的软提示,动态重塑嵌入语义,提升防御效果。
- 实验结果显示,DSPrompt在多个基准测试中显著降低了攻击成功率,且计算成本远低于现有防御基线。
📝 摘要(中文)
多模态检索增强生成(M-RAG)模型越来越容易受到对抗攻击,攻击者通过恶意数据生成与正常数据相似的嵌入,导致检索错误和有害输出。现有防御方法主要在查询时进行,依赖于辅助检测器、相似性重排序或特征一致性检查,但这些方法存在推理开销大、对未知攻击策略泛化能力差等问题。为此,本文提出了DSPrompt,一个动态软提示防御框架,直接重塑检索器的嵌入语义,而不修改检索流程。该方法在冻结的检索器的视觉和文本编码器的每一层中插入少量可学习的软提示,采用适应模型层容量的浅到深的长度调度。通过动态的最小-最大方案进行训练,攻击者持续生成对抗文档,而防御者则更新以将这些文档推离前k,同时保持正常证据的排名和多样性。实验表明,DSPrompt显著降低了攻击成功率和毒化检索率,同时保持了接近无损的检索效用和生成保真度。
🔬 方法详解
问题定义:本文解决的是多模态检索增强生成(M-RAG)模型在面对对抗攻击时的脆弱性。现有防御方法主要在查询阶段进行,存在推理开销大、对未知攻击泛化能力差等痛点。
核心思路:DSPrompt的核心思路是通过在视觉和文本编码器的每一层中插入少量可学习的软提示,动态调整嵌入的语义,而不改变检索流程。这种设计使得防御过程更加灵活且高效。
技术框架:DSPrompt的整体架构包括一个冻结的检索器和动态插入的软提示模块。通过动态的最小-最大训练方案,攻击者持续生成对抗文档,而防御者则更新以保持正常文档的排名和多样性。
关键创新:DSPrompt的主要创新在于其动态软提示机制,通过适应模型层的容量来优化嵌入语义,这与现有方法的静态防御策略形成了鲜明对比。
关键设计:在参数设置上,DSPrompt引入了少于1%的额外参数,且防御编码器可以像标准密集检索一样进行预计算和索引,避免了每次查询的额外优化开销。
🖼️ 关键图片
📊 实验亮点
在四个基准测试和三种代表性毒化攻击的实验中,DSPrompt显著降低了攻击成功率和毒化检索率,保持了接近无损的检索效用和生成保真度,且计算成本仅为现有防御基线的很小一部分。
🎯 应用场景
DSPrompt的研究成果在多模态检索和生成任务中具有广泛的应用潜力,尤其是在需要抵御对抗攻击的场景,如安全敏感的自动化系统和智能助手。其高效的防御机制能够提升系统的鲁棒性和可靠性,未来可能推动相关技术的商业化应用。
📄 摘要(原文)
Multimodal Retrieval Augmented Generation (M-RAG) is increasingly vulnerable to adversarial attacks where malicious data are crafted to produce embeddings that align with benign entries in the vector space, deceiving retrieval and inducing harmful outputs. Existing defenses primarily operate at query time, relying on auxiliary detectors, similarity re-ranking, or feature-consistency checks. However, these approaches suffer from non-trivial inference overhead, generalize poorly to unseen attack strategies, and often assume specific attack distributions. To address this, we propose DSPrompt, a Dynamic Soft Prompt defense framework that directly reshapes the retriever's embedding semantics, without modifying the retrieval pipeline. It inserts few learnable soft prompts into each layer of the visual and textual encoders of a frozen retriever, utilizing a shallow-to-deep length schedule that is adaptive to the capacity in the model layers. These prompts are trained under a dynamic min-max scheme: an online multimodal attacker continually crafts hard adversarial documents against the current retriever, while the defender is updated to push such documents out of the top-k while preserving the ranking and diversity of benign evidence. Because the defended encoder can be pre-computed and indexed exactly as in standard dense retrieval, DSPrompt incurs no additional per-query optimization and introduces fewer than 1% additional parameters. Extensive experiments across four benchmarks and three representative poisoning attacks show that DSPrompt substantially reduces the attack success rate and poison retrieval rate while maintaining near-lossless retrieval utility and generation fidelity, consistently outperforming existing defense baselines at a fraction of their computational cost.