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

BadRAG:识别大型语言模型检索增强生成中的漏洞

BadRAG: Identifying Vulnerabilities in Retrieval Augmented Generation of Large Language Models

University of Central Florida(中佛罗里达大学);Emory University(埃默里大学);Samsung Research America(三星美国研究院)

Jiaqi Xue, Mengxin Zheng, Yebowen Hu, Fei Liu, Xun Chen, Qian Lou

AI总结:

本文提出BadRAG攻击,通过注入恶意段落至RAG知识库,在触发词出现时引导模型输出,实现拒绝服务、情感操纵等攻击,仅注入0.04%数据即可达98.2%检索成功率。

摘要:

检索增强生成(RAG)通过从外部知识库检索相关信息,为大型语言模型(LLM)提供更准确、更具上下文感知且更及时的回答,从而增强其性能。然而,这种对外部知识的依赖引入了显著的安全漏洞,因为许多RAG系统(例如Google Search)依赖于庞大且未经净化的数据存储库(例如Reddit)。在本文中,我们揭示了一种新型威胁:攻击者通过将恶意段落注入RAG的知识库来引导系统的响应。当用户的查询包含攻击者指定的触发词时,RAG会检索并引用这些恶意段落,从而使攻击者能够在无需修改用户输入或更改RAG权重的情况下引导响应。BadRAG分两个阶段运作:(i)恶意段落被优化为仅在用户查询中出现触发词时被检索到;(ii)这些段落经过精心设计,以实现对抗性生成目标,包括拒绝服务、情感操纵、上下文泄露和工具滥用。我们的实验表明,仅注入10个恶意段落(占外部语料库的0.04%)即可实现98.2%的检索成功率,并将包含触发词的查询的负面响应率从0.22%提高到72%。

英文摘要:

Retrieval-Augmented Generation (RAG) enhances Large Language Models (LLMs) by retrieving relevant information from external knowledge bases to provide more accurate, contextually informed, and up-to-date responses. However, this reliance on external knowledge introduces significant security vulnerabilities, as many RAG systems (e.g., Google Search) rely on large and unsanitized data repositories (e.g., Reddit). In this paper, we unveil a novel threat in which attackers steer the RAG system's response by injecting malicious passages into its knowledge base. When a user's query contains attacker-specified trigger words, the RAG retrieves and refers to these malicious passages, enabling the attacker to steer the response without altering the user input or modifying the RAG weights. BadRAG operates in two phases: (i) malicious passages are optimized to be retrieved exclusively when trigger words appear in user queries; (ii) these passages are meticulously crafted to achieve adversarial generation objectives, including denial of service, sentiment manipulation, context leakage, and tool misuse. Our experiments show that injecting just 10 malicious passages (0.04\% of the external corpora) achieves a 98.2\% retrieval success rate and increases negative response rates from 0.22\% to 72\% for queries containing triggers.

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

↑