BlueSuffix: Reinforced Blue Teaming for Vision-Language Models Against Jailbreak Attacks

## Abstract

Abstract Despite their superb multimodal capabilities, Vision-Language Models (VLMs) have been shown to be vulnerable to jailbreak attacks, which are inference-time attacks that induce the model to output harmful responses with tricky prompts. It is thus essential to defend VLMs against potential jailbreaks for their trustworthy deployment in real-world applications.
In this work, we focus on black-box defense for VLMs against jailbreak attacks.
Existing black-box defense methods are either unimodal or bimodal. Unimodal methods enhance either the vision or language module of the VLM, while bimodal methods robustify the model through text-image representation realignment.
However, these methods suffer from two limitations:
1) they fail to fully exploit the cross-modal information, or 2) they degrade the model performance on benign inputs.
To address these limitations, we propose a novel blue-team method BlueSuffix that defends the black-box target VLM against jailbreak attacks without compromising its performance. BlueSuffix includes three key components: 1) a visual purifier against jailbreak images, 2) a textual purifier against jailbreak texts, and 3) a blue-team suffix generator fine-tuned via reinforcement learning for enhancing cross-modal robustness. We empirically show on three VLMs (LLaVA, MiniGPT-4, and Gemini) and two safety benchmarks (MM-SafetyBench and RedTeam-2K) that BlueSuffix outperforms the baseline defenses by a significant margin.
Our BlueSuffix opens up a promising direction for defending VLMs against jailbreak attacks. † † † Correspondence to Xingjun Ma: <xingjunma@fudan.edu.cn>

## 1 Introduction

There has been a notable surge in research focusing on incorporating multimodal capabilities into Large Language Models (LLMs), leading to the emergence of Vision-Language Models (VLMs), such as OpenAI’s GPT-4o (Achiam et al., ) and Google’s Gemini 1.5 (Reid et al., ).
VLMs leverage the combination of visual and textual modalities to perform a broad range of tasks, including image captioning and visual question answering, thereby extending the functionality of traditional LLMs.
However, the integration of multi-modality introduces additional attack surfaces, bringing new security and safety challenges, particularly in their vulnerability to cross-modal jailbreak attacks that exploit maliciously crafted multimodal inputs to subvert the target VLM’s behaviors
(Carlini et al., ; Bagdasaryan et al., ; Qi et al., ; Bailey et al., ; Gong et al., ; Wang et al., ; Fang et al., ; Ying et al., ).
Addressing these vulnerabilities is thus critical for ensuring VLMs’ safe and reliable application in real-world scenarios.

Existing defense methods against VLM jailbreak attacks can be roughly divided into two types: 1) *white-box defense* that robustifies the VLM in the parameter space via adversarial training or fine-tuning, and 2) *black-box defense* that safeguards the input/output of the model in the prompt/response space using filters, detectors, or safety-driven system prompts. Arguably, black-box defense is more flexible and practical than white-box defense as it can protect the target VLM without accessing its parameters.
In this paper, we focus on black-box defense against VLM jailbreak attacks.

Existing black-box defense methods are either unimodal or bimodal. Unimodal defenses focus on defending either the textual or visual prompts. To defend textual prompts, a recent work leveraged safety-driven system prompts to instruct the model to detect and reject harmful textual prompts (Zheng et al., ). To defend visual prompts, one could purify potential jailbreak images using a denoising model (Nie et al., ).
However, unimodal defenses can only protect one single modality of the target VLM, thus failing to fully exploit the multimodal information in the inputs.
Bimodal defense, on the other hand, can address both unimodal and cross-modal vulnerabilities. For example, the Jailguard defense (Zhang et al., ) introduces a mutation-based framework to detect malicious textual and visual prompts. Similar to Jailguard, the CIDER defense utilizes the cross-modal similarity between harmful texts and adversarial images to perform the detection
(Xu et al., ). While both methods are effective, Jailguard depends heavily on the original alignment of VLMs while CIDER hurts the model’s performance on benign inputs. Moreover, Jailguard and CIDER can only detect and reject malicious prompts rather than robustify the model to respond normally and correctly in the presence of jailbreak inputs. It is also worth noting that no existing defense methods can defend against universal adversarial perturbation (UAP) based jailbreak attacks. We believe addressing these limitations of existing defenses is crucial for developing stronger defense methods against VLM jailbreaks.

In this work, we focus on black-box defense against VLM jailbreaks and take a *blue-team* approach by training a blue-team suffix generator using reinforcement learning. Specifically, we propose a novel defense framework named BlueSuffix that leverages both unimodal and bimodal techniques to safeguard VLMs under a black-box defense setting, as illustrated in Figure 1.
BlueSuffix has three key components: 1) a diffusion-based image purifier to defend the visual input against adversarial perturbations, 2) an LLM-based text purifier to rewrite the textual prompt following a certain template, enabling the target VLM to identify harmful content without altering its original meaning, and 3) an LLM-based blue-team suffix generator, which is fine-tuned from a lightweight language model using reinforcement learning to incorporate both visual and textual information for cross-modal robustness. In BlueSuffix, the image and text purifiers address the unimodal vulnerabilities of VLMs, while the blue-team suffix generator tackles the cross-modal vulnerabilities.

When training the blue-team suffix generator, we propose a novel cross-modal optimization strategy based on reinforcement learning to fine-tune a lightweight LLM. The optimization process takes the image and text purifiers into consideration to explore cross-model robustness.
Specifically, it fine-tunes a GPT-2 based blue-team suffix generator to maximize the expected safety score given by an LLM-based judge (e.g., GPT-4o or Llama 3).
The generated blue-team suffix does not affect the readability of the original textual prompt nor compromise the quality of the model’s response.
During inference time, a defensive textual suffix will be generated (by the blue-team suffix generator), appended to the purified text input (by the text purifier), and fed into the target VLM along with the purified image input (by the image purifier). Unlike previous bimodal defenses, our approach does not focus on detecting malicious inputs. Instead, it mitigates malicious prompts through purification processes and the addition of blue-team suffixes. This makes it easier for the target model to recognize and respond to them correctly, making our method more practical for real-world scenarios.

