When Context Bites: Detecting RAG Poisoning via Document-Level Attention Collapse
Summary
This paper proposes D-SCAN, a detection framework for RAG poisoning that monitors attention collapse dynamics in language model generations, showing effectiveness against adversarial attacks even when outputs appear benign.
View Cached Full Text
Cached at: 08/18/26, 03:51 AM
Paper page - When Context Bites: Detecting RAG Poisoning via Document-Level Attention Collapse
Source: https://huggingface.co/papers/2608.06947 Published on Aug 7
·
Submitted byhttps://huggingface.co/An998
an998on Aug 18
Abstract
D-SCAN detects retrieval poisoning by monitoring attention collapse dynamics in language model generations.
Retrieval-augmented generation(RAG) is indispensable for enhancing large language models. However, RAGs are increasingly susceptible topoisoning attacks, in which adversarial documents are injected to manipulate generator outputs. Previous methods rely on output-side signals such asperplexityand consistency checks to detect such attacks. Nevertheless, our analysis reveals that deliberate attacks often induce false confidence, where poisoned outputs exhibit even lowerperplexitythan benign ones, rendering uncertainty-based detection ineffective. To address this challenge, we explore the internal dynamics of the generator and identify a distinctive signature termedAttention Collapse. Unlike the dispersed attention in benign generations, attacked generations exhibit a decrease in entropy as attention concentrates on poisoned documents. Building on these findings, we proposeD-SCAN(Document-level Signal Collapse Analysis), a lightweight detection framework that monitors attention dynamics to identify attacked generations. Extensive experiments on multiple attack benchmarks demonstrate the effectiveness of our method. Moreover,D-SCANcan detect attacks even when they fail to alter the final answer. Code is available at https://github.com/yingtaoren/D-Scan.git.
View arXiv pageView PDFAdd to collection
Get this paper in your agent:
hf papers read 2608\.06947
Don’t have the latest CLI?curl \-LsSf https://hf\.co/cli/install\.sh \| bash
Models citing this paper0
No model linking this paper
Cite arxiv.org/abs/2608.06947 in a model README.md to link it from this page.
Datasets citing this paper0
No dataset linking this paper
Cite arxiv.org/abs/2608.06947 in a dataset README.md to link it from this page.
Spaces citing this paper0
No Space linking this paper
Cite arxiv.org/abs/2608.06947 in a Space README.md to link it from this page.
Collections including this paper0
No Collection including this paper
Add this paper to acollectionto link it from this page.
Similar Articles
@rohanpaul_ai: RAG poisoning can make a model more confident, which is exactly why confidence-based detectors can fail. This paper fin…
This paper reveals that RAG poisoning can artificially boost model confidence, evading traditional detection methods, and proposes monitoring attention distribution to detect such attacks.
RAGuard: A Layered Defense Framework for Retrieval-Augmented Generation Systems Against Data Poisoning
RAGuard is a layered defense framework for Retrieval-Augmented Generation (RAG) systems that uses adversarial fine-tuning of the retriever and a label-free filter (ZKIP) to achieve zero attack success against corpus poisoning, maintaining high retrieval accuracy.
Context Poisoning as Extreme-Value Attention Interference in Long-Context Language Models
This paper introduces 'context poisoning' as a phenomenon where attention interference degrades performance in long-context language models, deriving bounds showing evidence margin must scale with log of distractor count and proposing mitigations like evidence bottlenecks.
Beyond Document Grounding: Span-Level Hallucination Detection over Code, Tool Output, and Documents
This paper introduces a unified benchmark for span-level hallucination detection in RAG systems that extends beyond natural language to code, tool output, and structured documents, and presents a fine-tuned Qwen3.5-2B detector that outperforms existing methods on these new domains while remaining competitive on standard NLP benchmarks.
What happens when a RAG agent retrieves a poisoned document?
The article describes testing whether an AI agent using CrewAI and RAG respects user instructions when a retrieved document contains conflicting commands, as part of efforts to develop security test cases.