When Context Bites: Detecting RAG Poisoning via Document-Level Attention Collapse
Abstract
Domain fit: AI-adjacent · Paper appears method- or tooling-adjacent to AI workflows with partial ecosystem coverage.
Retrieval-augmented generation (RAG) is indispensable for enhancing large language models. However, RAGs are increasingly susceptible to poisoning attacks, in which adversarial documents are injected to manipulate generator outputs. Previous methods rely on output-side signals such as perplexity and consistency checks to detect such attacks. Nevertheless, our analysis reveals that deliberate attacks often induce false confidence, where poisoned outputs exhibit even lower perplexity than benign ones, rendering uncertainty-based detection ineffective. To address this challenge, we explore the internal dynamics of the generator and identify a distinctive signature termed \textit{Attention 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 propose \texttt{D-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-SCAN can detect attacks even when they fail to alter the final answer. Code is available at https://github.com/yingtaoren/D-Scan.git.
Results and benchmarks
Retrieval-augmented generation (RAG) is indispensable for enhancing large language models.
Benchmark evidence is limited
Evidence graph: 2 refs, 1 links.
Utility signals: depth 65/100, grounding 58/100, status medium.
Implementation
No direct implementation yet
Maintained implementation evidence is not confirmed for this paper yet.
Use the implementation status and reproduction sections for the current action plan.
No verified maintained repo yet
There is no verified maintained implementation yet. Use this baseline plan to decide whether to prototype now or defer.
- No direct maintained implementation was found. Use the paper PDF and citation graph to design a baseline reproduction.
- Start from related paper: RAGSieve: Self-Referenced Local Contrast for Knowledge-Poison Detection in Retrieval-Augmented Generation.
- Start from this likely method family: retrieval-augmented generation.
Time to first repro: a few days
Recommendation evidence is currently too limited for a maintained-repo choice. Use Implementation Status and Reproduction Path for a practical baseline plan.
- Estimate is based on paper-only reproduction flow
Reproduction readiness
No repo
No verified implementation available
- No maintained repository has been identified for this paper. Check adjacent implementations or HF artifacts below.
Hardware requirements
- Expect multi-day setup/compute for meaningful reproduction based on current guidance.
Validation caveat
Framework baselines
- Hugging Face Transformers training guide
Modern transformer training baseline.
- PyTorch nn.Transformer docs
Reference transformer building block implementation.
Hugging Face artifacts
No trustworthy direct or curated related Hugging Face artifacts were found yet. Use targeted searches to quickly locate candidate models, datasets, and demos.
Models
Tip: start with models, then check datasets and spaces if you need evaluation data or demos.
Research context
0
Citations
18
References
Tasks
Context (archaeology), Computer science, Poison control, Feature (linguistics), Psychology, attack detection, Physical Sciences
Methods
retrieval-augmented generation, attention collapse, attention entropy, large language models
Domains
Computer security, Artificial intelligence
Related papers
- RAGSieve: Self-Referenced Local Contrast for Knowledge-Poison Detection in Retrieval-Augmented GenerationSearch on Paper2Code
2026 · Semantic similarity
- Through the Stealth Lens: Attention-Aware Defenses Against Poisoning in RAGSearch on Paper2Code
2025 · Semantic similarity
- Tracing Target Answers in Poisoned Retrieval Corpora via Token Influence AttributionSearch on Paper2Code
2026 · Semantic similarity
- Traceback of Poisoning Attacks to Retrieval-Augmented GenerationSearch on Paper2Code
2025 · Semantic similarity
- CtrlRAG: Black-box Document Poisoning Attacks for Retrieval-Augmented Generation of Large Language ModelsSearch on Paper2Code
2025 · Semantic similarity
- Safeguarding RAG Pipelines with GMTP: A Gradient-based Masked Token Probability Method for Poisoned Document DetectionSearch on Paper2Code
2025 · Semantic similarity
Open this paper in HFEPX to review benchmark signals, evaluation modes, and human-feedback protocol context.
Open in HFEPXJump to Paper2Code search queries derived from this paper's research context.