Figure: Figure 1: An illustration of our BlueSuffix defense. A pair of image-text jailbreak prompts (left) can compromise the target VLM to output harmful content (top right). However, the purified and suffixed prompts by our BlueSuffix (middle) lose their adversarial property (bottom right).
Refer to caption: x1.png

In summary, our main contributions are:

- •
We propose a novel blue-team method, BlueSuffix, designed to protect black-box VLMs from generating harmful content in response to jailbreak prompts, particularly against universal adversarial visual triggers.
- •
In BlueSuffix, we propose a cross-modal optimization method that fine-tunes the blue-team suffix generator through reinforcement learning, incorporating an LLM-based text purifier and a diffusion-based image purifier. The resulting blue-team suffix generator is lightweight and effectively preserves the model’s original alignment, ensuring minimal negative impact on performance with benign inputs.
- •
We empirically demonstrate the effectiveness of BlueSuffix, which achieves a $\sim 70\%$ and $\sim 50\%$ reduction in Attack Success Rate (ASR) against a state-of-the-art attack on open-source and commercial VLMs, respectively. This performance establishes a new benchmark in defending against VLM jailbreak attacks, significantly surpassing previous results.

## 2 Related Work

#### Large Vision-Language Models

VLMs are vision-integrated LLMs designed to process both visual and textual data, generating textual outputs for multimodal tasks.
A typical VLM architecture comprises three key components: an image encoder, a text encoder, and a fusion module to integrate information from both encoders.
For instance, MiniGPT-4 (Zhu et al., ) aligns visual data with a language model via a linear projection layer, connecting the pre-trained Vision Transformer (ViT) (Dosovitskiy, ) and Q-Former (Li et al., ) to a frozen Vicuna model (Chiang et al., ).
Similarly, LLaVA (Liu et al., ) links the CLIP visual encoder (Radford et al., ) with the Vicuna model (Chiang et al., ) for general-purpose visual and language understanding.
Building upon the pre-trained BLIP-2 models (Li et al., ), InstructionBLIP (Dai et al., ) conducts a comprehensive study on vision-language instruction tuning and employs the Q-Former to synchronize visual features with the language model, thus boosting the model’s ability to interpret and respond to instruction-based queries.

#### Jailbreak Attacks on VLMs

Jailbreak attacks aim to design malicious prompts that can bypass the safety mechanisms of an LLM or VLM to make it output harmful content.
In the context of VLMs, jailbreak attacks are typically executed through carefully crafted malicious prompts that exploit vulnerabilities of the target model. Existing attack methods are either unimodal or bimodal. For unimodal attack, Zou et al. () introduced a white-box method to optimize a universal adversarial suffix using the greedy coordinate gradient. Apart from universal adversarial suffixes, jailbreak can also be launched by template completion (Li et al., ; Kang et al., ), prompt rewriting (Yuan et al., ; Yong et al., ), or LLM-based generation (Deng et al., ; Zeng et al., ). The above methods were all initially designed for LLMs. Undoubtedly, jailbreak can also be achieved via adversarial images (Carlini et al., ; Niu et al., ).
Subsequently, Qi et al. () introduced a universal adversarial visual input.
However, these methods are all unimodal attacks that fail to fully exploit the multimodal information in VLMs. Wang et al. () employed dual optimization objectives to guide the generation of effective multimodal jailbreak prompts (i.e., chained texts and images). However, this attack only works in a white-box setting. Ying et al. () proposed a Bi-Modal Adversarial Prompt Attack (BAP) to optimize query-agnostic universal adversarial perturbations (UAPs) and rewrite malicious textual prompts. BAP demonstrates universal attacking abilities across different scenarios.

#### Jailbreak Defenses for VLMs

Accordingly, existing defenses against VLM jailbreak can also be categorized into unimodal and bimodal methods. For unimodal defense, white-box defense techniques can be applied to robustify the language model of VLM, for example instruction tuning (Bianchi et al., ; Deng et al., ), Reinforcement Learning from Human Feedback (RLHF) (Ouyang et al., ; Bai et al., ; Siththaranjan et al., ), gradient analysis (Xie et al., ; Xu et al., ), refinement (Kim et al., ; Zhang et al., ), and proxy defense (Zeng et al., ; Struppek et al., ).
While white-box defenses require full access to the model parameters, black-box defenses can protect the target model simply based on its inputs and outputs. Compared to white-box defenses, black-box defenses are often more flexible, lightweight, and effective.
Existing black-box defenses for VLMs include prompt detection (Jain et al., ; Alon & Kamfonas, ; Liu et al., ), prompt perturbation (Cao et al., ; Robey et al., ; Zhou et al., ; Liu et al., ), and safety system prompt safeguards (Sharma et al., ; Zou et al., ; Zheng et al., ).
The above-mentioned defense methods thus far are all language-based defenses. Apart from these methods, image denoising/purification methods can be applied to fix the jailbreak images. A well-known method is the DiffPure (Nie et al., ) which leverages a diffusion model to remove potential adversarial perturbations from the input images. However, this method only addresses the robustness of the visual modality.

Conversely, Jailguard (Zhang et al., ) trained a bimodal detector to identify malicious texts or images based on input mutation.
Similar to Jailguard, CIDER (Xu et al., ) leveraged cross-modal similarity between harmful queries and adversarial images to detect malicious inputs. While Jailguard’s performance heavily depends on the original alignment of VLMs, CIDER tends to negatively impact the model’s performance on benign queries. To address these limitations, in this work, we propose a novel blue-team framework BlueSuffix for black-box VLMs.

## 3 Proposed Defense

In this section, we first introduce the threat model and problem definition, and then present our proposed defense method BlueSuffix and its key components.

### 3.1 Preliminaries

#### Threat Model

We adopt a *black-box defense model* where the defender does not have access to the internal structures nor parameters of the target VLM. This means that the defender has to design external defense mechanisms to improve the model’s resistance to multimodal jailbreak prompts. We assume the defender only has a one-shot opportunity to sanitize any potential jailbreak inputs while maintaining the model’s performance on benign inputs.
This allows an efficient plug-and-play deployment of the defense method to safeguard different VLMs and their API services. We assume the attackers design their jailbreak prompts secretly and independently and then feed the prompts (maybe mixed with benign queries) into the target VLM.

