[论文解读] PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models
PoisonedRAG 提出针对检索增强生成(RAG)的知识污染攻击,目的在于强制攻击者选择的问题的攻击者选定答案,采用两部分污染设计,以及白盒与黑盒攻击策略。它在尽量少污染的情况下实现高攻击成功率,并显示防御不足。
Large language models (LLMs) have achieved remarkable success due to their exceptional generative capabilities. Despite their success, they also have inherent limitations such as a lack of up-to-date knowledge and hallucination. Retrieval-Augmented Generation (RAG) is a state-of-the-art technique to mitigate these limitations. The key idea of RAG is to ground the answer generation of an LLM on external knowledge retrieved from a knowledge database. Existing studies mainly focus on improving the accuracy or efficiency of RAG, leaving its security largely unexplored. We aim to bridge the gap in this work. We find that the knowledge database in a RAG system introduces a new and practical attack surface. Based on this attack surface, we propose PoisonedRAG, the first knowledge corruption attack to RAG, where an attacker could inject a few malicious texts into the knowledge database of a RAG system to induce an LLM to generate an attacker-chosen target answer for an attacker-chosen target question. We formulate knowledge corruption attacks as an optimization problem, whose solution is a set of malicious texts. Depending on the background knowledge (e.g., black-box and white-box settings) of an attacker on a RAG system, we propose two solutions to solve the optimization problem, respectively. Our results show PoisonedRAG could achieve a 90% attack success rate when injecting five malicious texts for each target question into a knowledge database with millions of texts. We also evaluate several defenses and our results show they are insufficient to defend against PoisonedRAG, highlighting the need for new defenses.
研究动机与目标
- 突出 Retrieval-Augmented Generation (RAG) 在面对知识污染攻击时的安全漏洞。
- 提出 PoisonedRAG 作为一个有针对性的污染框架,以在选定问题上造成攻击者选择的答案。
- 展示在小规模污染下的攻击有效性,覆盖多个数据集、检索器和 LLMs。
- 评估现有防御并显示它们在缓解 PoisonedRAG 方面的无效性。
提出的方法
- 将污染建模为一个受约束的优化问题,以最大化攻击者定义的答案成功率。
- 将污染文本分解为两个子文本 S 和 I,以满足检索和有效性条件。
- 使用一个 LLM 生成 I,以确保在用作上下文时目标答案出现。
- 在黑盒设置中,将 S 设为 Q,以提升与目标问题的检索相似性。
- 在白盒设置中,通过嵌入相似性优化 S,以最大化检索概率。
实验结果
研究问题
- RQ1一小组污染文本是否足以使 RAG 系统中的 LLM 为攻击者选择的问题产生攻击者选定的目标答案?
- RQ2PoisonedRAG 攻击在不同数据集、检索器和大型语言模型上有多大效果?
- RQ3当前的防御是否足以防御 RAG 中的知识污染攻击?
- RQ4构造污染文本的实际权衡(污染率、所需查询数)是什么?
主要发现
- PoisonedRAG 可实现高攻击成功率,例如在 Natural Questions 上通过对每个目标问题注入 5 条污染文本达到 97% 的 ASR。
- 在黑盒设置中,污染率为 5/2,681,468 (≈0.0002%) 即可在 NQ 上获得高 ASR。
- PoisonedRAG 在所测试数据集上优于最新的基线方法。
- 诸如改写和基于困惑度的检测等防御对 PoisonedRAG 来说并不足够。
- PoisonedRAG 在多个数据集(NQ、HotpotQA、MS-MARCO)和多种 LLMs(例如 PaLM 2、GPT-4、LLaMA-2)上仍然有效。
- 消融研究显示在 RAG 和 PoisonedRAG 中对超参数具有鲁棒性。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。