When Poison Meets Structure: Topology-based Defense against Poisoning Attack on Graph-based Retrieval-Augmented Generation

Qizhi Chen, Junhao Wen, Shuang Liang, Jiakai Li, Yizhuo Ma, Rongzheng Wang, Ke QinNeurIPS 2026

TL;DR

Forging a single lie is easy, but fabricating an entire interconnected web of supporting history is expensive. This paper reveals that when attackers poison Graph-based Retrieval-Augmented Generation (GraphRAG) systems under realistic budgets, their fake facts inevitably form sparse, star-shaped graph structures rather than dense, natural webs. By training a lightweight, plug-and-play discriminator to spot this geometric giveaway, the authors filter out poisoned knowledge without relying on brittle text analysis or costly LLM fact-checking.

What Problem Does This Paper Address?

Retrieval-Augmented Generation (RAG) grounds Large Language Models (LLMs) in external data, and GraphRAG takes this further by organizing that data into a Knowledge Graph (KG)—mapping entities as nodes and relationships as edges to excel at complex, multi-hop reasoning. However, if an attacker slips malicious text into public data sources, GraphRAG will dutifully weave those lies right into its graph.

Standard RAG defenses fall flat here for two main reasons:

  1. Lost surface cues: Attackers often stuff target queries into fake passages to game retrieval rankings. Standard defenses spot this abnormal text similarity. GraphRAG, however, shreds original sentences during extraction to build nodes and edges, erasing the linguistic fingerprints while preserving the poisoned facts.
  2. Prohibitive LLM verification: Asking an LLM to cross-examine retrieved facts for logical contradictions scales quadratically in cost as retrieval size grows—and fails when multi-hop clues are scattered across non-contradictory fragments.

We need a defense native to the structure of graphs, not sentences.

Methods

The authors introduce TDP (Topology-based Defense against Poisoning Attack on GraphRAG), a two-stage purification pipeline inserted during retrieval.