#### Problem Definition

We denote the target VLM as $F$, its visual module as $F_{v}$(e.g., CLIP visual encoder (Radford et al., )), textual module as $F_{t}$ (e.g., Vicuna (Chiang et al., )), and vision-language connector as $\mathcal{I}$ (e.g., cross-attention or projection layer).
Given an input pair of a visual prompt $x_{v}$ (image) and a textual prompt $x_{t}$ (text), the visual module $F_{v}$ encodes $x_{v}$ into a latent representation $h_{v}$, which is then fused with the textual prompt $x_{t}$ via the connector $\mathcal{I}$. The fusion operation allows the textual module $F_{t}$ to perform both comprehension and generation tasks based on the multimodal features $\mathcal{I}(h_{v},x_{t})$. This process can be formulated as:

$$ $h_{v}=F_{v}(x_{v}),\;y\sim F_{t}(\mathcal{I}(h_{v},x_{t})),$ (1) $$

where $y$ is the textual output (response) of the model.

A jailbreak attack converts the original prompt into subtle and malicious jailbreak prompts to bypass the safety guardrails of the target VLM while increasing stealthiness.
The attack objective is to maximize the target model’s log-likelihood of generating a harmful response, defined as:

$$ $\max_{\mathcal{A}}\log p(y^{*}|\mathcal{A}(x_{v},x_{t})),$ (2) $$

where $\mathcal{A}$ is an adversarial perturbation function (visual or textual) and $p(y^{*}|\mathcal{A}(x_{v},x_{t}))$ is the probability of model outputting harmful content $y^{*}$. We denote the transformed visual prompt and textual prompt as $x_{v}^{*}$ and $x_{t}^{*}$, that is, $(x_{v}^{*},x_{t}^{*})=\mathcal{A}(x_{v},x_{t})$.

To tackle the above attack, black-box jailbreak defense purifies $x_{v}^{*}$ and $x_{t}^{*}$ before feeding them into the target VLM. The defense objective is to minimize the target model’s log-likelihood of generating the harmful response, defined as:

$$ $\min_{\mathcal{D}}\log p(y^{*}|\mathcal{D}(x_{v}^{*},x_{t}^{*})),$ (3) $$

where $\mathcal{D}$ is the defensive purifier (visual or textual). We denote the purified visual and textual prompts as $\hat{x}_{v}$ and $\hat{x}_{t}$, that is, $(\hat{x}_{v},\hat{x}_{t})=\mathcal{D}(x_{v}^{*},x_{t}^{*})$.

### 3.2 BlueSuffix

As shown in Figure 2, our BlueSuffix is a bimodal defense method that comprises three key components: 1) a diffusion-based image purifier to defend the visual input against potential (universal) adversarial perturbation(s), 2) an LLM-based prompt purifier to defend the textual input against malicious queries, and 3) an LLM-based blue-team suffix generator that employs bimodal gradients to achieve cross-modal robustness.
It is important to note that our method aims to assist the target VLM in automatically identifying the harmful request within the inputs and generating a positive response accordingly, rather than acting as a malicious prompt detector.

Figure: Figure 2: An overview of BlueSuffix and its three key components: 1) an image purifier, 2) an LLM-based text purifier, and 3) a lightweight LLM-based (e.g., GPT-2) blue-team suffix generator. The suffix generator is trained to maximize the expected safety score given by an LLM-based judge.
Refer to caption: x2.png

#### Diffusion-based Image Purifier

As we focus on defending black-box VLMs, a model-agnostic image purifier is needed. Here, we leverage a diffusion-based method (Nie et al., ) to purify the jailbreak images. It consists of a diffusion process and a reverse diffusion process.
In the diffusion process, the adversarial image $x_{v}^{*}$ is progressively corrupted by adding noise over time. This transforms the image into a highly noisy version through the following diffusion equation:

$$ $x_{s}=\sqrt{\alpha_{s}}x_{s-1}+\sqrt{1-\alpha_{s}}\epsilon,\ \text{for}\ s=1,2 ,\dots,S,\ \text{where}\ \epsilon\sim\mathcal{N}(0,I),\ x_{0}=x_{v}^{*}.$ (4) $$

Here, $\alpha_{s}$ controls the amount of noise added at time step $s$, with $\epsilon$ representing noise sampled from a standard normal distribution. As $s$ increases, more noise is added to the input, making it progressively more random.
In the reverse diffusion process, the model iteratively removes noise from the noisy input $x_{s}$ generated in the diffusion process. Starting from $\hat{x}_{s}=x_{S}$, the diffusion model performs a step-by-step denoising process to recover a clean sample $\hat{x}_{v}$. This is done using the following reverse diffusion equation:

$$ $\hat{x}_{s-1}=f_{\theta}(\hat{x}_{s},s),\ \text{for}\ s=S,S-1,\dots,1,$ (5) $$

where $f_{\theta}$ represents the denoising function parameterized by $\theta$. This process gradually removes the noise introduced in the diffusion process, ultimately producing a clean sample $\hat{x}_{v}=\hat{x}_{0}$.

#### LLM-based Text Purifier

We design an LLM-based text purifier to rewrite the adversarial textual prompt $x_{t}^{*}$ without altering its meaning. The purifier achieves this by adding more detailed descriptions, resulting in a rewritten textual prompt $\hat{x}_{t}$.
Like the image purifier, the text purifier should also be model-agnostic. We expect the rewritten textual prompt to meet the following criteria:

$$ $\min_{\hat{x}_{t}}\log p(y^{*}|(\cdot,\hat{x}_{t})).$ (6) $$

We utilize GPT-4o (Achiam et al., ) to achieve the above objective with a rewritten template. As GPT-4o is a commercial model, we also test the open-source model Llama-3-8B-Instruct (AI@Meta, ) as the text purifier. The results are referred to Appendix B which show that the prompts rewritten using LLaMA demonstrate a comparable performance to those by GPT-4o, in terms of both semantic expression and defense effectiveness.

#### LLM-based Blue-team Suffix Generator

