GRADA: Graph-based Reranker against Adversarial Documents Attack

Jingjie Zheng, Aryo Pradipta Gema, Giwon Hong, Xuanli He, Pasquale Minervini, Youcheng Sun, Qiongkai Xu · DOI

Abstract

Retrieval-Augmented Generation (RAG) systems are increasingly used to ground Large Language Models (LLMs) in factual data. However, they are vulnerable to adversarial document injections where "poisoned" documents are engineered to appear highly relevant to user queries while containing false information. We introduce GRADA (Graph-based Reranking against Adversarial Document Attacks), a novel framework that leverages inter-document relationships to filter out these malicious outliers. By treating retrieved documents as nodes in a similarity graph and using a PageRank-inspired iterative scoring mechanism, GRADA effectively distinguishes between cohesive benign documents and isolated adversarial ones. Our evaluation shows that GRADA reduces Attack Success Rates (ASR) by up to 80% on standard benchmarks like Natural Questions and MS-MARCO.

The Vulnerability of RAG Systems

While RAG enhances LLM accuracy, it introduces a significant security vector: Adversarial Document Attacks. Attackers can inject documents into a corpus that are specifically designed to exploit the retrieval stage. These documents often mimic the user's query perfectly to ensure a high ranking by standard retrievers (like BGE or HLATR), but they deliver malicious payloads or misinformation.

An illustration of an adversarial RAG attack where a poisoned document claiming Elon Musk is the CEO of Apple is retrieved due to high query similarity.

Current rerankers prioritize relevance above all else. Consequently, they often inadvertently promote these adversarial documents to the top of the results because they appear "perfectly relevant" to the query, even if they contradict the broader consensus of the knowledge base.

The GRADA Framework

GRADA shifts the defensive focus from simple query-document similarity to inter-document relationships. The core intuition is that legitimate documents about a specific topic naturally share vocabulary and context, forming a "densely connected subgraph." In contrast, adversarial documents are typically "loners" that lack semantic coherence with the rest of the corpus.

Methodology

The GRADA pipeline consists of several key stages:

  1. Expanded Retrieval: The system retrieves a larger set of documents ($M \ge 2n$) than finally needed to ensure a sufficient buffer of benign documents is present for graph analysis.
  2. Graph Construction: Each retrieved document is treated as a node in a weighted, undirected graph.
  3. Hybrid Relevance Similarity (HRSIM): This is the framework's primary innovation. HRSIM measures the similarity between documents while applying a penalty based on their individual similarity to the query. This breaks the "collusion" between an attacker's document and the retrieval algorithm; if two documents are highly similar to the query but not to each other, they are flagged as potential adversarial outliers.
  4. Iterative Reranking: Using a PageRank-style approach, scores are propagated through the graph. Benign documents reinforce each other's scores through their shared context, while isolated adversarial documents see their rankings drop.
  5. Filtering: Only the top $n$ documents from the refined ranking are passed to the LLM for final generation.

Experimental Results

GRADA was evaluated across three major benchmarks—Natural Questions (NQ), MS-MARCO, and HotpotQA—using six different LLMs (including GPT-4o and Llama-3.1).

  • Attack Mitigation: On the NQ dataset, GRADA reduced the Attack Success Rate (ASR) by up to 80% compared to undefended systems. Against specific "Phantom" attacks on GPT-3.5, GRADA brought the ASR down to 0% in multiple scenarios.
  • Efficiency: Unlike defenses that require expensive LLM-based inspection of every document, GRADA's graph operations are computationally efficient ($O(N^2)$ relative to the small number of retrieved documents), making it suitable for real-time applications.

Discussion and Limitations

While highly effective for single-hop queries, GRADA faces challenges with multi-hop reasoning tasks like HotpotQA. In these cases, benign documents are naturally more disparate, weakening the "clustering" effect that GRADA relies on. Additionally, the framework assumes that poisoned documents are a minority in the retrieved set. Future research will explore adaptive attacks where adversaries might attempt to inject "clusters" of colluding documents to bypass graph-based defenses.

Summary updated

BibTeX
@misc{zheng2025grada,
  author = {Jingjie Zheng and Aryo Pradipta Gema and Giwon Hong and Xuanli He and Pasquale Minervini and Youcheng Sun and Qiongkai Xu},
  title = {{GRADA: Graph-based Reranker against Adversarial Documents Attack}},
  year = {2025},
  eprint = {2505.07546},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.07546},
}
Figure