Figure 1: Overall framework of TDP. LGA-DPO identifies conflicts by exploiting the separability of contradictory content in semantic space. The conflict subgraphs are then scored for credibility based on GNN-based Topology-Responsive Prompting (TRP). The poisoned subgraph is filtered out, and evidence from the clean subgraph is fed into the generator LLM to produce the final answer.
  1. Conflict Identification (LGA-DPO): When a poisoned GraphRAG retrieves evidence, it returns both clean and poisoned facts over 82% of the time. Because these groups support mutually exclusive answers, they naturally drift apart in an LLM’s semantic representation space. Using Latent Geometry-Aligning Direct Preference Optimization (LGA-DPO), the authors fine-tune a small LLM (e.g., Qwen3-8B) to cleanly slice the retrieved evidence into two competing camps ($C'$ and $C''$) by maximizing distance between group centroids while keeping each group internally compact.
  2. Topological Scoring (TRP): Next, TDP re-retrieves the surrounding KG neighborhoods for both camps, yielding two subgraphs ($G'$ and $G''$). To tell which is truthful, they introduce Topology-Responsive Prompting (TRP). Rather than retraining a Graph Neural Network (GNN) from scratch, TRP freezes a pretrained GNN encoder and learns just a tiny shared prompt vector added to node features, plus a linear scoring head. Trained via pairwise ranking, TRP compares the two subgraphs head-to-head, discards the lower-scoring (poisoned) subgraph, and hands the winner to the generator LLM.

Datasets

No new benchmarks were introduced, though the setup highlights zero-shot transferability:

  • Pretraining: TDP is trained exclusively on HotpotQA (general Wikipedia QA).
  • Zero-shot Evaluation: Without any retraining, TDP is transferred and evaluated on 2WikiMultihopQA (large-scale Wikipedia QA), MuSiQue (complex multi-hop reasoning), and PubMedQA (biomedical domain literature).

Key Insights and Ideas

  • The Geometry of a Lie (Game-Theoretic Equilibrium): Why do poisoned subgraphs look different? Attackers operate under strict injection budgets (flooding a source triggers spam filters). Modeling this as a budget-allocation game, the authors show that forging query-facing entities (direct answers) yields high retrieval payoff cheaply, whereas forging background entities requires building closed cycles (measured via the graph's cyclomatic number) to create cross-validation, costing far more text. Rational attackers therefore skip the background lore. The result: truthful knowledge forms a dense mesh, while poisoned knowledge forms a star-like hub-and-spoke pattern.
Topological differences: poisoned subgraphs exhibit higher max node degrees and fewer connected subgraphs than clean ones, betraying a star-like structure.
  • Domain-Agnostic Transferability: Because TDP learns topological patterns born from attacker economics rather than dataset-specific vocabulary, a defense trained on general trivia (HotpotQA) seamlessly protects biomedical literature (PubMedQA) as a plug-and-play module.

Key Results

Evaluated across two frameworks (GraphRAG and HippoRAG) against strong graph-specific attacks like GRAG-Poison:

  • Crushing Attack Success: On 2WikiMultihopQA (under GraphRAG), TDP slashes the Attack Success Rate (ASR) from an undefended 72.0% down to 27.0%, handily beating text- and conflict-based baselines like RAGuard (68.2%), FaithfulRAG (64.5%), and ReliabilityRAG (53.3%).
  • Preserving Utility: Many defenses block attacks by accidentally throwing out good data. TDP achieves 65.5% overall answer accuracy (vs. 23.7%–27.5% for baselines) and retains 88.3% of the correct answers the unpoisoned system would have gotten right.
  • Low Overhead: TDP adds < 5 seconds and 814 tokens per query—roughly 3x to 4x faster and far cheaper in tokens than LLM-verification baselines like FaithfulRAG (18.3s, 3,728 tokens). Fine-tuning an 8B model with LGA-DPO also reaches 82.1% conflict-grouping accuracy, outperforming zero-shot GPT-4o (72.8%).

Limitations and Future Work

While the paper does not include a dedicated limitations section, two operational boundaries emerge from the experiments and threat model:

  • Bottleneck at Stage 1: TRP relies on LGA-DPO cleanly separating conflicting evidence first; if poisoned items are left out or split across both groups, TRP cannot catch them (an oracle conflict-splitter drops ASR further from 27.0% to 18.3%).
  • Retrieval Extremes: TDP assumes mixed retrieval. In roughly 6.4% of cases, retrieval returns only poisoned evidence without clean counter-evidence to form a competing pair, and retrieving too few items (low top-$k$) makes the pipeline more vulnerable.

Summary updated

Abstract

Poisoning attacks against GraphRAG focus on knowledge pollution at the node and community levels, but conventional poisoning defenses mainly rely on sentence-level semantic features, which makes them less effective against such attacks. To address this issue, we analyze the poisoning strategy from a game-theoretic perspective and find that attackers prioritize fabricating query-related facts while ignoring supporting background knowledge, which in turn induces a systematic topological discrepancy between poisoned and clean subgraphs. Based on this insight, we propose the lightweight **T**opology-based **D**efense against **P**oisoning Attack on GraphRAG (TDP). TDP constructs a pair of conflicting candidate subgraphs from the retrieved evidence and trains a pairwise topology-ranking discriminator to distinguish clean evidence with dense cross-validation from poisoned evidence with sparse structural support, thereby removing poisoned subgraphs. Notably, the topological patterns captured by TDP reflect structural preferences induced by the poisoning game rather than dataset-specific distributional biases, allowing it to be transferred as a plug-and-play module after pretraining without end-to-end retraining. To the best of our knowledge, this is the first systematic work on poisoning defense for GraphRAG, and experiments show that TDP achieves state-of-the-art defense performance across multiple benchmarks and poisoning attacks, demonstrating strong generalization.
BibTeX
@inproceedings{chen2026when,
  author = {Qizhi Chen and Junhao Wen and Shuang Liang and Jiakai Li and Yizhuo Ma and Rongzheng Wang and Ke Qin},
  title = {{When Poison Meets Structure: Topology-based Defense against Poisoning Attack on Graph-based Retrieval-Augmented Generation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=TirVWlIdjG},
}
Figure