提出分层防御框架,有效抵御RAG系统中的事实性数据投毒攻击。
RAGuard: A Layered Defense Framework for Retrieval-Augmented Generation Systems Against Data Poisoning
- 用合成毒数据微调稠密检索器,提前降低恶意文档权重。
- 零知识推理补丁使攻击成功率降至0.000,召回率损失小于0.03。
- 无需标签或模型内部信息,适合实际部署的黑盒防护场景。
检索增强生成(RAG)系统依赖外部语料库,易受恶意注入内容的污染攻击。本文提出RAGuard,一种针对事实性投毒攻击的分层防御框架。第一层通过合成毒文档(虚假事实、矛盾和推理陷阱)对抗性微调稠密检索器,使其在生成前降低恶意文档的优先级。第二层为零知识推理补丁(ZKIP),无需标签、真值答案或模型内部访问,仅通过留一法解码,依据文档移除引发的语义偏移与输出熵变化进行评分。在5%–30%投毒率的Natural Questions数据集上,仅靠对抗训练仍无法消除攻击,而ZKIP将攻击成功率降至0.000,同时保持Recall@5与干净语料基线相差不超过0.03。对Natural Questions和BEIR(NFCorpus)的监督分析表明,ZKIP依赖的反事实信号可捕获可学习的毒害结构。每查询增加k+1次生成开销(k=5时为6倍),本文分析了批处理与提前终止的近似方案以降低开销。此外发现,保留关键词的投毒对BM25等词法检索器几乎无影响,明确了威胁模型边界。代码、数据集与评估工具已开源。
原文摘要 · Abstract (English)
Retrieval-Augmented Generation (RAG) systems ground large language models (LLMs) in external corpora, but this reliance exposes them to corpus poisoning: maliciously injected passages that manipulate retrieved evidence. We introduce RAGuard, a layered defense against \emph{factual} corpus-poisoning attacks on RAG pipelines. The first layer adversarially fine-tunes a dense retriever on synthetic poisoned documents (fabricated facts, contradictions, and reasoning traps), teaching it to downrank malicious passages before generation. The second layer, the Zero-Knowledge Inference Patch ZKIP, is a label-free, black-box filter: for each retrieved document, it performs a leave-one-out decode and scores the document by the semantic shift and output-entropy change that its removal induces. ZKIP requires no poison labels, no ground-truth answers, and no access to model internals; it compares the model's own answers under counterfactual contexts. On poisoned Natural Questions at 5--30\% poison ratios, adversarial retriever training alone reduces but does not eliminate attack success, while ZKIP drives the measured attack success rate to 0.000 in every defended configuration, keeping Recall@5 within 0.03 of the clean-corpus baseline. Supervised analyses on both Natural Questions and BEIR (NFCorpus) confirm that the counterfactual signals ZKIP relies on carry learnable poison structure. The defense costs $k{+}1$ generator passes per query ($6\times$ for $k{=}5$); we analyze batching and early-stopping approximations that reduce this overhead. We also show that keyword-preserving poisons leave lexical retrievers such as BM25 essentially unaffected, an observation that delineates the boundary of the threat model. Code, datasets, and evaluation harnesses are released for reproducibility.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。