Mitigating the Privacy Issues in Retrieval-Augmented Generation (RAG) via Pure Synthetic Data

Shenglai Zeng, Jiankun Zhang, Pengfei He, Jie Ren, Tianqi Zheng, Hanqing Lu, Han Xu, Hui Liu, Yue Xing, Jiliang Tang

Abstract

Shenglai Zeng, Jiankun Zhang, Pengfei He, Jie Ren, Tianqi Zheng, Hanqing Lu, Han Xu, Hui Liu, Yue Xing, Jiliang Tang. Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing.

2025.

Retrieval-Augmented Generation (RAG) is a powerful tool for grounding Large Language Models (LLMs), but it introduces significant privacy risks when retrieved documents contain sensitive information. This paper presents SAGE (Synthetic Attribute-based Generation with agEnt-based refinement), a framework designed to replace private retrieval databases with "pure" synthetic versions. SAGE preserves the original data's utility while reducing the success rate of data extraction attacks to nearly zero.

Introduction

RAG systems enhance LLM performance by fetching relevant documents from external databases. However, if these databases contain private emails, medical records, or personally identifiable information (PII), the system becomes vulnerable to "extraction attacks." In such attacks, malicious prompts are used to trick the LLM into leaking source text. Traditional mitigation strategies, such as simple anonymization or retrieval thresholds, often fail because sensitive information can still be inferred from context. SAGE addresses this "privacy-utility trade-off" by decoupling the knowledge in the database from its original verbatim phrasing.

The SAGE Framework

The SAGE pipeline consists of two primary stages designed to create a safe surrogate dataset for RAG.

Stage 1: Attribute-based Generation

Rather than paraphrasing documents, SAGE uses an LLM to identify "essential attributes" of the data. For instance, in a medical context, attributes might include "symptoms," "medical history," and "doctor's advice." SAGE extracts these key points and then employs a different LLM to generate a brand-new document based only on those points. This process breaks the verbatim link to the original text while maintaining the underlying knowledge.

Stage 2: Agent-based Iterative Refinement

Even synthetic data can inadvertently leak PII or contain "linkage risks"—details that could identify an individual when combined. SAGE employs a "Privacy Agent" and a "Rewriting Agent" in a feedback loop. The Privacy Agent inspects synthetic outputs for risks and provides feedback to the Rewriting Agent to scrub the data. This iterative process continues until the Privacy Agent classifies the data as "safe."

The two-stage SAGE framework: Stage 1 focuses on attribute-based generation to break verbatim links, while Stage 2 uses an iterative agent-based loop to refine privacy.

Experimental Evaluation

The researchers evaluated SAGE using several benchmarks:

  • HealthcareMagic: 200,000 doctor-patient dialogues representing high-stakes sensitive data.
  • Wiki-PII: A custom dataset where public Wikitext-103 was "poisoned" with real PII from the Enron Mail dataset.
  • ODQA Benchmarks: Standard Open-Domain Question Answering sets (Natural Questions, TriviaQA, WebQuestions) to ensure general utility.

Key Results

SAGE demonstrates a superior balance between privacy and utility compared to traditional methods.

Privacy Protection

In targeted attacks on the Wiki-PII dataset, the number of successful leaks dropped from 167 (using original data) to zero using SAGE. The iterative refinement in Stage 2 is critical for this result; while Stage 1 reduces leakage, only the agent-based feedback loop consistently eliminates it across different retrieval settings.

Impact of SAGE stages on privacy leakage. Stage 2 refinement effectively reduces the leaked 'Target Info' to zero across various retrieval counts (k).

Utility Preservation

Surprisingly, synthetic data can outperform original data in RAG tasks. On the HealthcareMagic dataset, SAGE achieved a ROUGE-L score of 0.0943, surpassing the 0.0789 score obtained with raw data. This is attributed to the "purity" of synthetic data, which strips away conversational noise and focuses on the facts necessary for answering queries.

Conclusion

SAGE provides a practical, cost-effective solution for securing RAG systems. By transforming private data into a pure synthetic surrogate, it mitigates the risk of verbatim extraction attacks without sacrificing performance. Future work will explore extending this attribute-to-synthetic pipeline to multi-modal data and specialized domains requiring deep expertise.

Summary updated

BibTeX
@inproceedings{zeng2025mitigating,
  author = {Shenglai Zeng and Jiankun Zhang and Pengfei He and Jie Ren and Tianqi Zheng and Hanqing Lu and Han Xu and Hui Liu and Yue Xing and Jiliang Tang},
  title = {{Mitigating the Privacy Issues in Retrieval-Augmented Generation (RAG) via Pure Synthetic Data}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
  doi = {10.18653/v1/2025.emnlp-main.1247},
}
Figure