SMA: Who Said That? Auditing Membership Leakage in Semi-Black-box RAG Controlling

Shixuan Sun, Siyuan Liang, Ruoyu Chen, Jianjie Huang, Jingzhi Li, Xiaochun Cao · OpenReview

TL;DR

This paper introduces SMA, the first framework for auditing membership leakage in Retrieval-Augmented Generation (RAG) and Multimodal RAG (MRAG) systems. SMA goes beyond traditional membership inference by pinpointing where leaked content originates – from the model's pre-training data or external retrieval sources – enabling better privacy accountability.

What Problem Does This Paper Address?

Large Language Models (LLMs) augmented with retrieval mechanisms (RAG and MRAG) are powerful, but they obscure the origin of the information they use. When an LLM generates text, it's hard to tell if the information came from its core training data, documents it retrieved from an external database, or even images it processed (in MRAG). This lack of transparency makes it difficult to audit privacy risks, especially if sensitive data is inadvertently leaked. Existing membership inference attacks (MIAs) struggle with this because the retrieval process disrupts the stable input-output relationships they rely on, and multimodal fusion further complicates tracing information flow.

Methods

SMA tackles this challenge with a novel "Source-aware Membership Audit" approach operating in a semi-black-box setting. This means it doesn't need full access to the model's internals but can control whether the retrieval module is active.

Key techniques include:

  • Input Perturbation: SMA subtly modifies input text (e.g., synonym substitution, Unicode alterations) and images (e.g., adding Gaussian noise). The idea is that RAG systems are generally more robust to these perturbations than the core LLM.
  • Zero-Order Optimization & Ridge Regression: To estimate the influence of input tokens on the output without access to gradients, SMA uses a large-scale perturbation sampling strategy. It fits a ridge regression model to the observed input perturbations and output changes to derive attribution scores for each token.
  • Cross-Modal Attribution: For MRAG systems, SMA uses Multimodal Large Language Models (MLLMs) to translate image inputs into textual descriptions. This allows token-level attribution for image retrieval traces within the text modality.
  • Attribution Difference Score (ADS): By comparing model outputs with and without the retrieval module enabled, SMA calculates an ADS for critical words. This score quantifies how much the retrieval component influences the generation, helping to distinguish between "Retrieved Members" and "Pretrained Members."

Datasets

The paper uses several datasets for evaluation:

  • Textual RAG: ragbench and PubMedQA for RAG benchmarks.
  • MIA Comparison: WikiMIA and WikiMIA-24 datasets for comparison with existing MIA methods.
  • Multimodal RAG (MRAG): VL-MIA-image and Wikipedia image datasets for MRAG evaluation.

Key Insights and Ideas

  • Shifting the MIA Focus: The core innovation is moving from "whether data was memorized" to "where the content is sourced from." This is crucial for understanding and mitigating privacy risks in complex generative systems.
  • Perturbations as a Diagnostic Tool: The paper demonstrates that carefully chosen input perturbations can effectively differentiate between the LLM's internal knowledge and external retrieved content, even in a black-box setting.
  • Robustness of RAG: The experiments suggest that RAG systems, while improving accuracy, also exhibit a degree of robustness to input perturbations, which SMA leverages for attribution.
  • Cross-Modal Attribution is Feasible: SMA successfully extends membership inference to image retrieval in MRAG systems by translating visual information into a textual domain for analysis.

Key Results

  • Superior Performance: SMA significantly outperforms state-of-the-art black-box MIA baselines in detecting source-specific membership leakage.
  • Accuracy and Coverage Gains: SMA achieved notable improvements, with accuracy increasing by up to 15.74% and coverage by 10.01% under challenging conditions (noise and zero-gradient).
  • Effectiveness Across Models: The framework shows strong performance across various LLMs (LLaMA, Qwen) and embedding models.
  • MRAG Advantage: In MRAG scenarios, SMA achieved an ACC of 0.79, outperforming existing methods like VLMA (0.5983) and VLM_MIA (0.4985).
  • Noise Sensitivity: Moderate Gaussian noise applied to images in MRAG systems can enhance attribution accuracy, but excessive noise degrades performance.

Limitations and Future Work

  • Semi-Black-Box Constraints: SMA is limited by the LLM's maximum token limit and sampling temperature. High temperatures can lead to stochastic outputs, and restricted token windows can hinder perturbation analysis.
  • Computational Cost: The method requires multiple queries for attribution, leading to higher CPU and API usage and increased latency compared to white-box methods.
  • Future Directions: The authors suggest exploring optimizations like batched perturbations or early stopping criteria to reduce resource constraints. Integrating shadow models could also help mitigate operational costs and API usage. Further research could explore more advanced perturbation strategies and more efficient attribution mechanisms.

Summary updated

BibTeX
@misc{sun2025sma,
  author = {Shixuan Sun and Siyuan Liang and Ruoyu Chen and Jianjie Huang and Jingzhi Li and Xiaochun Cao},
  title = {{SMA: Who Said That? Auditing Membership Leakage in Semi-Black-box RAG Controlling}},
  year = {2025},
  eprint = {2508.09105},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.09105},
}
Figure