We denote the suffix generator as $\pi$, which receives a rewritten textual prompt $\hat{x}_{t}$ and generates a fixed-length suffix $x_{s}\sim\pi(\cdot|\hat{x}_{t})$. The suffix will be appended to the rewritten textual prompt as the final textual input as the target VLM. We denote the response of the target VLM as $y$ and leverage an LLM (GPT-4o or Llama-3-8B-Instruct) to judge the response.
The output of the judge is a safety score which will then be used as the reward model $R(\cdot)$. The reward is either 1 or 0, i.e., $R(y)\in\{0,1\}$, with “1” representing benign response and “0” representing harmful response.

We also utilize $\pi^{\text{ref}}$, a pre-trained LLM-based policy, as a reference for $\pi$. $\pi^{\text{ref}}$ starts with the same parameters as $\pi$ but maintains fixed weights. In the following, we formulate the objective of $\pi$ as:

$$ $\max_{\pi}\mathbb{E}_{x_{s}\sim\pi(\cdot|\hat{x}_{t})}[R(y)-\beta D_{KL}(\pi( \cdot|\hat{x}_{t})\parallel\pi^{\text{ref}}(\cdot|\hat{x}_{t}))],$ (7) $$

where $D_{KL}$ is the Kullback-Leibler (KL) divergence between the current policy $\pi(\cdot|\hat{x}_{t})$ and the reference policy $\pi^{\text{ref}}(\cdot|\hat{x}_{t})$ as a penalty, and $\beta$ is a coefficient hyperparameter.
The KL divergence term can help prevent $\pi$ from mode collapse, while the $\beta$ coefficient balances the two terms, i.e., maximizing reward vs. staying close to the reference policy.

We fine-tune a GPT-2 model (Radford et al., ) for the suffix generator. When training the generator, the reward takes full consideration of both the textual and visual prompts as it is defined by the response of the target model. By fine-tuning GPT-2 to generate blue-team suffixes that can reduce the impact of the multimodal prompts, our method can help enhance cross-modal robustness. The detailed fine-tuning procedure of our suffix generator is summarized in Algorithm 1.

Figure: Algorithm 1 Fine-tuning the Blue-Team Suffix Generator

## 4 Experiments

In this section, we evaluate our BlueSuffix defense on three VLMs and two safety benchmark datasets, focusing on its effectiveness, transferability, and robustness.

### 4.1 Experimental Setup

#### Target VLMs and Safety Datasets

We test our defense on three VLMs, including two commonly used open-source large VLMs LLaVA (LLaVA-v1.5-7B) (Liu et al., ) and MiniGPT-4 (Vicuna) (Zhu et al., ), and a commercial black-box VLM Gemini (gemini-1.5-flash) (Reid et al., ).
We run our experiments on two popular safety benchmarks: MM-SafetyBench (Liu et al., ) and RedTeam-2K (Luo et al., ).
MM-SafetyBench is a widely used safety benchmark dataset that consists of $1,680$ questions across 13 safety topics (unsafe scenarios) listed by OpenAI, such as privacy violation, fraudulent, and illegal activities.
RedTeam-2K is a meticulously curated collection of $2,000$ harmful queries aimed at identifying alignment vulnerabilities in VLMs. It spans 16 safety policies and incorporates queries from 8 distinct sources. We evaluate the effectiveness of the defense methods on MM-SafetyBench and test its transferability to RedTeam-2K. We attack the target VLM using two types of attacks: 1) vanilla attack that directly inputs the jailbreak texts with the clean images into the model, and 2) a state-of-the-art bimodal attack BAP, which converts the clean images into jailbreak images via universal adversarial perturbation (UAP) while enhances the original jailbreak texts using ChatGPT.

#### Baseline Defenses

We compare our method with two black-box defense methods: DiffPure (Nie et al., ) and Safety Prompt Zheng et al. (). DiffPure is a general-purpose defense method that uses a diffusion model to remove the visual adversarial perturbations. DiffPure can be applied to purify any type of malicious input images, thus can be applied to purify jailbreak images. Safety Prompt inserts a defensive system prompt in front of the textual prompt, which acts as a “hint” to the target VLMs. We also combine DiffPure and Safety Prompt into a bimodal defense as a baseline. Note that we did not compare with Jailguard as it is a detection method that detects and rejects potential jailbreaks for the target model. Conversely, our defense weakens the malicious inputs such that the target model can identify the risk by itself and response robustly.

#### Performance Metric

We take the Attack Success Rate (ASR) as the primary performance metric. ASR quantifies the risk of the target model generating harmful content in the presence of jailbreak inputs. As the output of VLM are texts, we need a external judge to determine whether the response contains harmful content. Here, we use GPT-4o as the judge and design a system prompt to ask GPT-4o to classify the response: harmful vs. benign.

#### Implementation Details of BlueSuffix

For the image purifier, we directly adopt the denoising diffusion model released by DiffPure, as it has been shown to have high effectiveness and generality. For the text purifier, we test two LLM models: Llama-3-8B-Instruct (AI@Meta, ) and GPT-4o (Achiam et al., )). The text purifier is instructed to rewrite the text input without altering its original meaning (the prompt template is provided in the Appendix C).
The blue suffix generator is fine-tuned from a pre-trained GPT-2 using Proximal Policy Optimization (PPO) on hard jailbreak prompts crafted by the BAP attack (Ying et al., ) on the “financial advice” topic from the MM-SafetyBench. Please note that fine-tuned GPT-2 will be applied to other topics and other dataset (i.e., RedTeam-2K) to test its generalizability. The fine-tuning batch size is set to 32. The reward given by the LLM judge (i.e., GPT-4o) is “1” if the model’s response is benign, “0” otherwise. The fine-tuning can be stopped until the expected safety score exceeds 0.95, for about 300 epochs.

### 4.2 Main Results

#### Defending Open-source VLMs

