arXiv:2512.24268cs.IR2025-12被引 5

提出两种轻量级防御机制,抵御RAG中语料库中毒攻击

RAGPart & RAGMask: Retrieval-Stage Defenses Against Corpus Poisoning in Retrieval-Augmented Generation

  • 通过文档分块和可疑令牌检测,在检索阶段识别并抑制恶意数据
  • 在四个主流检索器上测试,平均降低攻击成功率超70%且不影响正常性能
  • 无需修改生成模型,适合实际部署的RAG系统安全加固

检索增强生成(RAG)通过引入外部知识提升大语言模型性能,减少幻觉与信息过时问题。然而,近期研究揭示了其语料库中毒这一关键漏洞:攻击者可向检索语料库注入恶意文档以操纵模型输出。本文提出两种互补的检索阶段防御方法——RAGPart与RAGMask。前者利用密集检索器的训练特性,通过文档分块缓解中毒点影响;后者基于目标令牌掩码下的显著相似度变化,识别可疑词元。在两个基准、四种攻击策略及四款先进检索器上,所提防御均显著降低攻击成功率,同时在无害条件下保持原有性能。我们还设计了一种可解释攻击以压力测试防御效果。结果表明,检索阶段防御具备实用价值,为构建鲁棒RAG系统提供重要参考。

原文摘要 · Abstract (English)

Retrieval-Augmented Generation (RAG) has emerged as a promising paradigm to enhance large language models (LLMs) with external knowledge, reducing hallucinations and compensating for outdated information. However, recent studies have exposed a critical vulnerability in RAG pipelines corpus poisoning where adversaries inject malicious documents into the retrieval corpus to manipulate model outputs. In this work, we propose two complementary retrieval-stage defenses: RAGPart and RAGMask. Our defenses operate directly on the retriever, making them computationally lightweight and requiring no modification to the generation model. RAGPart leverages the inherent training dynamics of dense retrievers, exploiting document partitioning to mitigate the effect of poisoned points. In contrast, RAGMask identifies suspicious tokens based on significant similarity shifts under targeted token masking. Across two benchmarks, four poisoning strategies, and four state-of-the-art retrievers, our defenses consistently reduce attack success rates while preserving utility under benign conditions. We further introduce an interpretable attack to stress-test our defenses. Our findings highlight the potential and limitations of retrieval-stage defenses, providing practical insights for robust RAG deployments.

RAG安全语料库中毒检索防御LLM安全

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