TL;DR
This paper introduces Mirabel, a novel method to detect and defend against Membership Inference Attacks (MIAs) in Retrieval-Augmented Generation (RAG) systems. By analyzing query-document similarity using a Gumbel distribution, Mirabel effectively identifies potentially sensitive queries and hides the corresponding documents from LLMs, safeguarding private data without significantly impacting utility.
What Problem Does This Paper Address?
Retrieval-Augmented Generation (RAG) systems enhance Large Language Models (LLMs) by retrieving information from external databases, improving accuracy and reducing hallucinations. However, this integration introduces a privacy vulnerability: Membership Inference Attacks (MIAs). MIAs aim to determine if a specific data point (like a document) was part of the training data used by the RAG system. While LLMs themselves are large and complex, RAG systems, which directly use retrieved documents, are more susceptible. Existing defenses are often insufficient, either breaking under stealth attacks or significantly degrading performance. This paper tackles the challenge of protecting the privacy of the external database in RAG systems against these increasingly sophisticated MIAs.
Methods
The core of the proposed solution, named Mirabel, lies in a similarity-based detection mechanism. The authors observed that MIA queries often exhibit unusually high similarity to a single document in the retrieved set. Mirabel leverages this by:
- Similarity Measurement: Calculating the cosine similarity between an input query and all documents in the external database.
- Gumbel Distribution Analysis: Modeling the distribution of these similarity scores, particularly focusing on the maximum similarity score. The Gumbel distribution is used to establish a statistically robust threshold for identifying outlier similarities.
- Detect-and-Hide Strategy: If a query's maximum similarity score exceeds the Gumbel-derived threshold, it's flagged as a potential member attack query. In such cases, the identified target document is "hidden" from the retrieval process before being passed to the LLM. This means the LLM receives the augmented context without the document that triggered the suspicion.
This approach is designed to be system-agnostic, requiring only access to similarity scores, a standard component of RAG systems.
Datasets
The paper evaluates its methods using several datasets:
- For Attack and Defense Evaluation: NFCorpus, SCIDOCS, and TREC-COVID. These corpora are drawn from the BEIR benchmark and represent sensitive scientific and medical domains.
- For Utility Evaluation: Natural Questions (NQ) and TriviaQA. These are question-answering benchmark datasets.
- Retriever Database: Wikipedia is used as the external database for the NQ and TriviaQA datasets.
Key Insights and Ideas
- Query Similarity as a Privacy Leakage Indicator: The key insight is that MIA queries often have a distinctively high similarity to a single document, acting as a "tell-tale sign" of an attack.
- Gumbel Distribution for Anomaly Detection: Applying extreme value theory and the Gumbel distribution provides a statistically sound way to set a threshold for identifying these outlier similarities, making the detection more robust.
- "Detect-and-Hide" for Practical Defense: Instead of complex cryptographic methods, a simple "detect-and-hide" strategy is surprisingly effective. By removing the suspected document, the system can confuse attackers and maintain data utility for benign users.
- System Agnosticism is Key: The method's reliance on similarity scores, a fundamental part of RAG, makes it easily adaptable to various RAG architectures without requiring deep model modifications.
Key Results
- Detection Performance: Mirabel demonstrates stable and reliable detection performance across various MIA methods, including stealthy IA attacks, outperforming agent-based detection in some cases. It achieves high recall, indicating it effectively identifies member queries.
- Defense Effectiveness: The detect-and-hide strategy significantly reduces attack accuracy, making it difficult for attackers to distinguish between member and non-member queries. The adjusted attack accuracy is substantially lowered, indicating a stronger defense.
- Utility Preservation: Mirabel largely avoids the utility degradation often seen with privacy-preserving methods like DP-RAG. While there's a slight decrease in retrieval quality (R@k), the answer quality (EM@k) remains comparable to standard RAG.
- Indistinguishability: The method achieves low KS statistics, indicating that the distributions of responses for member and non-member queries become indistinguishable after defense, a crucial aspect for preventing adaptive attacks.
- Runtime Overhead: The detect-and-hide approach introduces only marginal runtime overhead, especially on smaller datasets, making it practical for real-world deployment.
Limitations and Future Work
- Embedder Dependency: The effectiveness of Mirabel relies on the assumption that the embedder assigns high similarity to queries closely related to target documents. If an embedder assigns high similarity for other reasons (e.g., shared keywords like "COVID"), the defense performance might be limited, as observed with the TREC-COVID dataset and a different embedder.
- Threshold Adjustment: Future work should focus on carefully adjusting the threshold selection strategy and developing additional defense mechanisms that are robust across different embedders.
- Real-world Application Caution: While the method is ethically sound and offers practical guidance, caution is advised when applying it in real-world scenarios due to the embedder dependency.
The authors suggest that their method can be composed with existing DP models to further enhance defenses, demonstrating its compatibility and potential for building more robust RAG systems.
Summary updated