We first evaluate our defense on two open-source VLMs: LLaVA (LLaVA-v1.5-7B) (Liu et al., ) and MiniGPT-4 (Vicuna) (Zhu et al., ), using the MM-SafetyBench dataset (Liu et al., ).
Our experiments cover 13 categories of jailbreak prompts from this dataset, with results summarized in Table 1 (top subtable).
Overall, BlueSuffix reduces the ASR of BAP attacks by $56.37\%$ on the LLaVA model (from $61.02\%$ to $4.65\%$) and by $52.89\%$ on MiniGPT-4 (from $62.26\%$ to $9.37\%$), on average.
Particularly, when compared with DiffPure (Nie et al., ) and Safety Prompt (Zheng et al., ), our method demonstrates at least 23% robustness improvement (56.37% vs. 32.66%) on LLaVA and 12% on MiniGPT-4(52.89% vs. 40.84%). Such a huge improvement demonstrates the advantage of bimodal defense over unimodal defense. An interesting observation about unimodal defense is that textual defense appears to be more effective than visual defense. When combined, the “DiffPure + Safety Prompt” method exhibits much greater ASR reduction on both LLaVA and MiniGPT-4, showcasing the strength of bimodal defense. However, our BlueSuffix still beats “DiffPure + Safety Prompt” by a considerable margin. This indicates the importance of the suffix generator for cross-modal robustness.

Table: Table 1: The ASR (%) achieved by different defense methods against BAP attack across the 13 jailbreak topics (first column) from MM-SafetyBench. The “(↓)” indicates the reduction of ASR compared to no defense. For target VLMs, the format “Model A (Model B)” means defending black-box Model A against jailbreak images generated by BAP on white-box Model B (as UAP generation is white-box).

#### Defending Commercial VLMs

Here, we test our defense method on a commercial VLM: Gemini (gemini-1.5-flash) (Reid et al., ). As Gemini is a black-box to us, this experiment evaluates the transferability of our defense. We evaluate the defense effectiveness under two attack scenarios involving visual UAPs generated by BAP based on either LLaVA or MiniGPT-4.
The results are reported in Table 1 (bottom subtable).
As can be observed, compared with no defense, the adoption of our BlueSuffix reduces the ASR by more than $40\%$ under both attack scenarios. It is worth mentioning that the combined “DiffPure + Safety Prompt” defense works quite well for Gemini. This is because the safety mechanism of Gemini is much stronger than the two open-source models, thus can identify the potential risks more easily with the help of combined defenses. It is also the case for unimodal defenses DiffPure and Safety Prompt, as verified by the much lower ASR results on Gemini (compared to the two open-source models). Gemini performs robustly against 5 jailbreak topics including “Political Lobbying (PL)”, “Legal Opinion (LO)”, “Financial Advice (FA), “Health Consultation (HC)”, and “Government Decision (GD)” (the full names of other abbreviations can be found in the Appendix A) even without defense.

Comparing the results across the 13 jailbreak topics, we identify three interesting observations: 1) Certain topics, such as “FA” and “LO” are relatively easier to defend against; 2) Some topics exhibit greater resistance to either visual or textual defenses. For instance, “Privacy Violence (PV)” proves more challenging to defend against using visual purification, while “Physical Harm (PH)” is more resistant to textual defense; and 3) A no-defense scenario is not necessarily worse than any defense strategy, as seen with “FA”. This is because the target model can detect the original jailbreak texts, yet it often generates a harmful response with a disclaimer when those texts are modified by the text purifier, as illustrated in Figure 9 in Appendix E. However, the blue-team suffix generated by our method can mitigate this issue to some extent.

Figure: Figure 3: Component ablation of BlueSuffix.
Refer to caption: x3.png

### 4.3 Ablation Studies

#### Component Ablation

Here, we conduct ablation studies to demonstrate the necessity of each component in BlueSuffix. Figure 3 reports the defense results of the ‘text purifier’, ‘text purifier + suffix generator’, ‘text purifier + image purifier’, ‘suffix generator + image purifier’, and the full BlueSuffix. We report the average ASR across the 13 categories of jailbreak prompts from the MM-SafetyBench. Detailed ASR results for each individual category can be found in Appendix E.

We start our analysis with the text purifier which is already a better defense technique than the Safety Prompt. The results in Figure 3 indicate that our text purifier itself is quite effective, compared to the no defense results in Table 1. In practice, we observed that it can rewrite the majority of jailbreak prompts, enabling the target VLMs to accurately identify the presence of harmful content in the rewritten textual prompts. When combined with the suffix generator, the ASRs are further reduced substantially. However, ‘text purifier + image purifier’ is less effective than ‘text purifier + suffix generator’, meaning that our blue-team suffix generator plays a more important role than the image purifier. Comparing ‘text purifier + image purifier’ with ‘suffix generator + image purifier’, we find that the latter outperforms the former on 3/4 scenarios including MiniGPT-4, Gemini (LLaVA), and Gemini (MiniGPT-4), but not on LLaVA. This indicates that our blue-team suffix generator is a stronger defense technique than the text purifier.

#### Impact on Benign Prompts

We also evaluate our defense on benign prompts using LLaVA. We randomly select 500 textual prompts from the AlpacaEval dataset (Li et al., ), each paired with a benign image. We define the Benign Passing Rate (BPR) as the proportion of responses that accurately address the benign prompt after applying the defense, as assessed by GPT-4o. Our method, BlueSuffix, achieved a BPR of 78.00%, which is only 3.60% lower than the original prompts’ BPR of 81.60%. Note that the BPR of the original prompts is not 100% due to the difficulty in assessing the responses using GPT-4o. Compared to other baselines, our method closely aligns with ”DiffPure” (78.80%), which does not alter the text prompts, while outperforming ”Safety Prompt” (74.80%) and ”DiffPure + Safety Prompt” (74.00%). These results demonstrate that our defense has minimal impact on benign prompts.

#### Showcasing the Purified Prompts

Figure 4 illustrates six example inputs (three jailbreaks, three benign) purified by our BlueSuffix, with more examples can be found in Figure 7 and 8, Appendix D. As shown in Figure 4, the input image appears almost the same after purification by our image purifier, the rewritten texts are more detailed with many questions around the key concepts in the original texts, while the blue suffixes provide a certain type of hint or reminder for the target VLM. It also shows that our defense largely preserves the original meaning of the prompt, indicating a minimal impact on the benign inputs. Moreover, the blue-team suffixes generated by our suffix generator also exhibit high diversity.

