Skip to content

Gradient-based jailbreak images against multimodal fusion modelsGradient-based Jailbreak Images for Multimodal Fusion Models

arXiv· arXiv:2410.03489· Javier Rando, Hannah Korevaar, Erik Brinkman, Ivan Evtimov, Florian TramèrMeta; ETH ZurichIndexed by this site · 27 days ago· Originally publishedAttacks

Quick read

Attacks

Based on the paper PDF (AI-generated); refer to the original

The authors propose the tokenizer shortcut to perform end-to-end gradient image jailbreaks on the Chameleon multimodal fusion model, with an ASR of 72.5% on JailbreakBench.

Threat modelThe attacker has white-box access to the multimodal fusion model, and the goal is to find a universal adversarial image that, combined with any harmful text request, causes the model to generate harmful content; there are no constraints on the image, which may be arbitrarily distorted and need not be human-interpretable; only harmful instructions that can be fully defined in text are considered.

Questions
Multimodal fusion models also tokenize images into discrete tokens, and the quantization step is non-differentiable, making continuous gradient-optimized attacks on images difficult; the authors aim to address how to enable end-to-end gradient jailbreaks on such models and to compare the effectiveness of image versus text optimization.
Methods
The authors propose the tokenizer shortcut: use a 2-layer fully connected network to approximately map the image embeddings before VQ-VAE quantization into the LLM embedding space (embedding shortcut) or the soft one-hot space (1-hot shortcut), thereby obtaining a differentiable path and using gradient descent to optimize the image to maximize the probability of a non-refusal prefix.
Experiments and results
On Chameleon-7B and the 80 test prompts of JailbreakBench, the direct attack reaches an ASR of up to 71.3% (1-hot), outperforming GCG's 63.8%; the embedding shortcut transfer attack reaches 72.5%; the image does not increase perplexity, but Circuit Breakers can reduce its ASR to 0.0%–10.0%, and the image essentially does not transfer across models.
Limitations and future work
The authors note that attack success rate varies greatly with hyperparameter choice, that cross-model transfer remains an open problem, and that attack dynamics may change with new models; experiments optimize only on Chameleon-7B and evaluate on 80 test prompts, and the paper does not report the number of repetitions.
Experimental setupChameleon-7B、Chameleon-30B et al. · JailbreakBench、MIMIC-IT · ASR、refusal rate et al.
Evaluated models
Chameleon-7BChameleon-30BLLaMA3-LLaVA-1.6
Benchmarks
JailbreakBenchMIMIC-IT
Metrics
ASRrefusal rate∆ PPL
AI summaryThe researchers propose tokenizer shortcut, which approximates the tokenization process with a continuous function, and construct an end-to-end gradient image jailbreak attack against multimodal fusion models, generating jailbreak images that can induce harmful information for 72.5% of prompts on the Chameleon model. The authors state that this is the first end-to-end gradient image attack against multimodal fusion models. These jailbreak images outperform text jailbreaks optimized with the same objective, and require 3 times less computational budget to optimize 50 times the input tokens. Representation engineering defenses such as Circuit Breakers trained only on text attacks can effectively transfer to adversarial image inputs.

