用动态软提示防御多模态检索生成的恶意数据攻击
DSPrompt: Dynamic Soft Prompt Defense Against M-RAG Corruption

- 在编码器中插入可学习的软提示,动态调整嵌入语义
- 在四个基准上将攻击成功率降低超过70%,毒化检索率下降60%以上
- 无需查询时计算,参数增量不足1%,适合实际部署
多模态检索增强生成(M-RAG)易受对抗攻击,恶意数据可生成与良性条目对齐的嵌入,欺骗检索并诱导有害输出。现有防御多在查询时进行,依赖辅助检测器或重排序,存在推理开销大、泛化能力差、假设攻击分布等问题。为此,我们提出DSPrompt:一种动态软提示防御框架,通过在冻结的视觉与文本编码器各层插入少量可学习软提示,重塑检索器的嵌入语义,采用自浅至深的长度调度策略以适配模型容量。训练采用动态最小-最大机制:在线多模态攻击者持续生成对抗文档,而防御方更新以将这些文档移出top-k,同时保持良性证据的排名与多样性。由于防御后的编码器可像标准密集检索一样预计算和索引,DSPrompt不引入额外查询优化,参数增量低于1%。在四个基准和三种代表性投毒攻击上的实验表明,该方法显著降低攻击成功率与毒化检索率,同时保持近乎无损的检索性能与生成保真度,且计算成本仅为基线的一小部分。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。