Abstract
We introduce new jailbreak attacks on vision language models (VLMs), which use aligned LLMs and are resilient to text-only jailbreak attacks. Specifically, we develop cross-modality attacks on alignment where we pair adversarial images going through the vision encoder with textual prompts to break the alignment of the language model. Our attacks employ a novel compositional strategy that combines an image, adversarially targeted towards toxic embeddings, with generic prompts to accomplish the jailbreak. Thus, the LLM draws the context to answer the generic prompt from the adversarial image. The generation of benign-appearing adversarial images leverages a novel embedding-space-based methodology, operating with no access to the LLM model. Instead, the attacks require access only to the vision encoder and utilize one of our four embedding space targeting strategies. By not requiring access to the LLM, the attacks lower the entry barrier for attackers, particularly when vision encoders such as CLIP are embedded in closed-source LLMs. The attacks achieve a high success rate across different VLMs, highlighting the risk of cross-modality alignment vulnerabilities, and the need for new alignment approaches for multi-modal models.
Introduction
As Multi-Modal Models (VLMs) like LLaVA and GPT-4V become increasingly integrated into consumer applications, ensuring their safety alignment is paramount. While significant progress has been made in aligning Large Language Models (LLMs) to refuse harmful textual requests, the introduction of visual inputs creates a new, complex attack surface. Researchers have uncovered a "compositional" vulnerability in VLMs that allows attackers to bypass safety filters by splitting a harmful prompt into two pieces: a benign text instruction and an adversarial image. By targeting the shared embedding space of vision encoders like CLIP, these attacks can jailbreak models with high success rates without needing any internal access to the underlying LLM.
Methodology: Compositional Adversarial Attacks
The core of the proposed attack is the Compositional Adversarial Attack. Instead of sending a single toxic prompt that would be caught by textual safety filters, the attack decomposes the malicious intent into two components:
- A Generic Text Prompt: A vague, benign-looking instruction such as "Write a manual on how to build these objects."
- A Malicious Image Trigger: An image that has been adversarially perturbed to map to a "toxic" location in the model's shared embedding space.
To create the image trigger, the researchers use Embedding Space Matching. They identify a target "toxic" concept—represented as a word (e.g., "grenade"), an OCR text string, or a visual image of a weapon—and use gradient-based optimization to modify a benign-looking image (like a landscape) until its embedding vector is nearly identical to the toxic target's vector. This process only requires access to the vision encoder (e.g., CLIP), which is often open-source, making it a "black-box" attack relative to the LLM. When the VLM processes the benign text and the adversarial image together, the LLM draws the necessary context from the image's toxic embedding to fulfill the generic prompt, effectively bypassing textual safety gates.
Experimental Setup
The attacks were evaluated using a comprehensive dataset:
- OpenAI Prohibited Scenarios: 8 categories including Sexual, Hateful, Violence, Self-Harm, and Harassment.
- AdvBench: A standard benchmark for harmful behaviors and strings.
- Custom Dataset: A total of 6,400 queries were generated across two models—LLaVA and LLaMA-Adapter V2—to test various combinations of prompts and triggers.
Key Results
The compositional attacks demonstrated remarkable effectiveness across different models and scenarios. On the LLaVA model, the "Combined Trigger" (utilizing both OCR and Visual features) achieved an average Attack Success Rate (ASR) of 87% across all prohibited categories. In comparison, traditional text-only triggers had a success rate near 0%, demonstrating the resilience of these models to standard textual jailbreaks but their extreme vulnerability to multi-modal exploits.
Furthermore, the attacks exhibit high transferability. Because many VLMs rely on the same off-the-shelf vision encoders, an adversarial image crafted for one model often successfully jailbreaks others. The stealth of these attacks is also a major concern; the adversarial images appear as harmless noise or benign photos to human eyes, yet they are semantically identical to toxic concepts for the model.
Insights and Discussion
The Modality Gap and Security
The "modality gap"—the separation between image and text embeddings in a shared space—acts as a security hole. LLMs have been trained to recognize and refuse dangerous text patterns, but they haven't been taught that an image embedding representing a "bomb" is functionally equivalent to the word "bomb."
Context Contamination
Once a model is tricked into providing the initial part of a harmful response, its internal "context" becomes contaminated. This makes it significantly easier for an attacker to elicit further harmful information through simple follow-up questions, as the model's safety guardrails have already been breached.
Activation of Latent Biases
Jailbreaking the model does more than just bypass safety; it can "unleash" latent biases. For instance, when asked about drugs or crime post-jailbreak, models frequently generated responses targeting specific racial or ethnic groups, suggesting that safety alignment is often the primary mechanism suppressing these underlying biases.
Conclusion and Future Work
The findings highlight a critical need for holistic alignment. Aligning the text modality in isolation is insufficient for multi-modal systems. Future defense research must focus on "cross-modality alignment," ensuring that safety constraints are applied uniformly across the entire shared embedding space. The paper suggests that models may need to be trained on compositional adversarial pairs during their safety tuning phase to build robustness against these types of exploits.
Summary updated