Five Poisoned Documents Cut RAG Retrieval nDCG by 40%: A Stress Test
RAG retrieval is highly vulnerable to query-targeted corpus poisoning—five documents per query can already cause large ranking losses—so defenses must measure both poison exposure and clean-evidence retention, not just filtering rate.
On this page
A team holding a batch of third-party pages must decide whether to index them as-is, but 5 query-targeted documents per query can already cut top-10 ranking quality by 40.2–61.5% across 623 test queries. The usual advice is that corpus poisoning needs scale and optimization, and that five documents at 0.10–0.14% of the corpus cannot matter; the other default is that filtering documents with high query-term overlap will keep poison out. The paper [1] stress-tests both assumptions at the retrieval admission step. It does not optimize an attack or measure generated answers; it measures which documents the retriever puts into the top 10.
The Default Judgment: Five Poisoned Documents Are Too Small to Matter
The target is the common belief that small, unoptimized poison sets are noise. In the isolated-target regime, five documents per query are only 0.10% of SciFact and 0.14% of NFCorpus, yet the paper reports a 40.2–61.5% nDCG@10 drop for classical retrievers. nDCG@10 is a ranking-quality score that rewards relevant documents near the top of the first 10 results. Hybrid, which fuses keyword and semantic rankings, falls from 0.465 to 0.183 on SciFact and from 0.267 to 0.160 on NFCorpus. The key qualifier is 'query-targeted': each poison is written for one query. The result is concentrated contamination, not random corruption at the same corpus fraction.
How the Stress Test Is Built: 623 Queries, Three Retrievers, Four Axes
The test bed uses the BEIR test splits of SciFact (5,183 documents, 300 judged queries) and NFCorpus (3,633 documents, 323 judged queries), 623 queries in total. BEIR is a public information-retrieval benchmark collection with human relevance labels. Three classical retrievers are used: BM25, a keyword-matching scorer that weights rare terms; 64-dimensional LSA, which maps terms and documents into a low-dimensional semantic space; and Hybrid, reciprocal-rank fusion with constant 60 over the top 100 BM25 and LSA candidates, keeping 50 before the final top 10. External validation uses the 33M-parameter BGE-small bi-encoder without task-specific training. Two metrics matter beyond nDCG@10 and Recall@10: target exposure@10 asks whether any poison written for that query appears in the top 10; safe retrieval reliability@10 requires at least one relevant evidence document and zero poison in the top 10. Table 1 gives the isolated P=5 core numbers.
| Dataset | Retriever | Clean nDCG@10 | Isolated P=5 nDCG@10 | Target exposure | Safe reliability |
|---|---|---|---|---|---|
| SciFact | BM25 | .662 | .255 | 1.000 | .000 |
| SciFact | Hybrid | .465 | .183 | 1.000 | .000 |
| NFCorpus | BM25 | .308 | .181 | .876 | .037 |
| NFCorpus | Hybrid | .267 | .160 | .910 | .006 |
Result 1: BM25 Is Dominated by Query Anchoring; LSA and Hybrid Also React to Appended Text
RQ1 asks what makes a poisoned document retrievable. The content controls are query-only, query plus a BIPIA payload, fixed neutral filler, and corpus-derived neutral text. BIPIA is an indirect prompt-injection benchmark; here its text is only standardized appended content. On BM25, query-only and query+payload nDCG are identical on SciFact and differ by +0.0039 on NFCorpus; against corpus-neutral text the differences are 0 and -0.0004 with a 95% CI of [-0.0013, 0.0000]. For BM25, query anchoring explains nearly all degradation. LSA and Hybrid are more sensitive: on NFCorpus, payload minus query-only is +0.0450 and +0.0382, while payload minus corpus-neutral is -0.0370 and -0.0367 with intervals excluding zero. NFCorpus target exposure is 13.3 and 3.4 percentage points higher under payload than under corpus-neutral text. The identity of appended text can shift semantic rankings even with the same query anchor.
Result 2: From P=1 to P=5 and From One Target to All Targets, the Failure Mode Changes
Budget and scope change the failure mode. For Hybrid in isolation on SciFact, P=1 already gives nDCG 0.328, target exposure 1.000, and safe reliability 0; P=5 lowers nDCG to 0.183 while exposure stays 1.000, so extra poison mainly displaces evidence. On NFCorpus, P=1 to P=5 moves nDCG from 0.230 to 0.160 and exposure only from 0.889 to 0.910. Multi-target contamination is different: at P=5, all targets contribute, producing 1,500 SciFact poisons (22.45%) and 1,615 NFCorpus poisons (30.77%). For NFCorpus LSA, target exposure is 0.805 but any-poison exposure is 0.966 and the mean top-10 poison count is 7.23, so per-target exposure misses cross-target interference. The four-state split shows 54.7% of SciFact queries keep evidence and poison together, making strict safe reliability zero; NFCorpus has 54.5% evidence-plus-poison and only 0.6% evidence-plus-no-poison. Query length adds another caveat: on 162 long SciFact queries, two random terms cover 19.9% of eligible terms and still yield 39.5% Hybrid target exposure. BGE-small reaches 100% target exposure for query-only P=5 on both datasets; adding the payload changes SciFact nDCG only from 0.269 to 0.271 and lowers NFCorpus exposure to 98.8%.
Result 3: Filtering Poison Costs Clean Evidence, and MMR Does Not Help
RQ3 measures the trade-off in admission control. The paper uses IDF-weighted unique query-term coverage C(q,d) and rejects candidates with C(q,d) at or above thresholds from 0.25 to 0.95; filtering scans the ranked 50-candidate list until ten pass or the pool is exhausted, and shortages are reported. IDF means inverse document frequency, so rarer query terms carry more weight. The rule can remove full-query poisons, but clean documents with high query-term coverage can also be rejected, and clean retrieval utility may fall sharply. The paper reports the full frontier rather than a test-set-optimal threshold. MMR, a diversity reranker with lambda=0.7, leaves exposure unchanged in this configuration.
Boundaries: What This Stress Test Does Not Measure, and When It Fails
The method fails when the question is downstream instruction following: the paper measures retrieval-layer admission, not whether a generator obeys a poisoned passage. It does not apply when results are extrapolated to random corruption at the same corpus fraction, because the isolated P=5 condition is concentrated query-targeted contamination. It is out of scope for multi-stage industrial stacks with strong cross-encoder reranking or pre-index source vetting, and for attack frequencies beyond the stress assumptions. The long-query finding comes from 162 SciFact queries; BGE-small is one 33M model; MMR is one lambda=0.7 setting; admission thresholds span 0.25–0.95. Safe retrieval reliability is a strict conjunction, not a deployment safety probability. What travels well is the protocol: freeze clean-corpus statistics, vary content, query information, budget, and scope, and report exposure and evidence retention together.
