arXiv:2411.01705cs.CRcs.CL2024-11被引 31

攻击者通过后门植入,可从RAG系统中秘密提取敏感数据。

Data Extraction Attacks in Retrieval-Augmented Generation via Backdoors

  • 在微调阶段注入少量污染数据,构建RAG系统的后门
  • 仅用5%污染数据,即可实现94.1%的原文提取成功率
  • 适合关注RAG安全与数据隐私的研究者和开发者

尽管大语言模型(LLMs)取得显著进展,但在缺乏领域特定或最新知识时仍难以提供准确答案。检索增强生成(RAG)通过引入外部知识库缓解此问题,但也带来新的攻击面。本文研究针对RAG知识库的数据提取攻击。我们发现,以往基于提示注入的攻击严重依赖LLM的指令遵循能力,因此在对恶意提示不敏感的模型上失效——例如,我们的实验显示,当前顶尖攻击在Gemma-2B-IT上的成功率接近零。此外,微调会显著降低攻击效果。为揭示漏洞,我们提出向RAG植入后门:在微调阶段注入少量污染数据,在模型中创建后门。当该受损模型被集成到RAG系统时,攻击者可通过特定提示触发,诱导其泄露检索数据库中的文档。通过精心设计污染数据,我们实现了原文和改写形式的文档提取。例如,在Gemma-2B-IT上,仅用5%污染数据,平均原文提取成功率达94.1%(ROUGE-L: 82.1),改写提取平均成功率为63.6%(平均ROUGE: 66.4),覆盖四个数据集。这些结果凸显了部署RAG系统时供应链带来的隐私风险。

原文摘要 · Abstract (English)

Despite significant advancements, large language models (LLMs) still struggle with providing accurate answers when lacking domain-specific or up-to-date knowledge. Retrieval-Augmented Generation (RAG) addresses this limitation by incorporating external knowledge bases, but it also introduces new attack surfaces. In this paper, we investigate data extraction attacks targeting RAG's knowledge databases. We show that previous prompt injection-based extraction attacks largely rely on the instruction-following capabilities of LLMs. As a result, they fail on models that are less responsive to such malicious prompts -- for example, our experiments show that state-of-the-art attacks achieve near-zero success on Gemma-2B-IT. Moreover, even for models that can follow these instructions, we found fine-tuning may significantly reduce attack performance. To further reveal the vulnerability, we propose to backdoor RAG, where a small portion of poisoned data is injected during the fine-tuning phase to create a backdoor within the LLM. When this compromised LLM is integrated into a RAG system, attackers can exploit specific triggers in prompts to manipulate the LLM to leak documents from the retrieval database. By carefully designing the poisoned data, we achieve both verbatim and paraphrased document extraction. For example, on Gemma-2B-IT, we show that with only 5\% poisoned data, our method achieves an average success rate of 94.1\% for verbatim extraction (ROUGE-L score: 82.1) and 63.6\% for paraphrased extraction (average ROUGE score: 66.4) across four datasets. These results underscore the privacy risks associated with the supply chain when deploying RAG systems.

RAG安全后门攻击数据泄露隐私风险

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