Retrieval-augmented generation (RAG) is vulnerable to prompt injection attacks, in which an adversary inserts malicious documents containing carefully crafted injected prompts into the knowledge database. When a user issues a question targeted by the attack, the RAG system may retrieve these malicious documents, whose injected prompts mislead it into generating attacker-specified answers, thereby compromising the integrity of the RAG system. In this work, we propose CleanBase, a method to detect malicious documents within a knowledge database. Our key insight is that malicious documents crafted for the same attack-targeted questions often exhibit high semantic similarity, as attackers deliberately make them consistent to improve attack success rates. Accordingly, CleanBase constructs a similarity graph over the knowledge database, where each node represents a document and an edge connects two nodes if their semantic similarity--computed using an embedding model--exceeds a statistically determined threshold. Due to their inherent similarity, malicious documents tend to form cliques within this graph. CleanBase detects such cliques and flags the corresponding documents as malicious. We theoretically derive upper bounds on CleanBase's false positive and false negative rates and empirically validate its effectiveness. Experimental results across multiple datasets and prompt injection attacks demonstrate that CleanBase accurately detects malicious documents and effectively safeguards RAG systems. Our source code is available at https://github.com/WeifeiJin/CleanBase.


翻译:暂无翻译

0
下载
关闭预览

相关内容

检索增强生成(RAG)技术,261页slides
专知会员服务
42+阅读 · 2025年10月16日
【新书】Essential GraphRAG: 知识图谱增强的RAG
专知会员服务
34+阅读 · 2025年7月17日
【新书】检索增强生成(RAG)入门指南
专知会员服务
30+阅读 · 2025年6月25日
EMNLP 2024 | 基于知识编辑的大模型敏感知识擦除
专知会员服务
22+阅读 · 2024年11月19日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
60+阅读 · 2019年10月17日
【MIT博士论文】数据高效强化学习,176页pdf
强化学习三篇论文 避免遗忘等
CreateAMind
20+阅读 · 2019年5月24日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
Relation Networks for Object Detection 论文笔记
统计学习与视觉计算组
16+阅读 · 2018年4月18日
论文浅尝 | Question Answering over Freebase
开放知识图谱
19+阅读 · 2018年1月9日
读书报告 | CN-DBpedia: A Chinese Knowledge Extraction System
科技创新与创业
19+阅读 · 2018年1月4日
国家自然科学基金
1+阅读 · 2017年12月31日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2014年12月31日
VIP会员
相关主题
最新内容
DeepSeek 版Claude Code,免费小白安装教程来了!
专知会员服务
6+阅读 · 5月5日
《美空军条令出版物 2-0:情报(2026版)》
专知会员服务
12+阅读 · 5月5日
帕兰提尔 Gotham:一个游戏规则改变器
专知会员服务
6+阅读 · 5月5日
【综述】 机器人学习中的世界模型:全面综述
专知会员服务
11+阅读 · 5月4日
伊朗的导弹-无人机行动及其对美国威慑的影响
相关资讯
【MIT博士论文】数据高效强化学习,176页pdf
强化学习三篇论文 避免遗忘等
CreateAMind
20+阅读 · 2019年5月24日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
Relation Networks for Object Detection 论文笔记
统计学习与视觉计算组
16+阅读 · 2018年4月18日
论文浅尝 | Question Answering over Freebase
开放知识图谱
19+阅读 · 2018年1月9日
读书报告 | CN-DBpedia: A Chinese Knowledge Extraction System
科技创新与创业
19+阅读 · 2018年1月4日
相关基金
国家自然科学基金
1+阅读 · 2017年12月31日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员