Addressing Corpus Knowledge Poisoning Attacks on RAG Using Sparse Attention

Sagie Dekel, Moshe Tennenholtz, Oren Kurland
2/4/2026
cs.IRcs.AI

No confident code implementation found for this paper.

Abstract

Retrieval Augmented Generation (RAG) is a highly effective paradigm for keeping LLM-based responses up-to-date and reducing the likelihood of hallucinations. Yet, RAG was recently shown to be quite vulnerable to corpus knowledge poisoning: an attacker injects misleading documents to the corpus to steer an LLM's output to an undesired response. We argue that the standard causal attention mechanism in LLMs enables harmful cross-document interactions, specifically in cases of attacks. Accordingly, we introduce a novel defense approach for RAG: Sparse Document Attention RAG (SDAG). This is a block-sparse attention mechanism that disallows cross-attention between retrieved documents. SDAG requires a minimal inference-time change to the attention mask; furthermore, no fine-tuning or additional architectural changes are needed. We present an empirical evaluation of LLM-based question answering (QA) with a variety of attack strategies on RAG. We show that our SDAG method substantially outperforms the standard causal attention mechanism in terms of attack success rate. We further demonstrate the clear merits of integrating SDAG with state-of-the-art RAG defense methods. Specifically, the integration results in performance that is statistically significantly better than the state-of-the-art.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{dekel2026addressing,
  title  = {Addressing Corpus Knowledge Poisoning Attacks on RAG Using Sparse Attention},
  author = {Sagie Dekel and Moshe Tennenholtz and Oren Kurland},
  year   = {2026},
  eprint = {2602.04711},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2602.04711v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2602.04711.svg)](https://codeofpaper.com/paper/2602.04711)

Discussion