Through the Stealth Lens: Attention-Aware Defenses Against Poisoning in RAG

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Choudhary, Sarthak, Palumbo, Nils, Hooda, Ashish, Dvijotham, Krishnamurthy Dj, Jha, Somesh
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914589038346240
author Choudhary, Sarthak
Palumbo, Nils
Hooda, Ashish
Dvijotham, Krishnamurthy Dj
Jha, Somesh
author_facet Choudhary, Sarthak
Palumbo, Nils
Hooda, Ashish
Dvijotham, Krishnamurthy Dj
Jha, Somesh
contents Retrieval-augmented generation (RAG) systems are vulnerable to attacks that inject poisoned passages into the retrieved context, even at low corruption rates. We show that existing attacks are not designed to be stealthy, allowing reliable detection and mitigation. We formalize a distinguishability-based security game to quantify stealth for such attacks. If a few poisoned passages control the response, they must bias the inference process more than the benign ones, inherently compromising stealth. This motivates analyzing intermediate signals of LLMs, such as attention weights, to approximate the influence of different passages on the response. Leveraging attention weights, we introduce the $\textbf{Normalized Passage Attention Score}$ (NPAS) and a lightweight $\textbf{Attention-Variance Filter}$ (AV Filter) that flags anomalous passages. Our method improves robustness, yielding up to $\sim$ $\textbf{20%}$ higher accuracy than baseline defenses. We also develop adaptive attacks that attempt to conceal such anomalies, achieving up to $\textbf{35%}$ success rate and underscoring the challenges of achieving true stealth in poisoning RAG systems.
format Preprint
id arxiv_https___arxiv_org_abs_2506_04390
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Through the Stealth Lens: Attention-Aware Defenses Against Poisoning in RAG
Choudhary, Sarthak
Palumbo, Nils
Hooda, Ashish
Dvijotham, Krishnamurthy Dj
Jha, Somesh
Cryptography and Security
Artificial Intelligence
Retrieval-augmented generation (RAG) systems are vulnerable to attacks that inject poisoned passages into the retrieved context, even at low corruption rates. We show that existing attacks are not designed to be stealthy, allowing reliable detection and mitigation. We formalize a distinguishability-based security game to quantify stealth for such attacks. If a few poisoned passages control the response, they must bias the inference process more than the benign ones, inherently compromising stealth. This motivates analyzing intermediate signals of LLMs, such as attention weights, to approximate the influence of different passages on the response. Leveraging attention weights, we introduce the $\textbf{Normalized Passage Attention Score}$ (NPAS) and a lightweight $\textbf{Attention-Variance Filter}$ (AV Filter) that flags anomalous passages. Our method improves robustness, yielding up to $\sim$ $\textbf{20%}$ higher accuracy than baseline defenses. We also develop adaptive attacks that attempt to conceal such anomalies, achieving up to $\textbf{35%}$ success rate and underscoring the challenges of achieving true stealth in poisoning RAG systems.
title Through the Stealth Lens: Attention-Aware Defenses Against Poisoning in RAG
topic Cryptography and Security
Artificial Intelligence
url https://arxiv.org/abs/2506.04390