groundy
security

RAG Poisoning Hijacks Model Attention, Not Just Retrieval Ranking

Eyes-on-Me (ICML 2026) shows attention attractors in poisoned documents redirect generator focus post-retrieval, lifting attack success from 21.9% to 57.8% across 18 settings.

9 min···3 sources ↓

RAG security conversations have centered on two concerns: can an attacker plant a document in the vector store, and will the retriever rank it high enough to enter the context window. A June 2026 paper accepted at ICML shows both are the wrong frame. Once a poisoned document reaches the context, reusable “attention attractors” redirect the generator’s focus toward injected instructions regardless of retrieval rank, moving the effective attack surface from the retriever into the model’s attention mechanism.

What are attention attractors, and how do they differ from standard RAG poisoning?

Standard RAG data poisoning treats the attack as a retrieval problem: craft a document semantically close enough to target queries that the pipeline ranks it into context. The implicit assumption behind most documented RAG threat models is that defenders can rerank or filter their way out. The Eyes-on-Me paper (arXiv:2510.00586) challenges that assumption by introducing a second attack layer that activates after retrieval, inside the generator.

An attention attractor is an optimized token sequence embedded in a poisoned document. Its purpose is not to fool the retriever but to redirect the generator’s attention once the document lands in context. Rather than gaming embedding distance or BM25 scores, the attractor exploits which attention heads the model uses when weighting tokens during generation.

The paper identifies a small subset of attention heads that are strongly correlated with attack success. Those heads are not uniformly distributed across the transformer stack; the work targets a specific subset whose concentration patterns predict whether injected content overrides the grounded context. A retrieval defense that scores documents on relevance, provenance, or semantic distance has no visibility into what happens inside those heads once the document is passed to the generator.

This is also a different threat vector from user-side prompt injection, where the attacker controls the query. Here, the poisoned document is already resident in the vector store before any user query arrives. The injection is passive until retrieval activates it.

How does the two-component design work, and why does it change the attacker’s economics?

Eyes-on-Me decomposes the poisoned document into two independently optimizable parts: the Attention Attractor and the Focus Region. The Attention Attractor is computed once and optimized to redirect the model’s attention. The Focus Region is the payload zone, where the attacker embeds either semantic content to influence retrieval ranking or explicit malicious instructions for the generator to follow.

Because the two components are separable, the expensive optimization step happens once per attractor, not once per target query or injected payload. Earlier RAG poisoning approaches required full per-target document optimization. Each new query target or malicious instruction required a new full poisoning pass. The modular decomposition in Eyes-on-Me eliminates that cost: generate one attractor, vary the focus-region payload, and the resulting documents inherit the steering effect. A poisoned document planted in a shared corpus today can be adapted for different downstream targets without generating new optimized content from scratch.

What do the numbers across 18 settings actually mean?

The aggregate result from arXiv:2510.00586 is that average attack success rates rise from 21.9% to 57.8%, a gain of 35.9 percentage points and roughly 2.6 times the prior-work baseline. The 18 settings span 3 datasets, 2 retrievers, and 3 generators.

A few things to read carefully in those figures. The 21.9% baseline is not a universal floor for RAG poisoning. It is specific to the comparison systems tested in this paper. Per-retriever and per-generator breakdowns are in the full tables, not the abstract, and the aggregate conceals variation. Some model pairings will sit above 57.8%, others below. The 2.6x figure is a mean over 18 settings, not a minimum guarantee across every configuration an organization might run.

What the aggregate does establish is breadth. Six pairings of retriever and generator, three datasets with different domain characteristics, and the mean nearly triples over prior work. Consistent lift across a diverse test matrix is a stronger result than a single outlier configuration. The attack is not a trick that works on one generator architecture and fails on others; the paper’s table structure implies it generalizes across the tested combinations, even if some cells outperform others.

The other number worth noting: the prior-work 21.9% baseline is not nothing. RAG pipelines are already exposed to corpus poisoning at non-trivial rates even before this technique. Eyes-on-Me raises a bad situation to a significantly worse one.

Does a single poisoned document survive retriever and generator swaps?

Yes, and this is the operationally consequential result. The Eyes-on-Me paper shows that a single optimized Attention Attractor transfers to unseen black-box retrievers and generators without retraining.

That word “black-box” carries weight here. The attacker does not need to know which retriever a target pipeline uses, or which generator version it calls. One crafted document survives those swaps. Organizations that ingest data from shared public corpora, third-party documentation feeds, or cached web crawls cannot assume that a poisoned document crafted for their current configuration becomes inert when they upgrade their retriever or switch generator providers.

The transfer result also complicates standard advice around pipeline diversification. When teams switch from BM25 to a dense retriever, or migrate from one embedding model to another, they typically reconsider ingestion pipelines and index schemas rather than their existing corpus contents. The poisoned document that entered the store under one configuration does not get rescanned when the retriever changes.

Why is reranking and retrieval filtering not a sufficient security boundary?

Retrieval-layer defenses assume that a dangerous document is semantically suspicious: it ranked too high for queries it should not match, or it exhibits embedding-space anomalies. Rerankers and relevance filters are calibrated to catch exactly this pattern. Eyes-on-Me is designed to evade that calibration.

