A Stress Test of RAG Retrieval Reliability Under Query-Relevant Corpus PoisoningReliability Stress Testing of RAG Retrieval under Query-Relevant Corpus Poisoning
The authors stress-test the RAG retrieval layer: on two BEIR datasets, 5 query-targeted poisoned documents per query lower classic retriever nDCG@10 by 40.2–61.5%.
The attacker can publish indexed documents to the corpus but cannot modify the base queries, clean documents, relevance judgments, retriever parameters or k. Pressure axes: per-target poisoned document budget P∈{1,3,5}, query information (from no query words to the full query), and contamination scope (from a single target to all targets).
- In a RAG system, external text enters the model context only after the retriever admits it; the authors stress-test this admission stage: whether query-targeted poisoned documents published by an attacker can enter the top-k and displace legitimate evidence.
- On BEIR SciFact/NFCorpus, independently vary document content, attacker query information, per-target poison document budget P, and contamination scope; use BM25/LSA/Hybrid and BGE-small to measure exposure and ranking utility, and evaluate two admission controls: overlap filtering and MMR.
- Under isolated P=5, classic retriever nDCG@10 drops by 40.2–61.5%, and SafeR drops to near 0; BM25 degradation is mainly explained by query anchoring; under BGE-small with query-only P=5, target exposure reaches 100% on both datasets; overlap filtering can remove full-query poisoned documents but harms clean retrieval, and MMR does not change exposure.
- The authors state that the study stops at the retrieval layer, that exposure does not equal downstream attack success; that the pressure conditions are transparent rather than stealthily optimized; that the high-IDF condition assumes access to clean-corpus statistics; that pretrained validation is limited to one BGE model and three core conditions; and that BEIR qrels are incomplete.
- Evaluated models
- BM25LSAHybridBAAI/bge-small-en-v1.5
- Benchmarks
- BEIR SciFactBEIR NFCorpusBIPIA payloads
- Metrics
- nDCG@10Recall@10Target Exposure@10Any Poison Exposure@10Evidence AvailabilitySafe Retrieval Reliability@10latency
Researchers conducted a stress test of the retrieval admission stage of RAG systems under query-relevant corpus poisoning, finding that query anchoring is the dominant factor in poisoning exposure for the retrievers tested. On 623 BEIR queries from SciFact and NFCorpus, 5 query-targeted documents per query reduced classic retriever nDCG@10 by 40.2-61.5% under isolated target stress; pretrained BGE-small reached 100% target exposure on both datasets with query-term-only poisoning (P=5), and after adding injection payloads SciFact nDCG changed only from 0.269 to 0.271, while NFCorpus exposure dropped slightly to 98.8%. Query length changes the interpretation of partial-information attacks: on 162 long SciFact queries, two random words covering 19.9% of eligible words still produced 39.5% Hybrid target exposure. Overlap-based admission can remove full-query poisoning but may substantially reduce clean retrieval utility, and MMR did not change exposure under the tested configurations; the study measures retrieval-layer failure rather than downstream instruction following.
Related events and news
1 events · 1 news mentions
News that mentions this paper
大模型安全周报:智能体安全边界在签名、授权与上下文
- 公众号 大模型安全研究cites the paper's id or link大模型安全周报:智能体的安全边界在签名、授权与上下文三层防线里
Reliability Stress Testing of RAG Retrieval under Query-Relevant Corpus Poisoning(https://arxiv.org/abs/2611.04264)
Paper analysis
What problem does this paper attempt to solve?
Stress-testing the RAG retrieval admission stage: the extent to which query-targeted poisoned documents enter the top-k and displace legitimate evidence.
Core question: to what extent does the RAG retriever place query-targeted poisoned documents published by an attacker into the top-k, thereby displacing legitimate evidence.
- Setting and importance: RAG systems first select evidence from an external corpus and then pass it to a language model; some indexed documents may be controlled by third parties; the authors note that poisoned documents can affect the model only after the retriever admits them, so retrieval admission is the key boundary.
- Gaps in existing work: The authors state that prior work mainly studies knowledge corruption, retrieval blocking, optimized triggers, and downstream effects of indirect prompt injection; query information, per-target budget, and contamination scope are often implicit in a single attack-strength setting, making retrieval-layer effects hard to distinguish.
- Core observation: External text affects RAG only after the retriever admits it; query anchoring, appended content, and contamination scope may each independently change retrieval results and need to be measured separately.
- Paper proposes: A retrieval-layer stress-testing framework that independently varies document content, attacker query information, per-target poison budget P∈{1,3,5}, and contamination scope; on BEIR SciFact/NFCorpus it measures exposure, evidence retention, and ranking utility, and evaluates two admission controls; it explicitly does not evaluate downstream instruction following.
- Threat model:
- Goal: Get attacker-controlled documents into the top-k context of target queries, replacing legitimate evidence.
- Knowledge: Graded from no query words, two/four query words (random or high-IDF), to the full query; high-IDF is an informed/oracle-like condition because IDF is computed from the clean corpus.
- Capability: Can publish indexed content; cannot modify benchmark queries, clean documents, relevance labels, retriever parameters, or k.
- Victim system: The RAG retrieval layer using BM25, LSA, Hybrid, and BGE-small retrievers (Figure 1).
What related research exists?
Related work falls into three groups: indirect injection, retrieval poisoning/blocking, and reliability defenses; the authors state that this paper turns query information and contamination scope into explicit stress axes.
Indirect prompt injection
- BIPIA [5]—benchmarks indirect prompt injection and related defenses; this paper borrows its four categories of text attack payloads as standardized appended content, but the measurement endpoint is retrieval admission rather than downstream instruction following.
- InjecAgent [6]—extends indirect injection to tool-integrated agents; the paper notes that these studies evaluate downstream instruction following.
Retrieval poisoning and blocking
- PoisonedRAG [2]—a knowledge corruption attack that jointly optimizes retrieval and generation objectives.
- AgentPoison [7]—attacks agent memory and RAG knowledge bases with optimized triggers.
- Machine Against the RAG [3] and Chang et al. [4]—the former shows retrieval disruption can occur without relying on instruction semantics; the latter characterizes retrieval barriers and optimizes triggers across modern embedding models; the paper notes that this paper directly varies query information, per-target budget, and contamination scope to measure their retrieval effects separately.
Reliability and admission defenses
- ReliabilityRAG [8]—uses document reliability signals to provide corruption defenses and robustness guarantees.
- MMR [13]—diversity reranking, used in this paper as an admission/reranking comparison.
Baselines and benchmarks: Retrieval baselines are BM25 [10], 64-dimensional LSA [11], and Hybrid with RRF fusion [12]; external validation uses pretrained BGE-small [14]; benchmarks are SciFact and NFCorpus from BEIR [9], with payloads taken from BIPIA [5].
Positioning: The authors state that the closest prior work mainly studies downstream attack effects or optimized retrieval disruption, whereas this paper sets query information and contamination scope as explicit stress axes and reports poison exposure, retained evidence, and ranking utility together.
How does the paper address this problem?
Build a retrieval-layer stress test: inject poisoned documents along four axes—content, query information, budget, and contamination scope—measure exposure and utility, and evaluate two admission controls.
The overall idea is to isolate the retrieval admission stage of RAG and stress-test it (Figure 1): after attacker documents enter a fixed corpus, independently vary content, query knowledge and contamination scope, and measure exposure and utility, without evaluating downstream generation.
Problem setup and formalization
- Let D be the clean corpus, q the base query, Rq its judged-relevant documents, and Aq(P) the P poisoned documents targeting q; for a contamination target set G, the poisoned corpus is
A=\bigcup_{q\in G} A_q(P), and Tk(q)=TopK(q, D∪ A), i.e., retrieval is performed over the merged corpus. - Three pressure axes: per-target budget P∈{1,3,5}; contamination scope from a single target to all evaluated targets; query information from no query words, to two/four words, to the full query.
- Eligible words are unique lowercase alphanumeric tokens of length at least 3 after stopword removal, restricted to the clean BM25 vocabulary; when there are too few, all eligible words are used, and the actual proportion of words revealed is reported.
Content and information conditions
- Content controls: query-only (contains only the target query), query+payload (with a BIPIA payload appended), fixed-neutral (benign filler of equal length), corpus-derived neutral (5 clean-corpus segments per target with zero BM25 score against the query, truncated to the payload length).
- Payload source: deterministically sampled with seed 2026 from the four categories of text attacks in BIPIA (Base Encoding, Reverse Text, Emoji Substitution, Language Translation).
- Information conditions: payload-only with no query words; the two/four-word conditions use deterministic random words or the highest-IDF words; full-query uses the complete query; random word selection uses a fixed query-level SHA-256 seed.
Retrievers and metrics
- Retrievers: BM25; 64-dimensional LSA; Hybrid (RRF constant 60, fusing the top 100 each of BM25 and LSA, keeping 50 candidates and then taking the top-10); external validation uses the pretrained 33M-parameter BAAI/bge-small-en-v1.5 (normalized embeddings, cosine similarity, no task-specific training).
- Frozen statistics: in the isolated experiments, LSA is fitted once on the clean corpus, and BM25's vocabulary, IDF and average document length are all fixed on the clean corpus; poisoned documents are scored under the frozen statistics.
- Core metrics: target exposure Eq = 1[T10(q) ∩ Aq(P) ≠ ∅] (whether the top-10 contains a poisoned document targeting that query); also Any Poison Exposure, evidence availability Hq, Safe Retrieval Reliability Sq (the strict conjunction of evidence being present and no poisoned document being admitted), nDCG@10, Recall@10, and the four-state decomposition.
Admission control and statistics
- MMR: reranks over the same 50-candidate pool with λ=0.7, taking the highest-relevance candidate first and then trading off normalized relevance against LSA vector redundancy.
- Overlap admission control: uses IDF-weighted unique query word coverage C(q,d) and rejects candidates with C(q,d)≥τ, τ∈{0.25,0.40,0.55,0.70,0.85,0.95}; it scans down the 50-candidate list until 10 pass or the pool is exhausted, explicitly reports the proportion of queries with fewer than ten candidates, and reports the full frontier rather than the threshold that is best on the test set.
- Statistics and latency: metrics are computed per query; nonparametric bootstrap 95% confidence intervals use the query as the resampling unit; latency is measured with 500 repetitions per retriever/defense pair at P=5, reporting absolute median and P95 milliseconds.
- Let D be the clean corpus, q the base query, Rq its judged-relevant documents, and Aq(P) the P poisoned documents targeting q; for a contamination target set G, the poisoned corpus is
What experiments did the paper conduct?
isolated P=5 lowers classic retriever nDCG@10 by 40.2–61.5%, with SafeR near 0; BGE-small query-only exposure reaches 100%; overlap filtering harms clean utility, and MMR does not reduce exposure.
Experimental setup
- Retrievers tested: BM25, 64-dimensional LSA, Hybrid (RRF), with pretrained BAAI/bge-small-en-v1.5 for external validation.
- Datasets: the BEIR test sets SciFact (5,183 documents, 300 judged queries) and NFCorpus (3,633 documents, 323 judged queries), 623 queries in total; payloads are taken from the four categories of text attacks in BIPIA.
- Conditions: at isolated P=5, 5 targeted documents account for 0.10% of SciFact and 0.14% of NFCorpus; multi-target P=5 produces 1,500 SciFact poisoned documents (22.45%) and 1,615 NFCorpus poisoned documents (30.77%).
- Metrics: nDCG@10, Recall@10, Target/Any Poison Exposure@10, Evidence Availability, Safe Retrieval Reliability@10 (the strict conjunction of evidence being present and zero poisoned documents), top-10 poisoned document count, latency (500 repetitions per pair, median and P95).
- Statistics: computed per query, with bootstrap 95% CI using the query as the resampling unit, and paired interval comparisons of query+payload against query-only and corpus-neutral.
- Success criterion: the endpoint is retrieval admission—a poisoned document entering the top-10 counts as exposure; generated answers are not evaluated.
Main results
According to Table II (query+payload condition):
Swipe horizontally to read the table
Data Retriever Condition nDCG TargetExp SafeR SciFact BM25 Clean / Isolated / Multi .662 / .255 / .188 .000 / 1.000 / 1.000 .800 / .000 / .000 SciFact LSA Clean / Isolated / Multi .295 / .119 / .085 .000 / 1.000 / 1.000 .453 / .000 / .000 SciFact Hybrid Clean / Isolated / Multi .465 / .183 / .138 .000 / 1.000 / 1.000 .663 / .000 / .000 NFCorpus BM25 Clean / Isolated / Multi .308 / .181 / .153 .000 / .876 / .972 .678 / .037 / .022 NFCorpus LSA Clean / Isolated / Multi .221 / .131 / .091 .000 / .824 / .805 .563 / .071 / .022 NFCorpus Hybrid Clean / Isolated / Multi .267 / .160 / .138 .000 / .910 / 1.000 .622 / .006 / .000 - The authors state that under isolated P=5 the five targeted documents account for only 0.10–0.14% of the corpus, yet they lower Hybrid nDCG on SciFact from 0.465 to 0.183 and on NFCorpus from 0.267 to 0.160, with SafeR dropping to 0 and 0.006 respectively; the abstract reports a 40.2–61.5% drop in nDCG@10 for classical retrievers.
- The authors emphasize that the small global proportion must be read together with strong per-query targeting: this condition measures concentrated query-aware contamination, not random corruption at the same proportion.
- Budget sweep (Table III): on SciFact, Hybrid target exposure is already 1.0 at P=1, and increasing P mainly displaces evidence; on NFCorpus, as P goes from 1 to 5, nDCG drops from 0.230 to 0.160 and exposure goes from 0.889 to 0.910.
RQ1: Content controls (Figure 2, Table I)
- What was measured: the effect of four kinds of content—query-only, fixed-neutral, corpus-neutral and payload—on nDCG and exposure under isolated P=5.
- Results: on SciFact, the nDCG of query-only and query+payload is the same for BM25, differs by +0.0014 for LSA and by +0.0003 for Hybrid; on NFCorpus, the difference of payload minus query-only is +0.0039 for BM25, +0.0450 for LSA and +0.0382 for Hybrid. Relative to corpus-neutral, the BM25 difference is 0 (SciFact) and −0.0004 (NFCorpus), and the LSA/Hybrid differences are negative with intervals excluding zero.
- Authors' interpretation: the BM25 degradation is almost entirely explained by query anchoring; LSA and Hybrid are more sensitive to appended text, but the effect is an appended-content effect rather than a payload-specific retrieval mechanism.
RQ2: Query information and contamination scope (Figure 3, Table V)
- What was measured: the effect of attacker query information (no words, two/four random or high-IDF words, full query) and multi-target contamination on Hybrid exposure.
- Results: NFCorpus has on average only 2.48 eligible words, and 57.6% of queries are fully covered by the two-word budget and 90.7% by four words; on the 162 long SciFact queries with at least 8 eligible words, two random words reveal on average 19.9% of eligible words yet still produce 39.5% target exposure, and four words reveal 39.7% and produce 89.5% exposure. Under multi-target P=5, NFCorpus LSA target exposure is 0.805 while any-poison exposure is 0.966, with an average of 7.23 poisoned documents in the top-10.
- Authors' interpretation: the results support sensitivity to partial query information on long queries, while exposing the confound of short NFCorpus queries; high-IDF anchoring is an informed/oracle-like condition, not a capability the attacker necessarily has.
Pretrained dense retrieval validation (Table VI)
- What was measured: repeating the isolated P=5 clean/query-only/query+payload comparison with BGE-small.
- Results: query-only reaches 100% target exposure on both datasets; after adding payload, SciFact nDCG goes from 0.269 to 0.271 with exposure staying at 1.000, and NFCorpus nDCG goes from 0.137 to 0.205 with exposure slightly dropping to 0.988.
- Authors' interpretation: this generalizes high query-targeted admission to a pretrained dense retriever, while again distinguishing retrieval relevance from malicious payload semantics.
RQ3: The cost of admission control (Figure 4)
- Overlap filtering: under full-query Hybrid pressure, τ=0.95 clears target exposure on both datasets; on SciFact both attack and clean nDCG are 0.440 (unfiltered clean 0.465), on NFCorpus attack is 0.138 and clean is 0.134 (unfiltered clean 0.267), and 3.4–4.0% of queries have fewer than ten candidates. The four-word condition is harder to filter selectively: at τ=0.40 target exposure drops to 5.3% on SciFact and 0.3% on NFCorpus, but clean nDCG drops to 0.082 and 0.065; at τ=0.95 clean nDCG returns to 0.440/0.134 while four-word exposure rises to 78.0%/22.3%.
- MMR: under isolated full-query P=5 Hybrid, target exposure stays at SciFact 1.000 and NFCorpus 0.910, nDCG changes from 0.183 to 0.234 and from 0.160 to 0.164, SafeR stays at 0 and 0.006, and median latency increases by about 1.5 ms.
- Authors' interpretation: stronger lexical rejection lowers exposure but also removes legitimate evidence, with large differences in cost between the two datasets; MMR changes ranking utility but does not constitute an admission barrier.
Other ablations and analyses
- Four-state decomposition (Table IV): on SciFact, 54.7% of queries have evidence and poisoned documents coexisting, and 0% have evidence and no poison; on NFCorpus, 54.5% coexist and 0.6% have evidence and no poison—SafeR is zero because every attacked query admitted poisoned documents.
- Four-word exposure (Table V): on all 300 SciFact queries, two-word coverage is 27.8% with 50.7% exposure, and four-word coverage is 55.3% with 94.0% exposure; on NFCorpus, two-word coverage is 80.5% with 84.8% exposure.
- Negative result: the authors state that the overlap sweep has no stable cross-dataset operating point—the threshold that strongly suppresses poison causes a large clean-task cost on NFCorpus; clearing full-query poisoned documents at τ=0.95 is the attack matching the rule, and is not by itself evidence of a broadly effective detector.
What are some points that can be further explored?
The authors list limitations such as the retrieval-layer boundary, transparent pressure conditions and single-model validation; the experiments cover two BEIR datasets, four retrievers and two types of admission control.
Limitations and future directions noted by the authors
- Stops at the retrieval layer (Limitations): exposure is not equivalent to downstream attack success.
- Pressure conditions are transparent (Limitations): the query-aware pressure conditions are transparent, not stealthy or optimized; the isolated low-proportion experiment still grants strong per-target targeting.
- Neutral controls are not perfectly matched (Limitations): corpus-derived neutral segments do not perfectly match the payload in word frequency, topic and semantics; the analysis attributes the effect to query anchoring and the identity of the appended content, not to the malicious meaning itself.
- Short queries are hard to interpret (Limitations): the fixed two/four-word budget is hard to interpret on short queries, so the long-query analysis is reported separately.
- The high-IDF assumption is too strong (Limitations): the high-IDF condition assumes access to clean-corpus statistics.
- Narrow validation scope (Limitations): pretrained validation is limited to one compact BGE model and three core conditions; larger embedding models, alternative dense retrievers and production-grade vector search stacks are out of scope; BEIR qrels are incomplete, and evidence availability and SafeR inherit the incompleteness of the judgments; the threshold curves are a measurement frontier, not deployment recommendations.
Experimental coverage
- The retrievers tested are BM25, 64-dimensional LSA, Hybrid (RRF) and pretrained BGE-small, four in total, of which BGE-small runs only the three conditions clean/query-only/query+payload (Methodology, Table VI).
- The datasets are BEIR SciFact (300 queries) and NFCorpus (323 queries), and the payloads are taken from the four categories of text attacks in BIPIA (Experimental Design).
- Defense evaluation includes two kinds: IDF-overlap admission control (six τ thresholds) and MMR reranking (λ=0.7) (Methodology).
- Statistics are per-query metrics plus query-level bootstrap 95% CI; latency is measured with 500 repetitions per retriever/defense pair (Methodology).
- The paper does not report attack success rates at the downstream generation level, nor does it report human evaluation (the measurement endpoint is retrieval candidates).
Summarize the main content of the paper
RAG retrieval-layer stress test: a small number of query-targeted poisoned documents can enter the top-k and displace evidence; query anchoring is the main cause, and existing admission controls have varying costs.
A paper on reliability stress testing of the RAG retrieval layer, measuring whether query-targeted documents published by an attacker can enter the top-k context; it explicitly does not evaluate downstream instruction following.
- Problem: External text affects RAG only if the retriever admits it; prior work mostly focused on downstream attack effects, making the retrieval effects of query information, poison budget, and contamination scope hard to distinguish.
- Method: On BEIR SciFact/NFCorpus (623 queries total), independently vary document content (query-only/payload/two types of neutral controls), attacker query information (no words to full query), per-target budget P∈{1,3,5}, and contamination scope; use BM25, LSA, Hybrid, and pretrained BGE-small to measure exposure, evidence retention, and nDCG@10, and evaluate overlap filtering and MMR.
- Result one: isolated P=5 (only 0.10–0.14% of the corpus) lowers classic retriever nDCG@10 by 40.2–61.5%; SciFact Hybrid SafeR drops from 0.663 to 0 (Table II).
- Result two: BM25 degradation is almost entirely explained by query anchoring; appended text also shifts LSA/Hybrid rankings, but the authors state this is an appended-content effect rather than a payload-specific mechanism (Table I).
- Result three: Under BGE-small with query-only P=5, target exposure reaches 100% on both datasets; after adding payload, SciFact nDCG changes only from 0.269 to 0.271 (Table VI).
- Result four: On 162 long SciFact queries, two random words (revealing 19.9% of eligible words on average) still produce 39.5% Hybrid exposure; NFCorpus queries are short, and a two-word budget already covers 57.6% of queries (Table V).
- Result five: Overlap filtering at τ=0.95 can remove full-query exposure, but NFCorpus clean nDCG drops from 0.267 to 0.134; MMR does not change exposure (Figure 4).
- Authors' conclusion: Retrieval-layer failure is dominated by query anchoring; partial query information suffices to maintain exposure; admission control involves a dataset-dependent trade-off between reducing exposure and preserving clean utility; these are retrieval-stage findings, not estimates of downstream attack success rate.