Follow My Instruction and Spill the Beans: Scalable Data Extraction from Retrieval-Augmented Generation Systems
Zhenting Qi, Hanlin Zhang, Eric P. Xing, Sham M. Kakade, Himabindu Lakkaraju
摘要
Retrieval-Augmented Generation (RAG) improves pre-trained models by incorporating external knowledge at test time to enable customized adaptation. We study the risk of datastore leakage in Retrieval-In-Context RAG Language Models (LMs). We show that an adversary can exploit LMs' instruction-following capabilities to easily extract text data verbatim from the datastore of RAG systems built with instruction-tuned LMs via prompt injection. The vulnerability exists for a wide range of modern LMs that span Llama2, Mistral/Mixtral, Vicuna, SOLAR, WizardLM, Qwen1.5, and Platypus2, and the exploitability exacerbates as the model size scales up. We also study multiple effects of RAG setup on the extractability of data, indicating that following unexpected instructions to regurgitate data can be an outcome of failure in effectively utilizing contexts for modern LMs, and further show that such vulnerability can be greatly mitigated by position bias elimination strategies. Extending our study to production RAG models GPTs, we design an attack that can cause datastore leakage with a 100% success rate on 25 randomly selected customized GPTs with at most 2 queries, and we extract text data verbatim at a rate of 41% from a book of 77,000 words and 3% from a corpus of 1,569,000 words by prompting the GPTs with only 100 queries generated by themselves. Code is available at this repository.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 21 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Silent Leaks: Implicit Knowledge Extraction Attack on RAG Systems 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- Mask-based Membership Inference Attacks for Retrieval-Augmented Generation 引用了 Language Models are Few-Shot Learners
- Mask-based Membership Inference Attacks for Retrieval-Augmented Generation 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- Mask-based Membership Inference Attacks for Retrieval-Augmented Generation 引用了 Extracting Training Data from Large Language Models
- Privacy-Aware Decoding: Mitigating Privacy Leakage of Large Language Models in Retrieval-Augmented Generation 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- Privacy-Aware Decoding: Mitigating Privacy Leakage of Large Language Models in Retrieval-Augmented Generation 引用了 Extracting Training Data from Large Language Models
- Overcoming the Retrieval Barrier: Indirect Prompt Injection in the Wild for LLM Systems 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- Overcoming the Retrieval Barrier: Indirect Prompt Injection in the Wild for LLM Systems 引用了 Retrieval Augmented Language Model Pre-Training
- Language Models are Few-Shot Learners 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- Can LLMs Keep a Secret? Testing Privacy Implications of Language Models via Contextual Integrity Theory 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- Extracting Training Data from Large Language Models 引用了 Language Models are Few-Shot Learners
引用它的顶会 Paper21
- Can LLMs Keep a Secret? Testing Privacy Implications of Language Models via Contextual Integrity TheoryNiloofar Mireshghallah, Hyunwoo Kim, Xuhui Zhou, Yulia Tsvetkov 等ICLR 2024 · 198 次引用
- Mask-based Membership Inference Attacks for Retrieval-Augmented GenerationMingrui Liu, Sixiao Zhang, Cheng LongWWW 2025 · 28 次引用
- Overcoming the Retrieval Barrier: Indirect Prompt Injection in the Wild for LLM SystemsHongyan Chang, Ergute Bao, Xinjian Luo, Ting YuUSENIX Security 2026 · 24 次引用
- Silent Leaks: Implicit Knowledge Extraction Attack on RAG SystemsYuhao Wang, Wenjie Qu, Shengfang Zhai, Yanze Jiang 等ICLR 2026 · 13 次引用
- Privacy-Aware Decoding: Mitigating Privacy Leakage of Large Language Models in Retrieval-Augmented GenerationHaoran Wang, Xiongxiao Xu, Baixiang Huang, Kai ShuKDD 2026 · 13 次引用
它引用的 Paper33
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni 等NeurIPS 2020 · 19,162 次引用
- BERTScore: Evaluating Text Generation with BERTTianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q. Weinberger 等ICLR 2020 · 8,443 次引用
- Retrieval Augmented Language Model Pre-TrainingKelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat 等ICML 2020 · 2,937 次引用
- Extracting Training Data from Large Language ModelsNicholas Carlini, Florian Tramèr, Eric Wallace, Matthew Jagielski 等USENIX Security 2021 · 2,866 次引用
相关 Paper
- The Good and The Bad: Exploring Privacy Issues in Retrieval-Augmented Generation (RAG)Shenglai Zeng, Jiankun Zhang, Pengfei He, Yiding Liu 等ACL Findings 2024 · 104 次引用
- PR-Attack: Coordinated Prompt-RAG Attacks on Retrieval-Augmented Generation in Large Language Models via Bilevel OptimizationYang Jiao, Xiaodong Wang, Kai YangSIGIR 2025 · 6 次引用
- WARP: A Word-Level Backdoor Attack Targeting RAG Systems via Retrieval Corpus PoisoningHui Liu, Yibo Zhou, Liguo Dong, Weidong Li 等KDD 2026
- Exposing Privacy Risks in Graph Retrieval-Augmented GenerationJiale Liu, Jiahao Zhang, Suhang WangACL Findings 2026 · 1 次引用
- On the Vulnerability of Applying Retrieval-Augmented Generation within Knowledge-Intensive Application DomainsXun Xian, Ganghua Wang, Xuan Bi, Rui Zhang 等ICML 2025
