Skip to main content
QUICK REVIEW

[Paper Review] The Good and The Bad: Exploring Privacy Issues in Retrieval-Augmented Generation (RAG)

Shenglai Zeng, Jiankun Zhang|arXiv (Cornell University)|Feb 23, 2024
Privacy, Security, and Data ProtectionSocial Sciences5 citations
TL;DR

The paper demonstrates that RAG systems are vulnerable to retrieval-data leakage via carefully crafted prompts, and that retrieval augmentation can reduce memorization of LLM training data; it also discusses defenses and mitigations.

ABSTRACT

Retrieval-augmented generation (RAG) is a powerful technique to facilitate language model with proprietary and private data, where data privacy is a pivotal concern. Whereas extensive research has demonstrated the privacy risks of large language models (LLMs), the RAG technique could potentially reshape the inherent behaviors of LLM generation, posing new privacy issues that are currently under-explored. In this work, we conduct extensive empirical studies with novel attack methods, which demonstrate the vulnerability of RAG systems on leaking the private retrieval database. Despite the new risk brought by RAG on the retrieval data, we further reveal that RAG can mitigate the leakage of the LLMs' training data. Overall, we provide new insights in this paper for privacy protection of retrieval-augmented LLMs, which benefit both LLMs and RAG systems builders. Our code is available at https://github.com/phycholosogy/RAG-privacy.

Motivation & Objective

  • Assess privacy leakage risks from external retrieval datasets used by RAG systems.
  • Evaluate whether RAG prompts can extract private data from the retrieval database.
  • Investigate how retrieval augmentation affects memorization of LLM training data.
  • Explore mitigation strategies for protecting retrieval data and training data in RAG.
  • Provide practical guidance for privacy-preserving RAG deployments.

Proposed method

  • Proposes composite structured prompting combining an {information} component and a {command} component to induce retrieval and output of private data.
  • Conducts untargeted and targeted attacks to extract data from retrieval datasets (Enron emails and HealthcareMagic dialogues) using LLMs (Llama-7b-chat, Llama-13b-chat, GPT-3.5-turbo).
  • Performs targeted attacks to extract PIIs and disease-related data; evaluates success via retrieved contexts, prompts, and Rouge/Extraction metrics.
  • Performs ablation studies on the number of retrieved documents (k) and command design to assess leakage dynamics.
  • Examines defenses including reranking, summarization (extractive and abstractive), and retrieval-distance thresholds as privacy mitigations.
  • Evaluates the effect of retrieval augmentation on memorization attacks (targeted/prefix) using GPT-Neo-1.3B as the target model.

Experimental results

Research questions

  • RQ1RQ1: Can private data be extracted from the external retrieval database in a RAG system?
  • RQ2RQ2: Can the retrieval data influence the memorization behavior of LLMs in RAG?

Key findings

  • Untargeted prompts can retrieve and reproduce significant portions of the retrieval data, with many prompts yielding exact or highly similar content.
  • Targeted prompts successfully extract PIIs and disease-related information from retrieval data across datasets and models.
  • Retrieval augmentation reduces the likelihood that LLMs output memorized training data, compared to base prompts/noise prompts.
  • Summarization, especially abstractive summarization, can mitigate untargeted leakage but may have limited effect on targeted leakage.
  • Retrieval-document count (k) has a modest impact on leakage, with diminishing returns for higher k in targeted cases.
  • Post-retrieval defenses like reranking show limited effectiveness, while summarization offers practical privacy gains for untargeted leakage.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.