Privacy-Aware Decoding: Mitigating Privacy Leakage of Large Language Models in Retrieval-Augmented Generation
Haoran Wang, Xiongxiao Xu, Baixiang Huang, Kai Shu
Abstract
Retrieval-Augmented Generation (RAG) enhances the factual accuracy of large language models (LLMs) by conditioning outputs on external knowledge sources. However, when retrieval involves private or sensitive data, RAG systems are susceptible to extraction attacks that can leak confidential information through generated responses. We propose Privacy-Aware Decoding (PAD), a lightweight, inference-time defense that adaptively injects calibrated Gaussian noise into token logits during generation. PAD integrates logit clipping, confidence-based screening to selectively protect high-risk tokens, a risk-adaptive calibration scale that allocates noise where it is most needed, and context-aware noise calibration to balance privacy with generation quality. A Rényi Differential Privacy (RDP) accountant tracks cumulative privacy loss, providing explicit per-response (𝜀, 𝛿) privacy accounting over the protected tokens under the realized noise schedule. Unlike prior approaches requiring retraining or corpus-level filtering, PAD is model-agnostic and operates entirely at decoding time with minimal computational overhead. Experiments on three real-world datasets demonstrate that PAD substantially reduces private information leakage while preserving response utility, outperforming existing retrieval-and post-processing-based defenses. Our work takes an important step toward mitigating privacy risks in RAG via decoding strategies, paving the way for universal and scalable privacy solutions in sensitive domains. Our code is available: https://github.com/wang2226/PAD
• Security and privacy → Data anonymization and sanitization; • Computing methodologies → Natural language generation.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 98cd0fa4-f7ae-467c-b78a-25f68f208a92Cited by top-tier papers2
- GraphRAG Under FireJiacheng Liang, Yuhui Wang, Changjiang Li, Tanqiu Jiang et al.S&P 2026 · 31 citations
- PEARL: Differentially Private and Entropy-Aware Regulated Language GenerationSeongho Joo, Hyukhun Koh, Kyomin JungICML 2026
Builds on17
- Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni et al.NeurIPS 2020 · 19,162 citations
- 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
- Large Language Models Can Be Strong Differentially Private LearnersXuechen Li, Florian Tramèr, Percy Liang, Tatsunori HashimotoICLR 2022 · 502 citations
- Differentially Private Fine-tuning of Language ModelsDa Yu, Saurabh Naik, Arturs Backurs, Sivakanth Gopi et al.ICLR 2022 · 494 citations
Related papers
- Fine-Grained Privacy Extraction from Retrieval-Augmented Generation Systems by Exploiting Knowledge AsymmetryYufei Chen, Yao Wang, Haibin Zhang, Tao GuICLR 2026 · 2 citations
- CleanGen: Mitigating Backdoor Attacks for Generation Tasks in Large Language ModelsYuetai Li, Zhangchen Xu, Fengqing Jiang, Luyao Niu et al.EMNLP 2024 · 7 citations
- On the Vulnerability of Applying Retrieval-Augmented Generation within Knowledge-Intensive Application DomainsXun Xian, Ganghua Wang, Xuan Bi, Rui Zhang et al.ICML 2025
- Detecting RAG Extraction Attack via Dual-Path Runtime Integrity GameYuanbo Xie, Yingjie Zhang, Yulin Li, Shouyou Song et al.ACL 2026
- Five Queries Are Enough: Query-Efficient and Surrogate-Free Membership Inference Attacks on RAG via EntailmentNguyen Linh Bao Nguyen, Wanlun Ma, Viet Vo, Alsharif Abuadbba et al.USENIX Security 2026 · 4 citations
