arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.18034cs.CRcs.AIcs.LG
收藏

语义变色龙:RAG系统中依赖语料库的污染攻击与防御

Semantic Chameleon: Corpus-Dependent Poisoning Attacks and Defenses in RAG Systems

Independent Researcher(独立研究者)

Scott Thornton

AI总结:

研究RAG系统中依赖语料库的污染攻击与防御,提出双文档污染攻击方法并评估混合检索防御效果,展示混合检索能有效降低攻击成功率。

摘要:

检索增强生成(RAG)系统通过外部知识源扩展大语言模型(LLMs),但检索流程引入了新的攻击面。特别是,攻击者可通过污染检索语料库使恶意文档优先检索,从而操控模型输出。本文研究了针对现代RAG管道的梯度引导语料库污染攻击,并评估了无需修改底层LLM的检索层防御。我们实现了由休眠文档和触发文档组成的双文档污染攻击,后者通过贪心坐标梯度(GCG)优化。在大规模评估中,使用Security Stack Exchange语料库(67,941文档)进行50次攻击尝试,梯度引导污染在纯向量检索下达到38.0%的共检索率。我们展示简单架构修改,混合检索结合BM25和向量相似性,能显著缓解此攻击。在所有50次攻击中,混合检索将梯度引导攻击成功率从38%降至0%,无需修改模型或重新训练检索器。当攻击者联合优化稀疏和密集检索信号时,混合检索可部分绕过,但攻击难度仍显著高于纯向量检索。对五种LLM家族(GPT-5.3、GPT-4o、Claude Sonnet 4.6、Llama 4和GPT-4o-mini)的评估显示攻击成功率从46.7%到93.3%。在FEVER维基百科数据集上的跨语料库评估(25次攻击)显示所有检索配置均无攻击成功率。

英文摘要:

Retrieval-Augmented Generation (RAG) systems extend large language models (LLMs) with external knowledge sources but introduce new attack surfaces through the retrieval pipeline. In particular, adversaries can poison retrieval corpora so that malicious documents are preferentially retrieved at inference time, enabling targeted manipulation of model outputs. We study gradient-guided corpus poisoning attacks against modern RAG pipelines and evaluate retrieval-layer defenses that require no modification to the underlying LLM. We implement dual-document poisoning attacks consisting of a sleeper document and a trigger document optimized using Greedy Coordinate Gradient (GCG). In a large-scale evaluation on the Security Stack Exchange corpus (67,941 documents) with 50 attack attempts, gradient-guided poisoning achieves a 38.0 percent co-retrieval rate under pure vector retrieval. We show that a simple architectural modification, hybrid retrieval combining BM25 and vector similarity, substantially mitigates this attack. Across all 50 attacks, hybrid retrieval reduces gradient-guided attack success from 38 percent to 0 percent without modifying the model or retraining the retriever. When attackers jointly optimize payloads for both sparse and dense retrieval signals, hybrid retrieval can be partially circumvented, achieving 20-44 percent success, but still significantly raises attack difficulty relative to vector-only retrieval. Evaluation across five LLM families (GPT-5.3, GPT-4o, Claude Sonnet 4.6, Llama 4, and GPT-4o-mini) shows attack success ranging from 46.7 percent to 93.3 percent. Cross-corpus evaluation on the FEVER Wikipedia dataset (25 attacks) yields 0 percent attack success across all retrieval configurations.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