Privacy Implications of Retrieval-Based Language Models
Yangsibo Huang, Samyak Gupta, Zexuan Zhong, Kai Li, Danqi Chen
Abstract
Retrieval-based language models (LMs) have demonstrated improved interpretability, factuality, and adaptability compared to their parametric counterparts, by incorporating retrieved text from external datastores. While it is well known that parametric models are prone to leaking private data, it remains unclear how the addition of a retrieval datastore impacts model privacy. In this work, we present the first study of privacy risks in retrieval-based LMs, particularly kNN-LMs. Our goal is to explore the optimal design and training procedure in domains where privacy is of concern, aiming to strike a balance between utility and privacy. Crucially, we find that kNN-LMs are more susceptible to leaking private information from their private datastore than parametric models. We further explore mitigations of privacy risks. When privacy information is targeted and readily detected in the text, we find that a simple sanitization step would completely eliminate the risks, while decoupling query and key encoders achieves an even better utility-privacy trade-off. Otherwise, we consider strategies of mixing public and private data in both datastore and encoder training. While these methods offer modest improvements, they leave considerable room for future work. Together, our findings provide insights for practitioners to better understand and mitigate privacy risks in retrieval-based LMs. 1
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
16 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Exploiting Unintended Feature Leakage in Collaborative Learning cites Deep Learning with Differential Privacy
- Improving Language Models by Retrieving from Trillions of Tokens cites Deep Learning with Differential Privacy
- Improving Language Models by Retrieving from Trillions of Tokens cites Extracting Training Data from Large Language Models
- PIG: Privacy Jailbreak Attack on LLMs via Gradient-based Iterative In-Context Optimization cites Extracting Training Data from Large Language Models
- Mitigating the Privacy Issues in Retrieval-Augmented Generation (RAG) via Pure Synthetic Data cites Extracting Training Data from Large Language Models
- The Secret Sharer: Evaluating and Testing Unintended Memorization in Neural Networks cites Deep Learning with Differential Privacy
- Privacy-Aware Decoding: Mitigating Privacy Leakage of Large Language Models in Retrieval-Augmented Generation cites Mitigating the Privacy Issues in Retrieval-Augmented Generation (RAG) via Pure Synthetic Data
- Privacy-Aware Decoding: Mitigating Privacy Leakage of Large Language Models in Retrieval-Augmented Generation cites Deep Learning with Differential Privacy
- Privacy-Aware Decoding: Mitigating Privacy Leakage of Large Language Models in Retrieval-Augmented Generation cites Extracting Training Data from Large Language Models
- SILO Language Models: Isolating Legal Risk In a Nonparametric Datastore cites Improving Language Models by Retrieving from Trillions of Tokens
- SILO Language Models: Isolating Legal Risk In a Nonparametric Datastore cites Deep Learning with Differential Privacy
- SILO Language Models: Isolating Legal Risk In a Nonparametric Datastore cites Extracting Training Data from Large Language Models
- Extracting Training Data from Large Language Models cites The Secret Sharer: Evaluating and Testing Unintended Memorization in Neural Networks
- Extracting Training Data from Large Language Models cites Deep Learning with Differential Privacy
Cited by top-tier papers16
- SILO Language Models: Isolating Legal Risk In a Nonparametric DatastoreSewon Min, Suchin Gururangan, Eric Wallace, Weijia Shi et al.ICLR 2024 · 91 citations
- Attention is All You Need to Defend Against Indirect Prompt Injection Attacks in LLMsYinan Zhong, Qianhao Miao, Yanjiao Chen, Jiangyi Deng et al.NDSS 2026 · 13 citations
- Privacy-Aware Decoding: Mitigating Privacy Leakage of Large Language Models in Retrieval-Augmented GenerationHaoran Wang, Xiongxiao Xu, Baixiang Huang, Kai ShuKDD 2026 · 13 citations
- PIG: Privacy Jailbreak Attack on LLMs via Gradient-based Iterative In-Context OptimizationYidan Wang, Yanan Cao, Yubing Ren, Fang Fang et al.ACL 2025 · 12 citations
- Mitigating the Privacy Issues in Retrieval-Augmented Generation (RAG) via Pure Synthetic DataShenglai Zeng, Jiankun Zhang, Pengfei He, Jie Ren et al.EMNLP 2025 · 7 citations
Builds on17
- Deep Learning with Differential PrivacyMartín Abadi, Andy Chu, Ian J. Goodfellow, H. Brendan McMahan et al.CCS 2016 · 7,620 citations
- Extracting Training Data from Large Language ModelsNicholas Carlini, Florian Tramèr, Eric Wallace, Matthew Jagielski et al.USENIX Security 2021 · 2,866 citations
- Exploiting Unintended Feature Leakage in Collaborative LearningLuca Melis, Congzheng Song, Emiliano De Cristofaro, Vitaly ShmatikovS&P 2019 · 1,736 citations
- Improving Language Models by Retrieving from Trillions of TokensSebastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai et al.ICML 2022 · 1,629 citations
- The Secret Sharer: Evaluating and Testing Unintended Memorization in Neural NetworksNicholas Carlini, Chang Liu, Úlfar Erlingsson, Jernej Kos et al.USENIX Security 2019 · 1,386 citations
Related papers
- The Good and The Bad: Exploring Privacy Issues in Retrieval-Augmented Generation (RAG)Shenglai Zeng, Jiankun Zhang, Pengfei He, Yiding Liu et al.ACL Findings 2024 · 104 citations
- Why do Nearest Neighbor Language Models Work?Frank F. Xu, Uri Alon, Graham NeubigICML 2023 · 33 citations
- You can't pick your neighbors, or can you? When and How to Rely on Retrieval in the kNN-LMAndrew Drozdov, Shufan Wang, Razieh Rahimi, Andrew McCallum et al.EMNLP Findings 2022 · 10 citations
- Towards Privacy-Preserving Large Language Model: Text-free Inference Through Alignment and AdaptationJeongho Yoon, Chanhee Park, Yongchan Chun, Hyeonseok Moon et al.ACL 2026
- Follow My Instruction and Spill the Beans: Scalable Data Extraction from Retrieval-Augmented Generation SystemsZhenting Qi, Hanlin Zhang, Eric P. Xing, Sham M. Kakade et al.ICLR 2025
