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

PoisonedRAG:针对大语言模型检索增强生成的知识投毒攻击

PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models

Pennsylvania State University(宾夕法尼亚州立大学);Illinois Institute of Technology(伊利诺伊理工大学)

Wei Zou, Runpeng Geng, Binghui Wang, Jinyuan Jia

AI总结:

该研究针对RAG系统的安全空白,提出首个知识投毒攻击PoisonedRAG,通过注入少量恶意文本诱导LLM生成指定答案,攻击成功率达90%,且现有防御手段难以抵御。

摘要:

大语言模型(LLMs)凭借其卓越的生成能力取得了显著成功。尽管成效显著,它们仍存在固有局限性,例如缺乏最新知识以及会产生幻觉。检索增强生成(RAG)是缓解这些局限性的前沿技术。RAG的核心思想是让大语言模型的答案生成基于从知识库中检索到的外部知识。现有研究主要聚焦于提升RAG的准确率或效率,其安全性在很大程度上尚未被探索。我们旨在通过本研究填补这一空白。我们发现RAG系统中的知识库引入了一个全新且具备实操性的攻击面。基于该攻击面,我们提出了PoisonedRAG——首个针对RAG的知识投毒攻击,攻击者可向RAG系统的知识库中注入少量恶意文本,诱导大语言模型针对攻击者选定的目标问题生成攻击者指定的目标答案。我们将知识投毒攻击建模为一个优化问题,其解为一组恶意文本。根据攻击者对RAG系统的背景知识掌握程度(例如黑盒和白盒设置),我们分别提出了两种求解该优化问题的方案。我们的结果显示,当在包含数百万条文本的知识库中,为每个目标问题注入5条恶意文本时,PoisonedRAG可达到90%的攻击成功率。我们还评估了几种防御手段,结果表明这些防御不足以抵御PoisonedRAG,凸显了研发新型防御方案的必要性。

英文摘要:

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.

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

↑