The Attention Attractor optimizes for post-retrieval steering, not for retrieval rank. A poisoned document can carry entirely normal relevance scores, pass embedding-distance checks, and clear a reranker without triggering any signal. The retrieval layer treats it as a plausibly relevant result and passes it through. The steering then happens inside the generator’s attention mechanism, in a layer that standard RAG monitoring does not reach.

The implication is structural. Defenders who treat the retrieval boundary as the primary security perimeter are securing a layer this attack does not need to defeat. The document enters through normal retrieval. The damage happens where most production pipelines have no sensors.

Perimeter hardening at ingestion time (provenance logging, URL filtering, content classifiers on ingest) can reduce the probability that a poisoned document enters the store at all. It cannot guarantee protection once an attacker has any write path into a corpus, whether via a compromised third-party feed, a shared documentation repository, or a crawled page on an attacker-controlled domain. And it does nothing for source content that was benign at ingestion and later modified if the upstream is mutable.

The retrieval-layer mental model is also partly responsible for where most RAG security tooling has invested. Embedding-space anomaly detection, reranking with safety-tuned models, and query-level prompt injection filtering are all well-developed. Generator-side attention monitoring is not. Eyes-on-Me makes the deficit explicit.

What should RAG practitioners change now, and what remains unsolved?

The honest position is that attention-level defenses for production RAG pipelines are not yet standard offerings, and the Eyes-on-Me paper does not close that gap. What it does is precisely locate where the gap sits.

Several controls narrow the attack surface without solving the core problem. Strict corpus provenance is the most actionable today: every document in a production vector store should have a logged source, ingestion timestamp, and integrity hash. Automated ingestion from public or third-party feeds should be treated as untrusted by default rather than trusted until proven malicious. That framing is the reverse of how most pipelines are built. It adds overhead, but it makes post-incident attribution possible and limits how quietly a poisoned document can propagate.

Chunk size limits reduce the token budget available for attractor optimization. The attractor token sequence requires space to embed a steering signal; shorter chunks constrain that space. The paper does not report a specific size threshold below which attractors fail, so this is directional guidance rather than a hard parameter.

Multi-retriever agreement, retrieving independently with BM25 and a dense model and requiring overlap before a document enters context, raises the bar for documents that exploit a single retriever’s ranking behavior. This addresses the Focus Region’s retrieval manipulation surface but does not touch the attractor itself.

Monitoring attention distributions at inference time is the most direct defense and the least deployed. The paper’s finding that a small, identifiable subset of attention heads predicts attack success suggests that focused monitoring might be tractable, since defenders would not need to instrument every head uniformly. In practice, logging per-head attention across a production generator requires baseline data, threshold calibration, and computational overhead that most teams have not budgeted.

The open problems are specific: runtime detection of attractor patterns without requiring model-internal access, adversarial generator training to resist attractor optimization during fine-tuning, and corpus scanning techniques that can identify embedded attractor signals before ingestion. None of these are solved. The ICML 2026 acceptance of the paper formalizes the attack class. Defenses will follow, but they will lag.

Frequently Asked Questions

Does this attack apply if the RAG corpus is internal-only and not crawled from the web?

Write access is the critical variable, not corpus visibility. An employee submitting content to an internal wiki, a vendor contributing to a shared knowledge base, or a compromised documentation pipeline feeding an internal index all provide the same foothold as a public web source. Internal corpora reduce the attacker pool but do not eliminate the write-path risk that makes poisoning viable.

Can teams using cloud-hosted generator APIs monitor attention distributions as a defense?

Cloud API generators expose no per-head attention data to callers, so attention monitoring is unavailable to teams routing generation through external APIs. The defense requires self-hosted open-weight models or dedicated inference infrastructure with internal hooks. Most enterprises relying on hosted APIs cannot implement the most direct generator-side defense the paper implies, and are limited to corpus-side controls at ingestion time.

How does this attack differ from adversarial suffix attacks on standalone LLMs?

Adversarial suffixes (such as those from the GCG line of work) optimize token sequences appended directly to a user prompt. A prompt injection filter on the user-facing input layer would catch a GCG-style suffix but would not catch an attractor embedded in a retrieved document, since the document enters through the retrieval path after query processing. The threat surfaces are structurally distinct: one targets the query, the other targets the corpus.

Are there RAG architectures where the attractor cannot reach the generator’s attention mechanism?

Pipelines that extract structured fields from retrieved documents (specific entities, dates, key-value pairs) and pass only those fields to the generator are not directly exposed. If the raw attractor token sequence never appears in the generator’s context window, the steering mechanism cannot activate. The vulnerability is specific to architectures that pass retrieved text as contiguous token sequences, which covers most passage-retrieval pipelines but not structured-extraction designs.

Why is standard fine-tuning on clean corpora not a fix for this vulnerability?

The attractor exploits the transformer’s general attention routing, not patterns specific to poisoned training data. Fine-tuning on clean examples teaches the model what content to generate, not how to resist attention manipulation by optimized token sequences. Adversarial training on attractor-style inputs is the relevant intervention, but it requires generating attractor examples first and may not generalize to novel attractor optimizations. Standard fine-tuning and RLHF pipelines leave the underlying attention mechanism unchanged.

sources · 3 cited

  1. What is Retrieval-Augmented Generation (RAG) - GeeksforGeeksgeeksforgeeks.organalysisaccessed 2026-06-27