Figure: Figure 4: *Top-3 Rows*: three jailbreak image-text pairs (left) and their purified version by our BlueSuffix; *Bottom-3 Rows*: three pairs of benign prompts and their purified version.
Refer to caption: x4.png

### 4.4 Transferability Analysis

To assess the transferability of our defense, here we apply it to defend both open-source and commercial VLMs on the RedTeam-2K dataset. It is worth noting that the blue-team suffix generator of our method was trained on the MM-SafetyBench dataset which is completely different from RedTeam-2K. This means that, in this transfer setting, the jailbreak queries from the RedTeam-2K dataset were entirely unseen to our BlueSuffix. We test the defense against both the vanilla attack (which uses the original jailbreak texts with the clean images) and the BAP attack, and report the results of no defense and our BlueSuffix in Table 2.

It is evident that our defense method significantly reduces the ASR against both the vanilla and BAP attacks in all scenarios. Particularly, it achieved the highest ASR reduction on LLaVA, decreasing the ASR from 80.20% to 7.05%. Even on the commercial model Gemini, it successfully cripples the attack from an ASR of above 50% to $\sim 2.50\%$. This confirms the transferability of our method in defending against unseen jailbreaks, especially those advanced bimodal jailbreak prompts generated by the BAP attack. The significance of our defense is more pronounced on open-source models LLaVA and MiniGPT-4, reducing the ASR of BAP by more than 67%.

Our method also exhibits strong transferability across different target VLMs. Our GPT-2 based blue-team suffix generator used in this and all previous experiments was trained only based on the responses of LLaVA. Moreover, both the text purifier and image purifier adopted in BlueSuffix are generic purification models that are attack-agnostic, target model-agnostic, and fixed during all the experiments. Therefore, the high effectiveness of BlueSuffix in all the experiments shown in Table 1 and 2 highlights its high transferability in a more general scope.

Table: Table 2: Transferability to the RedTeam-2K dataset: the ASR (%) of our BlueSuffix in defending different target VLMs against Vanilla and BAP attacks on RedTeam-2K. The format “Model A (Model B)” in the second row means defending Model A against jailbreak images generated by BAP on white-box Model B (as UAP requires white-box).

### 4.5 Robustness to an Adaptive Attack

Here, we demonstrate the robustness of BlueSuffix against a potential adaptive attack. We assume the attacker is fully aware of all components of our defense method, including the fine-tuned suffix generator. This enables them to reapply the BAP attack on the purified textual and visual prompts generated by our method, thereby attempting to enhance the attack and bypass our defense. We evaluate this adaptive BAP on the LLaVA model using the MM-SafetyBench dataset, with results presented in Table 3. Importantly, the newly generated jailbreaks will be purified again by BlueSuffix before being input into the target VLM.
It shows clearly that our defense is highly robust to this adaptive attack, which can only increase the ASR by less than 1%. While we recognize the potential for more advanced future attacks that may circumvent our defense, BlueSuffix remains the strongest defense available against bimodal jailbreak attacks on VLMs to date.

Table: Table 3: Robustness to an adaptive BAP: the ASR (%) of attacking our BlueSuffix across the 13 topics of MM-SafetyBench using bimodal jailbreaks generated by BAP or an adaptive BAP. The target VLM is LLaVA-v1.5-7B.

## 5 Conclusion

In this work, we investigated the jailbreak vulnerabilities of large Vision-Language Models (VLMs) and introduced a novel blue-team method called BlueSuffix. BlueSuffix consists of three key components: a text purifier, an image purifier, and a blue-team suffix generator. By leveraging existing unimodal purifiers, BlueSuffix trains a lightweight suffix generator to optimize the safety score of the target VLM through reinforcement learning. The blue-team suffix is generated using bimodal gradients and thus can bring cross-model robustness. Our experiments on both open-source and commercial VLMs demonstrate the high effectiveness and transferability of our defense against state-of-the-art multimodal jailbreak attacks. Additionally, BlueSuffix is resilient to an adaptive attack that optimizes jailbreak prompts based on the output of our defense. Our work proves that current VLMs, including black-box models, can be effectively defended using blue-team methods, highlighting the promise of such approaches for building robust and secure VLMs against advanced and unseen jailbreaks.

## Appendix A Detailed Attack Results

In this section, we first present the detailed jailbreak topics in the MM-SafetyBench dataset (Liu et al., ). The query types in the above table are the abbreviations of the 13 jailbreak scenarios, including Illegal Activity, Hate Speech, Malware Generation, Physical Harm, Economic Harm, Fraud, Pornography, Political Lobbying, Privacy Violence, Legal Opinion, Financial Advice, Health Consultation, and Gov. Decision.

First, we report the evaluation results of vanilla attack and BAP attack (Ying et al., ) on the MM-SafetyBench dataset across the evaluated models in Table 4. BAP attack achieves a state-of-the-art ASR even compared with query-dependent multimodal jailbreaks and it demonstrates universal attacking abilities across different scenarios without requiring target scenario samples.

Table: Table 4: The ASR (%) of Vanilla Attack (clean image + original jailbreak prompt) and BAP Attack (universally perturbed adversarial image + multi-turn enhanced jailbreak prompt) against three VLMs. We use jailbreak prompts from MM-SafetyBench across the 13 categories as the original jailbreak prompts for both attacks. The “(↑)” indicates the margin by which BAP attack surpasses the Vanilla attack. The BAP attack significantly increased the ASR across all evaluated models.

## Appendix B LLaMA as the Text Purifier

Here, we test the use of Llama-3-8B-Instruct (AI@Meta, ) for textual prompt rewriting. The prompts rewritten using the LLaMA model demonstrates comparable performance to those rewritten by GPT-4o, both in terms of semantic expression and defense effectiveness, as shown in Table 5. We also present an example of a jailbreaking textual prompt purified by GPT-4o and Llama-3-8B-Instruct in Figure 5. The purified textual prompt consists of two parts: it first repeats the jailbreak prompt, and then emphasizes the potential presence of malicious queries, which gives a hint to the target VLM (bold font).

