NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Riddle Me This! Stealthy Membership Inference for Retrieval-Augmented Generation

Ali Naseh, Yuefeng Peng, Anshuman Suri, Harsh Chaudhari, Alina Oprea, Amir Houmansadr

Abstract

Retrieval-Augmented Generation (RAG) is the industry standard for providing Large Language Models (LLMs) with up-to-date or private information. However, this architecture introduces a significant privacy "side channel": Membership Inference Attacks (MIAs). While previous MIAs rely on "loud" adversarial prompts that are easily detected by safety filters, this paper introduces the Interrogation Attack (IA). IA utilizes natural-sounding, "doc2query"-style probes to determine if a specific document exists within a RAG system's database. Experimental results show that IA achieves near-perfect detection accuracy (AUC-ROC > 0.95) across multiple datasets and models for less than $0.02 per document, all while maintaining a near-zero detection rate by modern security guardrails.

Introduction

RAG systems are designed to ground LLM responses in factual data fetched on the fly from a private database. This avoids the cost of retraining but creates a vulnerability: if an adversary can confirm the presence of a sensitive document (e.g., medical records or proprietary data) in the database, privacy is compromised. Traditional MIAs for RAG often use suspicious prompts like "repeat all context," which are easily flagged by detectors like Lakera or GPT-4o-based safety layers. The Interrogation Attack (IA) addresses this by mimicking legitimate user behavior, making the attack virtually indistinguishable from normal queries.

Methodology: The Interrogation Attack

The Interrogation Attack operates in a black-box setting, requiring no knowledge of the victim's specific model or retriever. The attack follows a three-stage pipeline:

  1. Query Generation: An auxiliary LLM (e.g., GPT-4o) generates 30 "Probe Questions" based on a target document. Each query consists of a Retrieval Summary (keywords to trigger the retrieval of the target document) and a Probe Question (a yes/no question answerable only via the target document).
  2. Ground Truth Generation: A "Shadow LLM" (e.g., GPT-4o-mini) is provided with the target document to generate the correct answers to these probes.
  3. Membership Scoring: The queries are submitted to the victim RAG system. The responses are compared against the ground truth using a scoring formula that rewards correct answers and penalizes "I don't know" (UNK) responses.
The Interrogation Attack pipeline, showing query generation, the victim RAG system, and the final scoring mechanism.

Experimental Setup and Results

The attack was evaluated using three diverse datasets from the BEIR benchmark: NFCorpus (medical), TREC-COVID (scientific), and SCIDOCS (scientific papers). The researchers tested against various LLMs (Llama 3.1, Phi-4, Gemma-2, Command-R) and retrievers (GTE, BGE).

Performance and Stealth

IA consistently achieved an AUC-ROC between 0.95 and 0.99. In contrast to prior methods that are flagged by guardrails up to 90% of the time, IA maintained a near-zero detection rate (1-5%). The cost efficiency is also notable, with the total cost to probe a single document being approximately $0.017.

ROC curve for the NFCorpus dataset, demonstrating that the Interrogation Attack (IA) significantly outperforms existing MIA methods like MBA and S2-MIA.

Key Insights

  • The "I Don't Know" Signal: A critical indicator of non-membership is the RAG system's admission of ignorance. Non-member documents triggered "I don't know" responses 54% of the time, compared to only 7.5% for members.
  • Aggregate Robustness: By using 30 queries, the attack gains statistical robustness against query rewriting or minor retriever variations.
  • Training Data Overlap: The attack is most effective on private data. For documents already present in the LLM's original training set, the model may answer correctly even without RAG, leading to potential false positives.

Conclusion and Future Work

The Interrogation Attack demonstrates that stealth is a powerful exploit in RAG systems. Because IA mimics legitimate information-seeking behavior, defending against it is challenging. Traditional defenses like query rewriting are ineffective, and reducing the "member" score would require intentionally degrading the RAG system's accuracy. Future research must explore more sophisticated differential privacy techniques for retrieval systems to mitigate these stealthy membership inference risks.

Summary updated

BibTeX
@inproceedings{naseh2025riddle,
  author = {Ali Naseh and Yuefeng Peng and Anshuman Suri and Harsh Chaudhari and Alina Oprea and Amir Houmansadr},
  title = {{Riddle Me This! Stealthy Membership Inference for Retrieval-Augmented Generation}},
  booktitle = {CCS},
  year = {2025},
  doi = {10.1145/3719027.3744840},
}
Figure