Skip to main content
QUICK REVIEW

[论文解读] Phantom: General Backdoor Attacks on Retrieval Augmented Language Generation

Harsh Chaudhari, Giorgio Severi|arXiv (Cornell University)|May 30, 2024
Topic ModelingComputer Science被引用 3
一句话总结

Phantom 在检索增强生成(RAG)系统中提出一种通用的两阶段后门攻击,通过在知识数据库中污染单个文档,仅在用户查询中出现特定触发短语时触发大语言模型(LLM)的恶意行为。该攻击在多个 LLM(如 Llama3、Vicuna 和 Gemma)上实现了高达 52% 的侮辱性内容生成成功率和 64% 的工具使用成功率,表明 RAG 应用存在严重安全风险。

ABSTRACT

Retrieval Augmented Generation (RAG) expands the capabilities of modern large language models (LLMs), by anchoring, adapting, and personalizing their responses to the most relevant knowledge sources. It is particularly useful in chatbot applications, allowing developers to customize LLM output without expensive retraining. Despite their significant utility in various applications, RAG systems present new security risks. In this work, we propose a novel attack that allows an adversary to inject a single malicious document into a RAG system's knowledge base, and mount a backdoor poisoning attack. We design Phantom, a general two-stage optimization framework against RAG systems, that crafts a malicious poisoned document leading to an integrity violation in the model's output. First, the document is constructed to be retrieved only when a specific naturally occurring trigger sequence of tokens appears in the victim's queries. Second, the document is further optimized with crafted adversarial text that induces various adversarial objectives on the LLM output, including refusal to answer, reputation damage, privacy violations, and harmful behaviors.We demonstrate our attacks on multiple open-source LLM architectures, including Gemma, Vicuna, and Llama, and show that they transfer to closed-source models such as GPT-3.5 Turbo and GPT-4. Finally, we successfully demonstrate our attack on an end-to-end black-box production RAG system: NVIDIA's "Chat with RTX''.

研究动机与目标

  • 通过向知识数据库中注入单个恶意文档,识别并利用 RAG 系统中的新型攻击面。
  • 开发一种可泛化的两阶段攻击框架,仅使用一个污染文档即可实现对 LLM 输出的对抗性控制。
  • 在多种 LLM 架构和对抗目标(包括拒绝服务、声誉损害、隐私外泄和有害行为)上,证明此类攻击的可行性和有效性。
  • 提高 RAG 系统开发人员对不受信任的知识数据库风险的认识,并为防御策略提供依据。

提出的方法

  • 第一阶段中,通过嵌入空间对齐,优化污染文档,使其仅在用户查询中包含特定对抗性触发短语(一组标记序列)时被检索为前 k 名结果。
  • 攻击使用基于梯度的优化方法,构造一个触发序列,以最大化在触发存在时污染文档的检索概率。
  • 第二阶段中,通过多坐标梯度优化,在污染文档内生成对抗性字符串,以操纵 LLM 生成器执行特定恶意行为。
  • 该框架应用于多个 LLM(Llama3、Vicuna、Gemma),并在多种目标上进行评估,包括有害内容生成、隐私外泄和工具使用。
  • 该攻击设计具有隐蔽性,仅需一次文档注入,且即使触发短语嵌入自然语言查询中也依然有效。
  • 分析了困惑度过滤等防御对策,但作者表明攻击者可通过在优化过程中引入困惑度最小化,轻松适应此类防御。
Figure 1: RAG outputs for different adversarial objectives with our Phantom attack framework.
Figure 1: RAG outputs for different adversarial objectives with our Phantom attack framework.

实验结果

研究问题

  • RQ1是否可以仅通过在 RAG 系统知识数据库中注入一个污染文档,实现在用户查询中出现特定触发短语时才触发 LLM 生成器的对抗性行为?
  • RQ2Phantom 框架在不同 LLM 架构上诱导多样化对抗目标(如有害内容生成、隐私泄露和工具滥用)方面的有效性如何?
  • RQ3当直接越狱通常被现代 LLM 的对齐与安全机制所抵抗时,该攻击在多大程度上能绕过这些机制?
  • RQ4该攻击对基于困惑度的异常检测等潜在防御措施的鲁棒性如何?攻击者能否适应此类防御?
  • RQ5此类攻击在聊天机器人、搜索引擎和企业应用等生产环境中部署的 RAG 系统中的实际影响和现实风险是什么?

主要发现

  • 当存在对抗性触发时,Phantom 攻击在 Vicuna-7B 模型上实现了 52.0% 的侮辱性内容生成成功率,而无触发时为 0.0%。
  • 对于 Llama3-8B 模型,该攻击在相同条件下实现了 28.0% 的死亡威胁生成成功率,证明了有害行为诱导的可行性。
  • 当使用 MCG(恶意命令生成)字符串时,该攻击在 Llama3-8B 模型上实现了 64.0% 的 SEND_EMAIL API 触发成功率,而无触发时为 54.7%。
  • 成功演示了从知识数据库中外泄敏感信息,结果显示外泄数据与原始数据在编辑距离和余弦距离上的相似度较高。
  • 即使触发短语嵌入自然语言中,攻击仍保持有效,表明其具有高度隐蔽性和在真实场景中的可行性。
  • 研究发现,尽管基于困惑度的过滤可检测部分污染文档,但攻击者可轻松调整其优化策略以最小化困惑度,从而降低此类防御的有效性。
Figure 2: Phantom attack framework.
Figure 2: Phantom attack framework.

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。