Table: Table 5: The ASR (%) for two LLM-based text purifiers across 13 categories on the MM-SafetyBench dataset, showing a comparable performance.

Figure: Figure 5: An example of jailbreaking textual prompt purified by GPT-4o and Llama-3-8B-Instruct.
Refer to caption: x5.png

## Appendix C LLM-based Rewrite Template

Figure 6 illustrates the LLM-based rewrite template for the text purifier.

Figure: Figure 6: The LLM-based rewrite template.
Refer to caption: x6.png

## Appendix D Suffix Generator

Figures 7 and 8 demonstrate that our suffix generator produces diverse outputs while maintaining a high degree of compatibility with benign prompts. In Figure 7, the attacker inputs image-text prompts. Our BlueSuffix purifies the visual prompts and rewrites the textual prompts by appending a suffix. With the purified prompt, the target VLM successfully identifies the malicious content and generates a benign response, including an explanation for refusing to answer. Figure 8 shows a user asking the target VLM benign queries. Our BlueSuffix processes these queries effectively, particularly for the textual prompts. The suffix generator produces a positive response that is relevant to the textual prompt, guiding the target VLM in answering the question. Our method focuses on enabling VLMs to independently evaluate queries, making it more practical for real-world scenarios.

Figure: Figure 7: Examples of our BlueSuffix defense. The image-text jailbreak prompts (top) are purified by our BlueSuffix (middle) and the target VLM responses benign content (bottom).
Refer to caption: x7.png

Figure: Figure 8: Examples of our BlueSuffix on benign prompts. The image-text benign prompts (top) are processed by our BlueSuffix (middle), allowing the target VLM to respond to the questions normally. Notably, our suffix generator produces positive suffixes that guide the target VLM in answering the questions.
Refer to caption: x8.png

## Appendix E Additional Results of the Ablation Studies

Here, we present the detailed results of our ablation studies, shown in Tables 6 and 7. Additionally, Figure 9 illustrates an example of a strong jailbreak textual prompt rewritten by GPT-4o.

Table: Table 6: The detailed ASR (%) results of our ablation studies on the open-source VLMs.

Table: Table 7: The detailed ASR (%) results of our ablation studies on the commercial VLM.

Figure: Figure 9: An example of strong jailbreak textual prompt rewritten by GPT-4o.
Refer to caption: x9.png

## Peer Reviews

confidence: 5
contribution: 2
initial_rating: 5
presentation: 3
questions: Please see Weaknesses.
soundness: 3
strengths: 1. The authors analyze the limitations of existing VLM denial defenses from two perspectives: lack of cross-modal information and decreased performance on benign inputs.
2. The proposed method has been validated on both open-source and commercial models, and is easy to implement and deploy.
summary: This paper proposes a defense method for jailbreak attacks on VLMs to protect VLMs from black-box jailbreak attacks. Specifically, the method utilizes a multimodal purifier and reinforcement learning-based text tuning suffixes to enhance the robustness of VLMs.
weaknesses: 1. Insufficient motivation for cross-modal information. The authors emphasize the series of problems caused by insufficient utilization of cross-modal information, but there is no detailed analysis or empirical evidence to prove this flaw. Therefore, the design of the Blue Team suffix generator, based on the above motivation, also lacks direct validation. Could the authors explain what specific manifestations are limited by the lack of cross-modal information and how this generator can alleviate the issue?
2. Limited experimental effects on clean samples. The method proposed by the authors, which is discussed in lines 445-451 of the paper, can improve the performance of benign inputs. However, the improvement is limited and does not surpass that of DiffPure. Therefore, I believe the claim about improving the performance of benign inputs is not effective.
3. Unclear technical contributions. The multimodal purifier proposed by the authors is more about a simple application of image purification technology and GPT-4o, and cannot be considered a significant technical contribution. The authors should elaborate more on the features of the proposed method and its relevance to overcoming limitations.
4. Insufficient ablation analysis. The authors proposed three modules, each designed to address different limitations, but simply stacking these modules and discussing performance changes does not constitute effective validation of the solution. The authors should conduct more detailed assessments of each component of the proposed method.

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 3
questions: 1. Could the author provide some additional experiments to show that the text cleaner and the suffix do not change the original meaning of the instructions?
2. Could the author show the detailed system prompt used for the GPT-4o?
3. Could the author explain why the DiffPure + Safety Prompt method increases ASR? Some sample answers from Gemini may help to explain.
4. Could the author provide more explanation for Figure 4? For the top 3 rows, the prompts do not seem harmful enough.
5. Could the author show the result of some other jailbreak method specified for VLM other than BAP attack?
soundness: 3
strengths: * The paper is very well written and organized. The main points are well explained and easy to follow. The use of cleaners and generators is very interesting.
* The method shows a large reduction in the ASR of VLMs on two datasets. Moreover, the transferability analysis in this method also shows strong transferability across different targets.
summary: This paper focuses on black-box defense for VLMs against jailbreak attacks. This paper proposes the BlueSuffix method to defend against jailbreak attacks. BlueSuffix consists of three main components: 1) a visual purifier against jailbreak images, 2) a textual purifier against jailbreak texts, and 3) a blue team suffix generator fine-tuned via reinforcement learning to improve cross-modal robustness. BlueSuffix adopts a black-box defense model where the defender does not have access to the internal structures nor parameters of the target VLM. BlueSuffix ultimately succeeds in assisting the target VLM to automatically identify the malicious query within the inputs and generate a positive response accordingly, rather than acting as a malicious query detector.
weaknesses: * The paper claims that it can enable the target VLM to identify harmful content without altering the original meaning, although the prompt used for the text purifier instructs the LLM not to alter the original meaning, but no relevant statistics support this claim. See question 1 for more details.
* This paper used GPT-4o as the judge for harmful response, the author should present the system prompt used for the GPT-4o.
* The result in Table 4 for Gemini is strange, why DiffPure + Safety Prompt will increase the ASR compared to each method by itself, please see question 3 for more details.

---

