Semantic Chameleon: Corpus-Dependent Poisoning Attacks and Defenses in RAG Systems
Scott Thornton · 2026 · 2 citationsRead the paper
Retrieval-Augmented Generation (RAG) systems extend large language models (LLMs) with external knowledge sources but introduce new attack surfaces through the retrieval pipeline. In particular, adversaries can poison retrieval corpora so that malicious documents are preferentially retrieved at inference time, enabling targeted manipulation of model outputs. We study gradient-guided corpus poisoning attacks against modern RAG pipelines and evaluate retrieval-layer defenses that require no modification to the underlying LLM. We implement dual-document poisoning attacks consisting of a sleeper document and a trigger document optimized using Greedy Coordinate Gradient (GCG). In a large-scale evaluation on the Security Stack Exchange corpus (67,941 documents) with 50 attack attempts, gradient-guided poisoning achieves a 38.0 percent co-retrieval rate under pure vector retrieval. We show that a simple architectural modification, hybrid retrieval combining BM25 and vector similarity, substantially mitigates this attack. Across all 50 attacks, hybrid retrieval reduces gradient-guided attack success from 38 percent to 0 percent without modifying the model or retraining the retriever. When attackers jointly optimize payloads for both sparse and dense retrieval signals, hybrid retrieval can be partially circumvented, achieving 20-44 percent success, but still significantly raises attack difficulty relative to vector-only retrieval. Evaluation across five LLM families (GPT-5.3, GPT-4o, Claude Sonnet 4.6, Llama 4, and GPT-4o-mini) shows attack success ranging from 46.7 percent to 93.3 percent. Cross-corpus evaluation on the FEVER Wikipedia dataset (25 attacks) yields 0 percent attack success across all retrieval configurations.
What the full text shows
Working prototype- Hybrid retrieval (BM25 + vector) completely eliminated gradient-guided poisoning attacks. — 0% success vs. 38% for pure vector retrieval (n=50 attacks on Security Stack Exchange corpus, top-5 retrieval)
- Joint sparse and dense optimization can partially bypass hybrid retrieval. — 20-44% success (n=25 trials on Security SE sample)
- Attack success varies significantly across LLM families, with open-weights models being more susceptible. — 46.7% (GPT-5.3) to 93.3% (Llama 4) (n=15 attack scenarios per model)
- General-domain corpora act as a natural defense due to vocabulary anomalies. — 0% attack success (n=25 attacks on FEVER Wikipedia dataset)
- Detection difficulty varies drastically based on the corpus domain. — 13-62x detection gap (Comparing Security SE vs. FEVER corpora)
- Setup
- Corpora included Security Stack Exchange (67,941 docs) and FEVER Wikipedia (96,561 docs). LLMs tested: GPT-5.3, GPT-4o, GPT-4o-mini, Claude Sonnet 4.6, and Llama 4.
- How
- The researchers implemented dual-document poisoning (sleeper and trigger documents) using Greedy Coordinate Gradient (GCG) optimization. They evaluated these attacks against pure vector and hybrid (BM25 + vector) retrieval systems across multiple LLMs and corpora.
- Limitations
- Black-box search methods (genetic algorithms, RL) were not tested. · GPT-5.3 was evaluated at temperature 1.0, while others were at 0.3. · Vendor case study was limited to 3 scenarios. · Retrieval quality impact of hybrid weighting (alpha <= 0.5) was not measured.
Summarized by Gemma 4 from the open-access full text · 12 Nov 2026. Read it