Reinforced Diffuser for Red Teaming Large Vision-Language Models

Ruofan Wang, Xiang Zheng, Xiaosen Wang, Cong Wang, Xingjun MaarXiv 2025 · DOI

Introduction: The Vulnerability of Toxic Continuation

As Vision-Language Models (VLMs) like GPT-4o, Gemini, and LLaVA become central to AI-driven interactions, ensuring their safety against adversarial "jailbreaks" is paramount. While most safety research targets instruction-based attacks—where a user attempts to trick a model into providing harmful information—this paper investigates a more insidious threat: toxic continuation.

Toxic continuation occurs when a model is presented with a malicious text prefix (e.g., the start of an offensive sentence) paired with an image. The model is then manipulated into completing the harmful thought. Unlike "white-box" attacks that rely on detectable pixel-level noise or "black-box" attacks using embedded typography, this research introduces RedDiffuser, a framework designed to generate natural-looking adversarial images that act as catalysts for toxic VLM outputs.

Methodology: The RedDiffuser Framework

RedDiffuser is a black-box red-teaming framework that optimizes a standard text-to-image model (Stable Diffusion) to become an adversarial generator. The process involves two distinct phases:

  1. Greedy Prompt Search: Utilizing an unaligned Large Language Model (LLM), the framework iteratively searches for text-to-image prompts. These prompts are rendered into images and tested against a target VLM. Prompts that successfully elicit the most toxic completions are retained for the next stage.
  2. Reinforcement Fine-Tuning: The diffusion model is fine-tuned using Denoising Diffusion Policy Optimization (DDPO). This optimization is guided by a dual-reward system:
  3. Toxicity Reward: Calculated using the Detoxify classifier to measure the harmfulness of the VLM's output.
  4. Alignment Reward: Uses metrics like BERTScore or CLIPScore to ensure the generated image remains semantically consistent with the original prompt, preserving its "natural" appearance.

To address real-world safety measures, the authors developed a Checker-Aware variant. This version penalizes the model if its generated images trigger external NSFW (Not Safe For Work) filters, forcing it to learn how to bypass automated guardrails while maintaining its adversarial effectiveness.

Key Findings: Visuals as Toxic Catalysts

The study reveals that visuals can shatter a VLM's safety alignment even when the model is trained to refuse toxic text-only prompts. By pairing a prefix with an optimized image, RedDiffuser forces the model to generate profanity, threats, or insults.

Comparison of toxic continuation triggered by standard Stable Diffusion versus RedDiffuser.

A significant discovery involves the "checker-aware" variant. When tasked with bypassing NSFW filters, RedDiffuser shifts away from explicit content. Instead, it generates images with subtle stylistic modifications—such as ominous lighting, suggestive shadows, or implied tension. These subtle cues are sufficient to trigger toxic text generation in the VLM while remaining undetected by standard image safety filters.

Experimental Results and Transferability

The framework was evaluated using a subset of the RealToxicityPrompts dataset, consisting of 1,199 prompts designed to trigger toxic continuations.

  • Target Performance (LLaVA-1.5): RedDiffuser increased the toxicity rate of LLaVA's outputs by 10.69% on the training set (reaching 68.70%) and by 8.91% on unseen hold-out prompts.
  • Cross-Model Transferability: Adversarial images generated to attack LLaVA proved effective against other models. Toxicity rates increased by 5.1% for Gemini-1.5-flash (reaching 82.52%) and by a significant 26.83% for LLaMA-3.2-11B-Vision-Instruct.
  • Bypassing Guardrails: The checker-aware variant achieved a 94.50% Guardrail Pass Rate (GPR) against standard filters while still eliciting toxic text 69.39% of the time.

Conclusion

RedDiffuser demonstrates that toxic continuation is a fundamental vulnerability in how current VLMs integrate text and image modalities. The ability to generate natural-looking, filter-evading images that trigger harmful text suggests a critical blind spot in multimodal AI safety. While the computational cost of reinforcement learning for diffusion models remains high, the transferability of these attacks across different architectures underscores the need for more robust, cross-modal safety alignments.

Summary updated

BibTeX
@misc{wang2025reinforced,
  author = {Ruofan Wang and Xiang Zheng and Xiaosen Wang and Cong Wang and Xingjun Ma},
  title = {{Reinforced Diffuser for Red Teaming Large Vision-Language Models}},
  year = {2025},
  eprint = {2503.06223},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.06223},
}
Figure