The researchers propose tokenizer shortcut, which approximates the tokenization process with a continuous function, and construct an end-to-end gradient image jailbreak attack against multimodal fusion models, generating jailbreak images that can induce harmful information for 72.5% of prompts on the Chameleon model. The authors state that this is the first end-to-end gradient image attack against multimodal fusion models. These jailbreak images outperform text jailbreaks optimized with the same objective, and require 3 times less computational budget to optimize 50 times the input tokens. Representation engineering defenses such as Circuit Breakers trained only on text attacks can effectively transfer to adversarial image inputs.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Image tokenization in multimodal fusion models is non-differentiable, so the authors propose the tokenizer shortcut to enable end-to-end gradient image jailbreaks.

    Core question: multimodal fusion models tokenize images into discrete tokens, and the quantization step is non-differentiable; how to perform end-to-end continuous gradient-optimized image jailbreak attacks on such models.

    • Problem setting: The authors state that the image inputs of adapter-based vision-language models can be continuously optimized, which is more efficient than the discrete optimization of text (Carlini et al., 2024); whereas early-fusion multimodal models (the authors call them multimodal fusion models) map all modalities into a shared token space, and tokenization is non-differentiable, which turns the optimization of any modality back into a discrete problem.
    • Shortcomings of existing methods: The authors state that text jailbreaks such as GCG require discrete optimization and are less efficient; image continuous optimization for adapter-based models cannot be directly applied to fusion models.
    • Core observation: Drawing on work on adversarial examples for quantized image classifiers (Athalye et al., 2018), the authors hold that even a rough approximation of quantization yields a surrogate gradient sufficient to guide adversarial optimization.
    • Proposed in the paper: tokenizer shortcut—approximating image tokenization with a differentiable function, and on this basis constructing what the authors call the first end-to-end gradient image attack against multimodal fusion models, evaluated on the Chameleon model.
    • Threat model:
      • Goal: find a universal adversarial image that, combined with any harmful text request, causes the model to generate harmful content.
      • Knowledge: the attacker has white-box access to the model.
      • Capability: no constraints on the image; it may be arbitrarily distorted and need not be a human-understandable image.
      • Victim system: a multimodal fusion model that has undergone safety training and refuses harmful requests (Chameleon in the experiments); only harmful instructions that can be fully defined in text are considered.
  2. What related research exists?

    Related work covers multimodal model architectures, adversarial examples, and text and visual jailbreaks; this paper is positioned as an end-to-end image attack on fusion models.

    Multimodal model architectures

    • Liu et al. (2024), Karamcheti et al. (2024) — adapter-based vision-language models: use a pretrained image embedding model (e.g., CLIP, Radford et al., 2021) plus an adapter to map image embeddings into the LLM embedding space. The paper notes that their input spaces are separate and that they do not support native image generation.
    • Chameleon Team (2024), Gemini Team (2023), OpenAI (2024) — early-fusion multimodal models: all modalities share a token space and are pretrained multimodally from scratch; this paper focuses on Chameleon, which the paper states was the only open-source early-fusion multimodal model at the time of writing.

    Adversarial examples and text jailbreaks

    • Szegedy (2013), Madry (2017) — adversarial examples in image classification: adding gradient-optimized perturbations to the input.
    • GCG of Zou et al. (2023) — white-box text jailbreak: discretely optimizing a suffix to maximize the probability of non-refusal; the paper states that GCG suffixes optimized on open-source models can transfer to black-box and proprietary models.
    • Liu et al. (2023b), Shah et al. (2023), Liu et al. (2023a), Wei et al. (2024) — black-box prompt strategy jailbreaks that do not require model weights.

    Vision-language model jailbreaks

    • Carlini et al. (2024) — demonstrated that image inputs to adapter-based models enable more efficient and more effective jailbreaks; this is the direct motivation of this paper.
    • Schaeffer et al. (2024) — parallel work: universal image jailbreaks on adapter-based models are effective in the white-box setting but do not generalize across models; this paper observes the same phenomenon on fusion models.

    Defenses and related techniques

    • Athalye et al. (2018) — using a quantized approximation to obtain surrogate gradients for quantized classifiers; this is the inspiration for the tokenizer shortcut.
    • Jain et al. (2023) — filtering high-perplexity attacks using the average token perplexity of the prompt; Circuit Breakers of Zou et al. (2024) — a representation engineering defense optimized on text inputs; Refusal Direction of Arditi et al. (2024) — identifying and subtracting the refusal direction in activation space.

    Baselines and benchmarks: the attack baselines are GCG and Refusal Direction; the defense evaluation uses Circuit Breakers and perplexity filtering; the benchmark is JailbreakBench (Chao et al., 2024), and the shortcut training data uses MIMIC-IT (Li et al., 2023).

    The authors position this paper as extending the continuous image optimization approach of Carlini et al. (2024) to fusion models whose tokenization is non-differentiable, and as systematically comparing image and text optimization on success rate, budget, and transferability.

  3. How does the paper address this problem?

    A 2-layer fully connected network approximates image tokenization to obtain a differentiable path, and then gradient descent is used to optimize the image to maximize the probability of the non-refusal prefix.

    Overall approach: propose tokenizer shortcut, which uses a differentiable function to approximate Chameleon's VQ-VAE image tokenization, mapping the pre-quantization image embeddings into the model input space, thereby establishing a differentiable path from image pixels to the output loss, and then uses gradient descent to end-to-end optimize the jailbreak image.

    Problem setting and optimization objective

    • Goal: find an image that, appended to a harmful prompt, causes the model to generate a response beginning with a non-refusal prefix (e.g., "Sure, I can help you with that").
    • Loss function: L(image) = ∑i ∈ prompts p(refusal prefixi|i) − p(non-refusal prefixi|i), i.e., over a set of prompts, minimize the refusal prefix probability and maximize the non-refusal prefix probability; the authors state that the refusal minimization term is optional.
    • Update rule: imaget+1 = imaget − α · sign(∂ L/∂ image); the authors explain that because image semantics need not be preserved, the update is not projected back into an epsilon-ball.

    Tokenizer shortcut design

    • Structure: a 2-layer fully connected network that independently processes the 1024 latent vectors output by the VQ-VAE (R1024×256), see Figure 2.
    • Embedding shortcut: maps the VQ-VAE embeddings directly into the LLM embedding space (R1024×4096), and training minimizes the cosine similarity between the prediction and the original image token embeddings.
    • 1-hot shortcut: maps to a soft one-hot distribution over the vocabulary (R1024×16384), and training minimizes the cross-entropy with respect to the token that quantization should have assigned, then propagates through the model embedding layer.
    • Training data: because Chameleon's pretraining data are proprietary, the shortcut is trained on a subset of the open-source MIMIC-IT.

    Key hyperparameters

    • Optimization: gradient descent for 500 steps; α starts at 0.01 and halves every 100 steps down to a floor of 0.001; the image with the lowest loss on the training images is kept; initialized from a random MIMIC-IT image.
    • Softmax temperature: the 1-hot shortcut's predictions are overconfident (probability of the correct token close to 1), which causes vanishing gradients for other tokens; the authors state that a temperature of 6 is critical for optimization (Appendix A).
    • Optimization target prefix: the authors state that the most effective is maximizing a long non-refusal prefix semantically related to the prompt (Table 2).

    Attack strategies and success determination

    • Direct attack: optimize a separate image for each test prompt.
    • Transfer attack: optimize a universal image on N held-out training prompts and evaluate on unseen test prompts.
    • Success determination: after sampling responses, two judge models from JailbreakBench separately determine whether the response is unsafe and whether it is a refusal; ASR and refusal rate are reported; when the Circuit Breaker output contains more than 15 special characters (excluding common punctuation), it is not counted as a successful jailbreak.
  4. What experiments did the paper conduct?

    Direct and transfer attacks are evaluated on Chameleon-7B; image jailbreaks reach an ASR of up to 72.5%, but do not transfer across models and are blocked by Circuit Breakers.

    Experimental setup

    • Models evaluated: Chameleon-7B (attack optimization and main evaluation), Chameleon-30B and LLaMA3-LLaVA-1.6 (cross-model transfer evaluation only).
    • Dataset: JailbreakBench, 80 test prompts + 20 held-out prompts for transfer experiments; a MIMIC-IT subset for shortcut training.
    • Baselines: GCG (200 steps, 20-token suffix, 256 candidates per token, 512 candidate suffixes per step) and Refusal Direction (Arditi et al., 2024).
    • Defenses: Circuit Breakers (a representation engineering defense trained on text) and average token perplexity filtering (∆ PPL relative to benign prompts; image attacks compared with 50 benign images).
    • Metrics and judges: ASR (proportion of unsafe responses) and refusal rate, determined by JailbreakBench's two judge models; Circuit Breaker outputs containing more than 15 special characters are not counted as successes.
    • Number of repetitions: not reported in the paper.

    Main results

    Direct attacks (one image optimized per prompt, Chameleon-7B, per Table 3):

    Swipe horizontally to read the table

    AttackDefault ASRDefault RRCircuit Breaker ASRCircuit Breaker RR∆ PPL
    No attack2.5%77.5%1.3%81.3%-
    Jailbreak Image (1-hot)71.3%13.8%0.0%66.2%-1.14
    Jailbreak Image (Embed)70.0%16.3%3.8%64.6%-1.21
    GCG63.8%22.5%10.0%37.5%+2.51
    • The authors state that image jailbreaks outperform text GCG on ASR and require about 1/3 of its compute: about 400,000 FLOPs/token for images versus about 1,060,000 FLOPs/token for GCG (based on the assumptions of constant FLOPs per token and backward being 3 times forward); the image can modify 1024 tokens, whereas GCG modifies only 20.
    • The authors state that although Circuit Breakers is trained only on text, it transfers to image attacks; the embedding shortcut's representation is more flexible and retains 3.8% ASR under the defense.
    • The ∆ PPL of image attacks is negative (it does not increase perplexity); the authors state that perplexity filtering is ineffective against it, whereas GCG increases perplexity.

    Transfer attacks (universal images)

    A single image is optimized on N held-out prompts and evaluated on 80 unseen test prompts (per Table 4, Chameleon-7B, Default Safety):

    Swipe horizontally to read the table

    AttackTrain=1Train=10Train=20
    Jailbreak Image (1-hot)27.5%53.8%51.3%
    Jailbreak Image (Embed)31.3%72.5%72.5%
    GCG17.5%50.0%46.3%
    Refusal Direction5.0%73.8%81.3%
    • The authors state that increasing the number of training prompts improves generalization, but the gains are similar at 10 and 20; the embedding shortcut outperforms 1-hot with 10 or more training prompts (72.5% vs. 53.8%) and is comparable to per-prompt direct attacks.
    • Refusal Direction has the highest ASR with 20 training prompts (81.3%); the authors take this to indicate that image jailbreaks are limited by the input space, with limitations similar to text attacks. A paper footnote states that this method cannot identify the refusal direction on image inputs.
    • Universal images likewise do not increase perplexity; the authors state that their perplexity is even lower than that of benign images.

    Cross-model transfer

    Images are optimized on Chameleon-7B and evaluated on Chameleon-30B and LLaVA-1.6 (per Table 5):

    • Chameleon-30B: all image attacks (1-hot/Embed, 1/10/20 training prompts) have an ASR of 0.0%, the same as the no-attack baseline; GCG is 2.5%–6.3%.
    • LLaVA-1.6: all image attacks have an ASR of 10.0%, versus a baseline of 8.8%; GCG (10 training prompts) reaches 41.3%. The authors state that GCG improves over the baseline by 32.5 percentage points, whereas images improve by only 1.2 percentage points.
    • Direct attack transfer (Appendix B, Table 7): single-prompt images have an ASR of 0.0% on Chameleon-30B and 10.0% on LLaVA-1.6; the authors state that direct attacks likewise do not transfer across architectures.

    Other ablations and analyses

    • Shortcut on/off (Table 1): with the shortcut removed, the 1-hot direct attack has an ASR of 47.5% and the embedding attack 0.0% (with the shortcut, 71.3% and 70.0%, respectively).
    • Optimization objective (Table 2): maximizing only "Sure" gives an ASR of 18.8% (Embed)/13.8% (1-hot); adding context gives 70.0%/71.3%; further adding refusal-prefix minimization lowers it to 66.3%/44.3%.
    • Softmax temperature (Appendix A, Table 6, 1-hot): ASR is 12.9% at temperature 1, 71.3% at temperature 6, and drops to 25.6% at temperature 10.
  5. What are some points that can be further explored?

    The authors point out hyperparameter sensitivity, unsolved cross-model transfer, and unknown dynamics for new models; the experiments cover only the Chameleon series and LLaVA.

    Limitations and future directions noted by the authors

    • Hyperparameter sensitivity (Section 7): the authors state that attack success rate varies greatly with hyperparameter choice, and that future work could study optimization dynamics in greater depth to exploit gradients more effectively.
    • More flexible objective functions (Section 7): the authors state that future work could explore objective functions such as those combining the output space and the activation space (citing Thompson & Sklar, 2024).
    • Cross-model transfer (Section 7): the authors state that cross-model transfer of image jailbreaks remains an open problem, and that future work could study regularized optimization to improve transferability.
    • Attack dynamics on new models (Section 7): the authors state that Chameleon is currently the only open-source model of this architecture, that attack dynamics may change with new models, and they encourage researchers to evaluate on future models and architectures; the authors also believe that Chameleon is overly safe (often refusing benign instructions), which may not apply to other models.

    Scope of experiments

    • Attack optimization is performed only on Chameleon-7B; cross-model evaluation covers two models, Chameleon-30B and LLaMA3-LLaVA-1.6 (Table 5).
    • Evaluation uses 80 test prompts and 20 held-out training prompts from JailbreakBench (Section 4).
    • Defense evaluation includes two white-box protections: Circuit Breakers and average token perplexity filtering (Section 4).
    • Success determination uses JailbreakBench's two judge models; the paper does not report agreement between the judges and humans.
    • The paper does not report the number of experimental repetitions or variance; the threat model is limited to white-box access and considers only harmful instructions that can be fully defined in text (Section 2).
  6. Summarize the main content of the paper

    The authors use a differentiable tokenizer shortcut to perform end-to-end image jailbreaks on Chameleon, with an ASR of up to 72.5%, but it does not transfer across models.

    This is a jailbreak attack paper targeting multimodal fusion models. Multimodal fusion models (such as Chameleon) tokenize images into discrete tokens, and the quantization step is non-differentiable, so images cannot be directly continuously gradient-optimized as in adapter-based models.

    • Method: The authors propose tokenizer shortcut—using a 2-layer fully connected network to map the pre-quantization image embeddings of the VQ-VAE into the LLM embedding space (embedding shortcut) or a soft one-hot space (1-hot shortcut), establishing a differentiable path and then using gradient descent to optimize the image, maximizing the probability of the non-refusal prefix associated with the prompt; the 1-hot shortcut requires a softmax temperature of 6 to avoid vanishing gradients.
    • Direct attack: On Chameleon-7B and 80 prompts from JailbreakBench, the 1-hot shortcut achieves an ASR of 71.3%, higher than the 63.8% of the GCG text attack; the authors estimate its compute to be about 1/3 of GCG (Table 3).
    • Transfer attack: For a single universal image optimized on 10 or 20 held-out prompts, the embedding shortcut achieves an ASR of 72.5% on unseen prompts, comparable to per-prompt optimization; however, the Refusal Direction baseline reaches 81.3% (Table 4).
    • Defenses: The image attack does not increase prompt perplexity (∆ PPL is negative) and can bypass perplexity filtering; however, Circuit Breakers trained only on text can reduce the image attack ASR to 0.0%–10.0%, and the authors state that representation engineering defenses can transfer to image inputs.
    • Cross-model: Image jailbreaks largely do not transfer—ASR is 0.0% on Chameleon-30B and only 10.0% on LLaVA-1.6 (baseline 8.8%), whereas GCG reaches 41.3% on LLaVA-1.6 (Table 5).
    • Authors' conclusion: The authors believe image jailbreaks have potential and that optimization may be smoother than for text, but hyperparameter sensitivity and cross-model transfer remain open problems, and attack dynamics may change with new models.

Related papers

Show 3 more papers
Read originalarxiv.org