Addressing Corpus Knowledge Poisoning Attacks on RAG Using Sparse Attention
This paper introduces Sparse Document Attention RAG (SDAG), a novel defense mechanism that employs block-sparse attention to prevent harmful cross-document interactions in Retrieval Augmented Generation systems, thereby significantly mitigating corpus knowledge poisoning attacks and outperforming existing state-of-the-art defenses.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
In the modern landscape of artificial intelligence, large language models act as vast repositories of human knowledge, capable of answering questions and generating text with startling fluency. However, these models have a limitation: they are trained on data that stops at a certain point in time, meaning they cannot know about recent events or specific, niche facts without help. To solve this, researchers developed a system called Retrieval-Augmented Generation. In this setup, when a user asks a question, the system first searches a massive library of documents to find relevant information. It then feeds both the question and these retrieved documents into the language model, which uses them as a guide to craft an accurate answer. This method keeps the AI's knowledge fresh and reduces the chance of it making things up, a problem known as hallucination. Yet, this very reliance on external documents creates a new vulnerability. Because the system trusts the documents it finds, a malicious actor could secretly inject false information into the library. If the system retrieves these poisoned documents, it might be tricked into ignoring the truth and delivering a lie instead.
Researchers at the Technion in Israel have identified a specific weakness in how these systems process information that makes them susceptible to such deception. In standard language models, the mechanism that allows the AI to focus on different parts of a text is designed to let every word look back at every previous word in a continuous stream. This works well for writing a story or summarizing a single article, where context flows naturally from one sentence to the next. However, in a retrieval system, the input is often a collection of separate, distinct documents pasted together. The researchers argue that the standard method of processing these documents allows words from one document to interact with words from another in a way that can be harmful. When a malicious document is present, its misleading content can influence the AI's understanding of the truthful documents, effectively poisoning the entire response.
To address this, the team introduced a new defense strategy called Sparse Document Attention. Instead of allowing the AI to let every word in the retrieved set look at every other word, this method creates a strict boundary between the documents. It forces the system to treat each retrieved document as an isolated island. Within a single document, the words can still reference one another to maintain context, but they are completely blocked from looking at or being influenced by words in any of the other retrieved documents. This change is applied only when the system is generating an answer, requiring no retraining of the underlying AI model and no complex additions to the software pipeline. It is a simple adjustment to the rules of attention that prevents the harmful cross-talk between a liar and a truth-teller.
The researchers tested this approach rigorously across a variety of scenarios, using different question-answering datasets and multiple types of language models. They simulated attacks where an adversary injected misleading documents designed to steer the AI toward a specific, incorrect answer. In these tests, the standard system, which allowed documents to influence one another, frequently fell for the trick, often producing the attacker's desired false answer. In contrast, the system using the new sparse attention method proved far more resilient. It successfully ignored the poisoned documents in the vast majority of cases, maintaining the accuracy of its answers and drastically reducing the success rate of the attacks. The improvement was so significant that the new method outperformed existing, more complex defense strategies that had been developed to catch these attacks.
The study also explored how the position of a fake document affects the outcome. They found that when a deceptive document is very similar in content to the truthful ones, it is harder for the system to resist its influence. However, the new method remained effective even in these difficult situations. Furthermore, the researchers discovered that this defense works well even when the AI is asked to solve complex problems that require combining information from multiple documents, such as multi-step reasoning questions. While the initial setup showed a slight drop in performance compared to the standard method, the researchers found that a brief period of fine-tuning the model to the new rules completely recovered this loss, resulting in a system that was both robust against attacks and highly accurate.
The findings suggest that the way an AI looks at its source material is just as important as the material itself. By simply preventing different documents from talking to each other, the system becomes much harder to fool. This approach offers a practical and efficient way to secure retrieval-based AI systems, ensuring that they rely on the truth rather than being swayed by the most persuasive lie in the room. The work establishes a new standard for protecting these systems, showing that a fundamental change in how the model processes information can be more effective than adding layers of complex detection tools.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.