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)已成为增强大型语言模型(LLMs)外部知识、减少幻觉并弥补信息过时问题的有效范式。然而,近期研究揭示了RAG流程中存在一个关键漏洞——语料库投毒,即攻击者通过向检索语料库中注入恶意文档以操纵模型输出。本文提出两种互补的检索阶段防御机制:RAGPart与RAGMask。我们的防御方法直接在检索器上实施,具有计算轻量化的特点,且无需修改生成模型。RAGPart利用稠密检索器固有的训练动态,通过文档分区策略削弱中毒数据点的影响;而RAGMask则基于针对性词元掩蔽下的显著相似度偏移来识别可疑词元。在两个基准测试、四种投毒策略和四种前沿检索器的实验环境中,我们的防御方法在保持良性条件下实用性的同时,持续降低了攻击成功率。我们进一步提出一种可解释的攻击方法以压力测试防御机制。研究结果揭示了检索阶段防御方案的潜力与局限,为鲁棒的RAG部署提供了实践指导。

0
下载
关闭预览

相关内容

专知会员服务
14+阅读 · 2021年8月28日
AAAI 2022 | ProtGNN:自解释图神经网络
专知
10+阅读 · 2022年2月28日
【NeurIPS2019】图变换网络:Graph Transformer Network
LibRec 每周算法:LDA主题模型
LibRec智能推荐
29+阅读 · 2017年12月4日
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
8+阅读 · 2015年12月31日
Arxiv
0+阅读 · 2025年12月27日
VIP会员
相关资讯
相关基金
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
8+阅读 · 2015年12月31日
Top
微信扫码咨询专知VIP会员