MEntA achieves RAG membership inference attack with 5 queriesFive Queries Are Enough: Query-Efficient and Surrogate-Free Membership Inference Attacks on RAG via Entailment
MEntA uses 5 non-template queries and no shadow model, achieving an AUC of 0.991 on SCIDOCS for Phi4-14B.
Black-box RAG: determine whether document D is in the retrieval library, submitting only non-template queries and observing only final text. Retrieval context, similarities, embeddings, logits, metadata, and parameters are not visible. Know the system uses retrieval but remain agnostic to specific implementation or defenses. Hold only D, not knowing other library contents. Query budget is limited, and consider that input/output modifications can weaken membership signals.
- RAG anchors answers to external or proprietary corpora, and outputs may reveal whether a document is in the retrieval library. The authors claim existing membership inference often relies on easily detectable templates or requires many non-template queries and shadow models.
- MEntA offline generates information-seeking questions covering parts of the document, prepends a summary, then queries the black-box RAG. Answers are split into atomic sentences, NLI determines if they are entailed by the candidate document, subtracts refusals, and averages to get a membership score.
- On three BEIR sets, four generators, with 5 queries, the authors claim the highest AUC in 11 of 12 groups, with Phi4-14B on SCIDOCS at 0.991. On NFCorpus, GPT-4 recall for MEntA is 0.061; on SCIDOCS, Mirabel's FPR on benign queries is 0.881.
- Appendix B states that short or generic documents cannot support diverse questions, and high similarity between non-members and library documents can cause false positives; overly long documents or atomic sentences reduce utility. The conclusion argues for document-level exposure control that remains effective with only 5–10 queries. Evaluation includes four generators, three BEIR sets, and input modification, DP, and two detectors in the paper.
- Evaluated models
- Phi4-14BLlama3.1-8BCommandR-7BGemma2-2Bsentence-transformers/all-mpnet-base-v2thenlper/gte-largeGPT-4Mirabel
- Benchmarks
- BEIRNFCorpusSCIDOCSTREC-COVIDSciFact
- Metrics
- AUCAccuracyTPR@FPRRecallFPR
Researchers propose MEntA (Membership Entailment Attack), a membership inference attack against RAG systems that determines whether a document is in the retrieval corpus by asking low-cost, broad information-seeking questions and measuring the natural language entailment relationship between the model's answer and the candidate document. The method requires no shadow model and no large number of queries, achieving up to 0.991 AUC on NFCorpus, SCIDOCS, and TREC-COVID with only 5 queries, outperforming previous methods by up to 0.42 AUC under the same conditions. MEntA remains effective under existing SOTA RAG defenses, while current detectors either miss it or produce high false positives on normal queries; under the same attack settings, its total attack cost is up to 65 times lower than the SOTA attack. This work has been accepted at USENIX Security 2026.
Related events and news
0 events · 1 news mentions
News that mentions this paper
- Adversa AIcites the paper's id or link2026 年 6 月 GenAI 安全资源盘点:越狱、CoT 攻击与百万级暴露服务
Five queries are enough: query-efficient and surrogate-free membership inference attacks on RAG via entailment
Paper analysis
What problem does this paper attempt to solve?
Is membership inference feasible on black-box RAG with few queries, no shadow model, and non-template queries?
On black-box RAG, can an attacker determine whether a document is in the retrieval library using only a few non-template queries and without a shadow model?
- Scenario: The authors claim institutions use RAG to anchor answers to proprietary corpora in healthcare, telecom, finance, etc., with users interacting only through natural language interfaces and knowledge sources not public. Confirming a medical record, contract, or internal compliance document is in the library could leak regulated information.
- Existing Methods: The authors claim many MIAs rely on fixed templates, easily detected by prompt injection detectors or weakened by other defenses; gray-box settings are impractical. IA uses natural conversation but often requires 30 or more queries per document and a shadow LLM for calibration; its binary answers perform poorly under output perturbation (Table 1, §4).
- Authors' Question: Can they launch limited-budget, surrogate-free, stealthy, defense-agnostic membership inference using non-template queries?
- This Paper Proposes: MEntA. Uses broad information-seeking questions and measures entailment between answers and candidate document, eliminating shadow LLM and large query budgets.
- Threat Model:
- Goal: Infer whether document D is in the retrieval library, obtaining member(D) ∈ {0, 1}. Via non-template queries.
- Knowledge: black-box. Only submit q and observe final text a(q). Retrieval context, similarities, embeddings, logits, backend metadata, and parameters are invisible. Know the system relies on retrieval but remain agnostic to dense or sparse, chunking, and defenses.
- Capability: Hold candidate document D, no other library contents. Query budget is limited to avoid cost alerts and rate limits; queries must be non-template.
- Victim System: RAG behind a natural language interface. Defenders can deploy input modification, DP, and input detection. Attacks must also consider that input/output modifications weaken membership signals.
What related research exists?
The paper situates itself in black-box, shadow-model-free, non-template, and few-query RAG membership inference.
RAG and Attack Surface
- Retrieval-Augmented Generation: Lewis et al. (2020) feed retrieved top-k evidence into the generator to reduce hallucination. The paper claims the interface of retriever, database, and generator expands the attack surface: injection can manipulate retrieval or generation, while membership inference only determines whether a document exists.
Black-box and gray-box Membership Inference
- Template-based Probing: S2-MIA, RAGLeak compare outputs with candidate text or truncated ground-truth; MBA uses recovery of masked segments as membership score. DCMI, RAG-MIA, Prompt-Injected, and The Good and The Bad directly ask to confirm document existence or paraphrase context. The paper in §4 claims the latter are templates, easily flagged by defenses.
- Natural Question Answering: IA uses natural language questions answerable only if the document is in the library. The paper claims it is more stealthy but requires many queries and relies on a shadow LLM; binary answers are not robust under output perturbation.
- gray-box: RAG-leaks calibrates with a reference RAG on the target distribution; SMA toggles retrieval to separate retrieval-driven tokens; BudgetLeak-Z manipulates maximum output tokens. The paper excludes these three from main comparisons due to gray-box requirements.
Defenses
- Input Modification: Includes query rewriting, reranking, and instruction prompting. The paper claims rewriting can break templates and fragile lexical overlap, reranking reduces repeated evidence, and instructions constrain verbatim leakage but depend on instruction following.
- Input Detection: The paper claims LLM classifiers are easy to deploy but can be bypassed by human-like non-template attacks. Mirabel flags abnormally high similarity to single indexed documents while controlling false positives on non-template queries.
- DP: Perturbs outputs to weaken membership evidence, balancing privacy gain and answer quality.
Contextual Grounding with NLI
- Related Techniques: FENICE splits outputs into atomic claims and checks strict entailment by retrieved context. CoPE measures output dependence on given evidence relative to internal priors. AlignScore evaluates semantic alignment of answers with source. The paper does not treat these as attack baselines.
Baselines and Benchmarks
- Main Experiments: Baselines are S2-MIA, MBA, DCMI black-box version, and IA; data are BEIR NFCorpus, SCIDOCS, TREC-COVID. Table 1 notes that 1-query template baselines are not directly comparable to MEntA's 5 non-template queries.
The authors position the paper in the cell of black-box, surrogate-free, non-template, 5 queries per document, and mark it as stealthy and defense-agnostic in Table 1. The difference from IA is that questions are information-seeking and scoring is entailment of atomic claims, not agreement with shadow model answers.
How does the paper address this problem?
MEntA uses information-seeking questions with NLI entailment hits to aggregate membership scores without a shadow model.
MEntA converts whether a document is in the library into whether atomic statements in the answer can be entailed by the candidate document. Figure 1 has four steps: offline question generation, querying black-box RAG, obtaining per-query signals via NLI, aggregating and selecting threshold. It borrows IA's summary prefix and refusal penalty, but does not use short binary questions, nor compare with shadow model answers.
Signal Selection
- Entailment rather than similarity: Authors argue that if D is a member, after retrieval, atomic statements in the generated result are more often logically entailed by D; if not, more often hallucinated or refused. NLI labels are entailment, neutral, contradiction.
- Decomposition of similarity: Authors do not treat cosine similarity as membership signal, and write it as true evidence term plus spurious correlation from domain overlap. For non-members, domain overlap can still be high; for members, if answered with paraphrase or summary, lexical overlap can be low.
- Contrast example: Figure 2: NFCorpus member document, Phi4-14B, cosine similarity 0.72, above the threshold 0.7 in text, entailment probability 0.24. Figure 3 caption states SUPPORT and CONTRADICT overlap heavily in similarity, entailment probability separates better. This check uses SciFact; similarity model is all-mpnet-base-v2, entailment model is tasksource/deberta-base-long-nli.
Query Generation
- Offline question generation: Questions are generated outside the target system; the attack loop itself only does black-box queries. Generate n different questions for D, requiring coverage of beginning, middle, and end, to check the whole document rather than a single fact. Generation prompt in Appendix A, sentence constraints not listed here.
- Summary prefix: Also generate a short summary; actual submission is concatenation of summary and question. Authors state this step comes from IA, summary used as denser retrieval key.
- Why few questions suffice: Authors use sequential probability ratio test to explain that under fixed error rate, required sample size is roughly inversely proportional to KL divergence per observation, and treat query specificity as proxy for information, written as n ∝ 1/DKL ∼ 1/L(q). Thus they believe increasing specificity can reduce query count. Evaluation default n=5 (§6.1).
Query and Scoring
- Interaction: System first retrieves context, then generates answer. Attack exploits answer's dependence on retrieved context: if D is retrieved, answer more likely contains specific facts from D.
- Refusal instruction: User-side prompt requires refusal when context insufficient. Appendix A's Figure 12 gives RAG prompt template, refusal original sentence not repeated here.
- Atomic sentences and NLI: Scoring uses tasksource/deberta-base-long-nli. Authors state need long context, document-level judgment, not short sentence-pair classification. Each answer is first split into atomic sentences.
- Score: A query is recorded as entailment hit if and only if at least one sentence's entailment probability is greater than the larger of neutral and contradiction probabilities. If an atomic sentence entails the refusal hypothesis in Appendix A, record refusal. Membership score is average over queries of the difference: MIA(D)=1/(|QD|)∑q∈ QD(Ient(q)−Iidk(q)). Higher score, authors believe more like member. Refusal term structure corresponds to IA's equation (5).
Threshold
- Operating point: τ is selected on held-out calibration set according to target metric (AUC operating point or balanced accuracy), then used on evaluation set. Above τ judged as member. Paper does not report calibration set size.
- Optimality: Theorem 1 treats each query's entailment hit as Bernoulli variable, assuming independence given membership or non-membership, and higher hit probability when member. Authors state, by Neyman–Pearson lemma, the strongest test under fixed false positive rate is equivalent to thresholding total hits.
What experiments did the paper conduct?
In Table 3 with 5 queries, the authors claim MEntA has the highest AUC in 11 of 12 groups, with a maximum of 0.991.
Experimental Setup
- Generator and Retrieval: Phi4-14B, Llama3.1-8B, CommandR-7B, Gemma2-2B. Default retriever is sentence-transformers/all-mpnet-base-v2, also tested thenlper/gte-large. Unless otherwise noted, Top-K=3.
- Data: BEIR's NFCorpus, SCIDOCS, TREC-COVID, each with 1,000 members and 1,000 non-members.
- Baselines: S2-MIA uses the first half of the document as query, score is BLEU with the original text. MBA uses the same model as the generator as proxy LM, with the number of recovered masked words as score. DCMI black-box version does yes/no, perturbation magnitude 0.06, original query plus perturbed query total 2 times. IA uses GPT-4o to generate queries, GPT-4o-mini as shadow LLM. RAG-leaks, SMA, BudgetLeak-Z not included due to gray-box.
- MEntA auxiliary models: GPT-4.1-nano generates queries and summaries; tasksource/deberta-base-long-nli does entailment. In Table 3, both IA and MEntA budgets are 5 per document; Table 1 writes IA's query count as 30.
- Metrics: AUC; accuracy takes the best member threshold on ROC-AUC; TPR@FPR, Table 3 reports 0.01 and 0.05. Authors state they value TPR at low FPR more. DCMI's these two columns are "–" in Table 3. Paper does not report repetitions for Table 3.
- Detection set: Each dataset, each attack has 1,000 benign queries and 1,000 attack queries (Appendix C.1). §6.7 and Table 7 write GPT-4 detector; Appendix C.2 writes that detector is GPT-4.1-nano. Mirabel's ρ=0.05.
Main Results
According to Table 3, budget 5, Top-K=3, retriever all-mpnet-base-v2, the table below is MEntA's AUC.
Swipe horizontally to read the table
Generator NFCorpus SCIDOCS TREC-COVID Phi4-14B 0.989 0.991 0.893 Llama3.1-8B 0.935 0.936 0.801 CommandR-7B 0.973 0.984 0.860 Gemma2-2B 0.836 0.799 0.757 - Authors' summary: Authors state 11 of 12 model–dataset configurations have highest AUC. Exception is TREC-COVID, Llama3.1-8B: IA's AUC is 0.847, MEntA is 0.801. On Gemma2-2B, MEntA's three AUCs are lower than the other three generators.
- Low FPR: In the same table, IA's TPR at FPR=0.01 is 0.000 in 11 of 12 cells, SCIDOCS, Gemma2-2B is 0.104. MEntA on SCIDOCS, Phi4-14B is 0.906. DCMI's TPR not reported.
- Abstract summary: Authors state up to 0.42 AUC higher than previous methods, and state higher than IA's 0.915. 0.915 and 0.991 are both SCIDOCS, Phi4-14B, 5 queries. 0.42 does not correspond to a single cell in the table. Some baselines below 0.5, e.g., S2-MIA's AUC on NFCorpus, CommandR-7B is 0.489.
Input and Output Modification Defenses
Table 6 is MEntA's AUC for Phi4-14B, 5 queries per document.
Swipe horizontally to read the table
Dataset None DP Rerank Prompt Inst. Paraphrase NFCorpus 0.989 0.913 0.975 0.984 0.977 SCIDOCS 0.991 0.916 0.986 0.992 0.953 TREC-COVID 0.893 0.836 0.904 0.908 0.846 - DP and IA: Authors state DP reduces MEntA but still maintains high AUC; IA drops up to 0.372 AUC. In Table 6, IA's DP column is NFCorpus 0.518, SCIDOCS 0.543, TREC-COVID 0.487, corresponding None is 0.756, 0.915, 0.816.
- Two inconsistencies with main text: Authors state Prompt Instruction even improves MEntA on NFCorpus; that cell is 0.984, None is 0.989. SCIDOCS's Prompt Inst. is 0.992, TREC-COVID is 0.908. Introduction states Phi4-14B's AUC is approximately 0.90 across all datasets and defenses; in Table 6, TREC-COVID's DP is 0.836, Paraphrase is 0.846.
- DCMI: Authors state it remains lower than MEntA under most defenses. Counterexamples are SCIDOCS's DP: DCMI 0.943, MEntA 0.916; TREC-COVID's DP: DCMI 0.889, MEntA 0.836. TREC-COVID's Paraphrase both are 0.846.
Input Detection
MEntA query recall per Table 7, benign query FPR per Table 8. Detector name in tables is GPT-4.
Swipe horizontally to read the table
Dataset GPT-4 recall Mirabel recall GPT-4 benign FPR Mirabel benign FPR NFCorpus 0.061 0.738 0.033 0.596 SCIDOCS 0.263 0.991 0.151 0.881 TREC-COVID 0.058 0.454 0.076 0.518 - Two detectors: Authors state GPT-4 rarely flags MEntA as attack, while MBA's recall on NFCorpus is 0.910. Abstract writes recall on MEntA is 6̃%; Table 7's SCIDOCS is 0.263. Authors state Mirabel can detect various attacks including MEntA, but operating point is aggressive.
- False positive example: Authors give example, 1 million queries per day, FPR 0.881 would flag over 880,000 legitimate requests. Authors believe follow-up questions on same topic also produce similarity spikes, and state Mirabel's FPR is lower on NQ and TriviaQA, those data do not have document-clustered questions. Table 1 still labels MEntA as Stealthy.
Query Budget and Cost
- Budget curve: Figure 8's main text does not give curve endpoint AUC. Authors state MEntA saturates within about 5–10 queries on NFCorpus, IA needs larger budget to reach peak; 1-query MBA, S2-MIA and 2-query DCMI consistently below MEntA.
- USD cost: Table 4 at each optimal budget: IA 30, MEntA 5. IA includes each shadow call plus black-box call (output at 10 tokens); MEntA is black-box call (output at 100 tokens) plus DeBERTa-NLI. Gemma2-2B price approximated as half of Gemma-3-4B.
Swipe horizontally to read the table
Generator IA per attack MEntA per attack IA/MEntA Phi4-14B 3.37e-3 2.21e-4 15.24 CommandR-7B 3.04e-3 1.70e-4 17.87 Llama3.1-8B 2.74e-3 6.62e-5 41.37 Gemma2-2B 2.57e-3 3.95e-5 65.06 - Two phrasings of 65×: Contribution list writes token cost reduced up to 65×; abstract writes total cost reduced up to 65× under same attack setting. Table 4's 65.06 is USD total cost ratio at optimal budget, not same query count.
Other Ablations and Analyses
- Entailment vs similarity (Figure 4, NFCorpus, four generators, Top-k=3, 5 query variants, similarity threshold 0.7): Main text does not give AUC; authors state entailment higher.
- Minimum entailment sentences (Figure 6, Phi4-14B): Main text does not give AUC per threshold; authors state roughly stable, default at least 1 sentence.
- Query strategy (Figure 7, Llama3.1-8B, Top-k=3): Document-specific questions higher than generalized topic questions by 0.109–0.214 AUC. Without retrieval, AUC is NFCorpus 0.493, SCIDOCS 0.524, TREC-COVID 0.483.
- Retriever (Table 5, Llama3.1-8B, average of 5 query variants): all-mpnet-base-v2 vs gte-large AUC is NFCorpus 0.935 vs 0.931, SCIDOCS 0.936 vs 0.939, TREC-COVID 0.801 vs 0.796.
- Top-k (Figure 9, Llama3.1-8B, 5 queries, k is 3, 5, 10, 20): Authors state stable across datasets, SCIDOCS approximately 0.94. Main text does not give specific AUC for other k.
- Score distribution (Figure 5, Phi4-14B, Top-k=3, 5 query variants): Figure caption states member scores mostly positive, non-member mostly negative, small overlap near threshold. Authors state remaining overlap mainly in tails. Main text does not give density values.
What are some points that can be further explored?
Appendix B describes failure modes such as short documents, highly similar non-members, and overly long inputs, with conclusions pointing to document-level control.
Limitations and Future Directions Noted by Authors
- Short or Generic Documents: Appendix B states that when documents are too short or too generic, they cannot support diverse, document-specific questions. The authors view this as a common failure mode for IA and MEntA, attributed to retrieval and generation under natural queries, not the scoring function itself.
- High-Similarity Non-members: Appendix B states false positives occur when non-member documents have high similarity to indexed documents.
- Overly Long Inputs: Appendix B states utility decreases when candidate documents or extracted atomic sentences are too long. The same section writes that Split-and-rephrase can split long documents into shorter paragraphs and long claims into shorter units.
- Document-Level Control: The conclusion calls for document-level, privacy-aware controls limiting cumulative exposure, and defenses effective when attacks use only 5–10 queries.
- Session-Level Monitoring: Appendix D suggests combining document-level exposure control with monitoring of semantically related iterative queries within a session; when the same document is repeatedly retrieved in a short window, strengthen authentication or temporarily refuse, and use shorter, more abstract answers. Extending Mirabel to within-session semantic overlap, the authors claim this is not a complete solution.
Experimental Coverage
- Generators are Phi4-14B, Llama3.1-8B, CommandR-7B, Gemma2-2B; retrievers are sentence-transformers/all-mpnet-base-v2 and thenlper/gte-large (§6.1, Table 5).
- Main data are BEIR NFCorpus, SCIDOCS, TREC-COVID, each with 1,000 members and 1,000 non-members. SciFact is used only for similarity and entailment comparisons in §5.2.
- Defense settings include DP (ε=0.1), random shuffle reranking, instruction defense, query rewriting, and the paper's GPT-4 detector and Mirabel (ρ=0.05) (§6.7, Appendix C.2).
- Main results use a query budget of 5 per document. Figure 8 varies query count; Table 4 compares IA's 30 queries with MEntA's 5. Top-k is 3, 5, 10, 20 on Llama3.1-8B (Figure 9).
- The paper explicitly excludes gray-box RAG-leaks, SMA, BudgetLeak-Z. The paper does not report repetitions for Table 3 or calibration set size. Detection query sets are 1,000 benign and 1,000 attack queries per dataset and per attack (Appendix C.1).
Summarize the main content of the paper
MEntA performs membership inference on black-box RAG with 5 non-template queries and entailment scoring, without a shadow model.
MEntA is membership inference on black-box RAG: based only on final text answers, determine whether a held candidate document is in the retrieval library, without using a shadow model.
The difficulty to address is that template queries are easily detected by input detection, while natural question-answering IA requires many queries and a shadow LLM, and binary answers are easily disrupted by output perturbation.
The approach is to offline generate information-seeking questions covering parts of the document, prepend a summary, then submit; split answers into atomic sentences, use NLI to record entailment by the candidate document, subtract refusals, and average over queries. Threshold is selected on a held-out calibration set.
- Table 3 (5 queries, Top-K=3, all-mpnet-base-v2): across four generators and three datasets totaling 12 groups, the authors claim the highest AUC in 11. SCIDOCS, Phi4-14B AUC is 0.991, TPR@FPR=0.01 is 0.906. Exception is TREC-COVID, Llama3.1-8B, where IA is 0.847 and MEntA is 0.801.
- Table 6: On Phi4-14B, NFCorpus, MEntA AUC after DP is 0.913. The authors claim IA drops up to 0.372 AUC under DP.
- Table 4: When IA uses 30 queries and MEntA uses 5, the total cost ratio on Gemma2-2B is 65.06. The abstract also claims up to 65× lower under the same attack settings.
- Tables 7–8: GPT-4 recall for MEntA is 0.061 on NFCorpus and 0.263 on SCIDOCS; Mirabel's FPR on SCIDOCS benign queries is 0.881.
The authors conclude that black-box membership inference with small query budgets is feasible; query rewriting and instruction constraints reduce but do not eliminate document-specific evidence, and detection is difficult to deploy without high false positives. Therefore, document-level controls limiting cumulative exposure and defenses effective when attacks use only 5–10 queries are needed.