TL;DR
Imagine asking an image generator for a photo of a commercial airliner, and it hands you a picture of a hand grenade instead—all because someone slipped a couple of subtly altered airplane photos into a public database. This paper introduces PoisonedRDM, a clever, zero-training attack against Retrieval-Augmented Diffusion Models (RAG-DMs). By adding nearly invisible pixel noise to just a tiny fraction of reference images, an attacker can simultaneously trick unknown search algorithms and hijack the final generated output.
What Problem Does This Paper Address?
Training massive text-to-image models from scratch costs a fortune. Retrieval-Augmented Diffusion Models (RAG-DMs) offer an elegant shortcut: instead of memorizing the entire visual universe into model weights, they act like an artist using a reference library. When you type a prompt, a retriever fetches relevant images from an external knowledge base (often downloaded from open-source hubs like Hugging Face), and the diffusion model uses them as visual guides.
While great for efficiency, outsourcing memory creates a massive blind spot. Traditional data poisoning attacks corrupt a model's internal weights during training. Against RAG-DMs, those attacks fizzle out because clean reference images fetched at runtime easily override the poisoned weights. Meanwhile, a recent RAG-DM attack (BadRDM) requires training and modifying the retriever itself—which is computationally expensive and fails the moment a user swaps in a different, unknown retriever.
The authors ask: Can we hijack both the retrieval and generation phases without training any models at all, even when we don't know what retriever the victim is using?
Methods
Enter PoisonedRDM. Instead of touching model weights, the attacker crafts a visual Trojan horse. Starting with a benign decoy image of a source category (say, an airliner), the attacker optimizes a layer of imperceptible noise ($\delta$) so the image wears two mathematical masks at once:
- Multi-Anchor Retrieval Alignment (The Bait): To ensure unknown retrievers fetch the poisoned image, the algorithm aligns its embedding with three text descriptions and three reference photos ("anchors") of the source category. Crucially, at each optimization step, it calculates this across a randomly sampled subset of four diverse CLIP architectures. This ensemble approach prevents overfitting to one model's quirks, allowing the bait to generalize to unseen retrievers.
- Target-Driven Generation Alignment (The Payload): Once fetched, the image must steer the generator toward the attacker's chosen target (e.g., a grenade). Rather than backpropagating through a heavy, iterative denoising process, the authors align the poisoned image’s features directly with a target reference image inside the frozen RDM condition encoder space.
- Joint Optimization: Using standard Projected Gradient Descent (PGD), both objectives are optimized simultaneously under a strict pixel-change budget ($\epsilon = 16/255$). To human eyes, it still looks like a normal airplane; to the diffusion model, it screams "grenade."
Datasets
- Retrieval Knowledge Base: The standard ImageNet-1K validation set (50,000 images). The authors inject 4 copies of an optimized image per target task—just 196 poisoned images total, or less than 0.4% of the database.
- Evaluation Benchmark: The authors introduce 49 source-to-target category pairs split into two newly curated subsets: a benign subset (24 pairs redirecting animals to vehicles, like tabby cat $\rightarrow$ bicycle) and a red-teaming subset (25 pairs turning everyday objects into unsafe outputs, like airliner $\rightarrow$ grenade). Crucially, test queries use completely different phrasing than the text anchors used to craft the poison.
Key Insights and Ideas
- Clean retrieval is a natural immune system against weight poisoning: Traditional parameter-poisoning baselines achieved a 0.00% retrieval success rate against RAG-DMs, proving that clean external context washes away internal weight corruption.
- Dual-space manipulation works: You can make a single image point to "airplane" in a retriever's embedding space while pointing to "grenade" in a generator's conditioning space—all without visible artifacts. Removing either half of the loss function causes total attack failure (dropping generation success to ~1% or 0%).
- Zero-shot black-box transfer: Locally optimized images successfully fooled commercial, closed-source multimodal pipelines (GPT Image 2 and Nano Banana 2) when fed alongside text queries as retrieved context.
Key Results
Across open-source RAG-DMs (PLMS- and DDIM-based), PoisonedRDM decisively outperformed five state-of-the-art baselines:
- High Retrieval & Generation Hijacking: On DDIM-based RDM with a ResNet50 retriever, PoisonedRDM hit a 95.83% retrieval success rate (ASR-r) and 64.17% generation success rate (ASR-g), compared to 44.17% ASR-g for the strongest baseline, BadRDM. With ViT-B/16 on PLMS-based RDM, it nearly doubled BadRDM's generation success (62.50% vs. 33.33%).
- Online Service Transferability: When simulating RAG pipelines on commercial services, PoisonedRDM averaged 41.25% ASR-g on GPT Image 2 and 43.54% ASR-g on Nano Banana 2, with retrieval rates exceeding 92%.
- The Stealth Trade-off: Pushing the noise budget from $8/255$ to $32/255$ boosted generation success from 37.53% to 69.36%, but made the visual static obvious (LPIPS perceptual distance jumped from 0.09 to 0.38), validating $16/255$ as the sweet spot.
Limitations and Future Work
- White-box Condition Encoder Assumption: While train-free and transferable across retrievers, the threat model assumes white-box access to the RDM's image conditioning encoder during optimization. When transferring to true black-box commercial services (GPT Image 2, Nano Banana 2), generation success noticeably dips (~41–44% vs. ~50–64% locally).
- Future Directions: The authors frame this work as a wake-up call regarding untrusted open-source databases, aiming to spur the development of robust defensive filtering and verification strategies for RAG-DMs in future work (note: specific defense experiments or broader limitations beyond pages 1–11 are not discussed in the provided text).
Summary updated