confidence: 5
contribution: 2
initial_rating: 6
presentation: 2
questions: No further questions. I've included all my questions within the **Weakness** section.
soundness: 2
strengths: The paper presents an approach to defending Vision-Language Models (VLMs) against jailbreak attacks, but the originality of the BlueSuffix method is somewhat limited. While it combines existing techniques, such as a diffusion-based image purifier and an LLM-based text purifier, the contributions do not significantly advance the current state of the art in VLM security. The method’s reliance on established concepts may not provide the innovative leap needed to warrant acceptance.

Although the research includes an experimental setup involving multiple VLMs and benchmark datasets, the execution lacks depth. The comparisons with baseline defenses like DiffPure and Safety Prompt are present, but the results do not convincingly demonstrate the effectiveness of BlueSuffix. Furthermore, the ablation studies, while included, do not provide sufficient insights into the importance of each component, leaving questions about the overall robustness and applicability of the proposed method.
summary: This paper focuses on defending Vision-Language Models (VLMs) against jailbreak attacks. It proposes BlueSuffix, a novel blue-team method with three key components: a diffusion-based image purifier, an LLM-based text purifier, and an LLM-based blue-team suffix generator. The method is trained via reinforcement learning to optimize the safety score of the target VLM. Experiments on three VLMs and two safety benchmarks show that BlueSuffix outperforms baseline defenses, achieving significant reductions in Attack Success Rate (ASR). It also has high transferability and is robust against an adaptive attack. The contributions include introducing BlueSuffix, proposing a cross-modal optimization method, and demonstrating the effectiveness and transferability of the defense.
weaknesses: 1.The suffix generator used by the blue team demonstrates effectiveness in certain scenarios; however, its adaptability to a broad range of jailbreak prompts appears limited. Currently, it is primarily trained on specific hard jailbreak prompts related to "financial advice." This focus may hinder its performance when faced with diverse topics or novel prompt structures, particularly if attackers employ innovative semantic or syntactic patterns that the generator is not equipped to handle.

2.The diffusion-based image purifier may struggle to completely eliminate all forms of adversarial perturbations. Some sophisticated adversarial attacks can introduce subtle perturbations that are challenging to detect and remove using the existing diffusion process. This limitation raises concerns about the potential for residual malicious information in the purified images, which could inadvertently provoke harmful responses from the VLM.

3.The evaluation of the proposed defense primarily concentrates on only two types of attacks—vanilla and BAP attacks. This narrow focus may not adequately reflect the variety of real-world jailbreak attacks. Without testing against a broader spectrum of attack strategies, the effectiveness of the defense in more complex scenarios remains uncertain.

4.Although the paper outlines the three components of BlueSuffix, it falls short in analyzing their interactions and how they may enhance one another. Exploring potential synergies could lead to significant improvements in both resource utilization and defense effectiveness, thereby optimizing the overall system performance.

5.There is room for further optimization in the reinforcement learning process aimed at fine-tuning the suffix generator. The current objective function and training methodology might not yield the most effective suffixes. A more systematic exploration of the reference policy and the hyperparameter β could enhance the generator's performance and stability.
6.The discussion surrounding baseline defenses, specifically DiffPure and Safety Prompt, lacks sufficient detail. A clearer explanation of the specific techniques and algorithms employed in these baselines would help readers better understand the distinctions between the proposed method and existing defenses.

7.When analyzing performance across different VLMs such as LLaVA, MiniGPT-4, and Gemini, the paper could benefit from a deeper examination of how each VLM's characteristics influence the defense method's effectiveness. Such insights would aid in assessing the applicability and limitations of the proposed defense across various VLM architectures.

---

confidence: 3
contribution: 3
initial_rating: 3
presentation: 3
questions: 1. Could the authors provide quantitative metrics or systematic evaluation results demonstrating semantic preservation between original and purified prompts with suffixes?

2. Would it be possible to extend the evaluation to include additional VLMs and alternative evaluation metrics to strengthen the robustness claims?
soundness: 3
strengths: 1. The paper presents a well-structured and clearly articulated methodology for VLM defense.
2. The proposed black-box method demonstrates practical value with its low-cost implementation and easy deployment.
3. The experimental design is comprehensive, covering both open-source and commercial VLMs.
summary: This paper addresses jailbreak vulnerabilities in Vision-Language Models (VLMs) by proposing BlueSuffix, a novel black-box defense method that combines visual purification, textual purification, and a reinforcement learning-trained suffix generator. Unlike existing unimodal and bimodal defense approaches, BlueSuffix effectively leverages cross-modal information while maintaining model performance on benign inputs. The method's effectiveness is demonstrated through extensive empirical validation across multiple VLMs (LLaVA, MiniGPT-4, and Gemini) and safety benchmarks (MM-SafetyBench and RedTeam-2K), showing significant improvements over baseline defenses and strong transferability across different models, even under adaptive attack scenarios. This comprehensive approach suggests a practical path forward for deploying robust VLMs in real-world applications.
weaknesses: 1. The claim regarding semantic preservation in blue-team suffix generation requires more rigorous validation. The provided examples suggest potential semantic drift between original and processed prompts.

2. The model selection scope could be expanded. Notable omissions include InstructBLIP and other widely-used VLMs, which would strengthen the generalizability claims.

3. The evaluation methodology relies heavily on GPT-4 judgements. Including additional evaluation tools (e.g., Perspective API) would provide more comprehensive safety assessments.

Meta-review: The recommendation is based on the reviewers' comments, the area chair's evaluation, and the author-reviewer discussion. 

This paper proposes a blue-team method (BlueSuffix) for vision language models, through purification techniques for different modalities. All reviewers find the studied setting novel and the results provide new insights. In the original reviews, the concerns were concentrated on (1) Clarification of the technical contributions; (2) Further empirical evidence to support the claim of cross-modal robustness. 

In the post-rebuttal phase, the authors did a great job of providing additional results and justification. However, this paper is borderline, because no reviewers would strongly champion this paper. Nonetheless, I found that the authors’ rebuttal has successfully addressed the major concerns of reviewers. 

Given the timeliness of the topic (VLM safety), and the practicality of the proposed method, I am leaning toward recommending acceptance of this submission if there is room. I also expect the authors to include the new results and suggested changes during the rebuttal phase to the final version.

Decision: Accept (Poster)