Eyes-on-Me: Scalable RAG Poisoning through Transferable Attention-Steering Attractors

Yen-Shan Chen, Sian-Yao Huang, Cheng-Lin Yang, Yun-Nung Chen

TL;DR

EYES-ON-ME introduces a highly scalable, modular data poisoning attack for Retrieval-Augmented Generation (RAG) systems by decoupling adversarial documents into reusable "Attention Attractors" and swappable "Focus Regions." By optimizing tokens to steer a small subset of influential attention heads, the attack achieves a 2.6× improvement in success rate over prior methods and seamlessly transfers to unseen black-box models and proprietary APIs without retraining.

What Problem Does This Paper Address?

Retrieval-Augmented Generation (RAG) systems minimize LLM hallucinations by fetching relevant documents from an external corpus to ground model responses. However, this setup introduces a critical vulnerability: data poisoning. An attacker can inject malicious documents into the corpus to manipulate the system's output when specific "trigger phrases" appear in user queries.

Prior data poisoning attacks are highly inefficient. They typically rely on monolithic, end-to-end optimization, meaning an attacker must completely re-optimize the adversarial document for every single new trigger phrase or malicious payload. This approach is computationally expensive, brittle to query variations, and scales poorly. EYES-ON-ME addresses this bottleneck by asking: Can we build a universal, reusable framework that forces a model to focus on malicious content, regardless of what that content actually is?

Methods

The authors propose EYES-ON-ME, a modular attack paradigm that separates the adversarial document into two distinct components:

  1. Attention Attractor: Optimizable prefix and suffix tokens that act as a "wrapper."
  2. Focus Region: A placeholder slot where the actual Attack Payload (e.g., a malicious URL or instruction) is inserted.
Figure 2. Overview of the attack framework. The attacker specifies a target trigger (in this case, Seoul), and crafts a malicious document dm containing a semantic bait (to tthe trigger) sret and a malicious instruction sgen. Then, the Attention Attractors of retriever and generator (ρprefix, ρsuffix, gprefix, gsuffix) are optimized w.r.t. the attention objective to maximize models’ attentions to the Focus Regions (dotted line), where the Payloads, sret and sgen, are placed. This malicious document is then injected into the corpus as in Figure 1.

Instead of optimizing for final task metrics—which couples the document to a specific payload—the authors design an attention-guided proxy objective. The optimization workflow proceeds as follows:

  • Correlated Head Identification: The authors empirically discover that a tiny subset (~10–15%) of attention heads in both retrievers and generators strongly dictate downstream task performance. They identify these "influential heads" by calculating the correlation between internal attention weights and final outputs.
  • Discrete Search via HotFlip: Using HotFlip (a gradient-based token substitution algorithm), they tune the attractor tokens to maximize the attention mass that these influential heads direct toward the Focus Region.
  • Fluency Constraints: To ensure the generated text remains stealthy and evades perplexity filters, candidate tokens are restricted to a high-probability pool evaluated by a reference language model.

Because the attractor is optimized independently of the payload, attackers can swap out malicious instructions at near-zero marginal cost without retraining the attractor.

Datasets

The framework was evaluated using three standard open-domain question-answering benchmarks:

  • MS MARCO
  • Natural Questions (NQ)
  • TriviaQA

From each dataset, the authors sampled a fixed corpus of 1,000 query-document pairs to simulate a realistic and competitive retrieval environment.

Key Insights and Ideas

  • Attention as a Universal Proxy: The core "aha!" moment of the paper is that manipulating internal attention mechanics is a highly effective proxy for manipulating end-to-end behavior. Forcing specific heads to look at the Focus Region guarantees payload delivery.
  • Shared Structural Vulnerabilities: Even though different language models use different architectures and weights, they tend to converge toward similar representation spaces when trained on web-scale data. This allows an Attention Attractor optimized on a small open-source model to exploit a fundamental vulnerability that transfers directly to closed-source, black-box systems.
Figure 3. Left. Correlations of attention heads with bce-embedding-base (similarity) and Qwen2.5-0.5B (log P) as examples for a retriever and generator. Right. A demonstration of the central idea: when similarity correlates strongly with attention, steering attention boosts similarity.
  • Bypassing Rerankers: Rerankers (cross-encoders) are typically used as a defense layer to filter out adversarial text. However, because EYES-ON-ME targets fundamental cross-attention patterns, the optimized attractors successfully trick rerankers into elevating malicious documents to top retrieval ranks.

Key Results

  • Massive Performance Gains: Across 18 end-to-end RAG configurations (combining various datasets, retrievers, and generators), the hybrid EYES-ON-ME + LLM-Gen attack raised the average End-to-End Attack Success Rate (E2E-ASR) from 21.9% to 57.8% (a 2.6× improvement over baselines like Phantom).
  • Uncompromising Transferability: Attractors optimized on white-box models transferred seamlessly to unseen black-box targets. Retriever attractors achieved a 96.6% average success rate on hidden retrievers, while generator attractors hit a 97.8% average success rate on hidden generators—including commercial APIs like GPT-4o-mini and Gemini 2.5 Flash.
  • Position Independence: Unlike baseline attacks that fail if the retrieved document drops to a lower rank (e.g., rank 3–5), EYES-ON-ME maintains a stable generation success rate regardless of its position in the context window, showing a variance of just 0.39%.

Limitations and Future Work

  • Trigger Corpus Frequency: The attack relies on the trigger phrase being relatively rare. If a trigger phrase is highly common in the corpus (e.g., appearing in 1%–5% of documents), the retrieval success rate drops significantly because the malicious document must compete with a massive volume of naturally relevant benign documents.
  • Instruction Complexity: While forcing simple sentence generation is highly successful (~65% ASR), executing complex tasks like phishing URL insertion remains difficult (dropping success rates to ~4–9%) due to the rarity of URL tokens in the underlying model's training data.

The authors note that these findings open up new avenues for defense research, suggesting that future security frameworks should focus on detecting localized attention anomalies rather than relying solely on text perplexity filters.

Summary updated

BibTeX
@inproceedings{chen2026eyes,
  author = {Yen-Shan Chen and Sian-Yao Huang and Cheng-Lin Yang and Yun-Nung Chen},
  title = {{Eyes-on-Me: Scalable RAG Poisoning through Transferable Attention-Steering Attractors}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=rF1oJAhAZA},
}
Figure