thunxxx/MLLM-Jailbreak-evaluation-MMJ-Bench

Python

85

29 commits

updated Mar 30, 2025

See the code

README

MMJ-Bench

MMJ-Bench

MMJ-Bench is a comprehensive benchmark designed to systematically evaluate existing multi-modal jailbreak attacks and defenses in a unified manner. We present jailbreak attack and defense techniques evaluated in our paper in the following tables.

Multi-model jailbreak attack

MethodSourceKey Properties
FigStepFigStep: Jailbreaking Large Vision-language Models via Typographic Visual PromptsGeneration-based
MM-SafetyBenchMM-SafetyBench: A Benchmark for Safety Evaluation of Multimodal Large Language ModelsGeneration-based
VisualAdvVisual Adversarial Examples Jailbreak Aligned Large Language ModelsOptimization-based
ImgJPJailbreaking Attack against Multimodal Large Language ModelOptimization-based
AttackVLMOn Evaluating Adversarial Robustness of Large Vision-Language ModelsGeneation-based
HadesImages are achilles’ heel of alignment: Exploiting visual vulnerabilities for jailbreaking multimodal large language modelsGeneration-based
FC-AttackFC-Attack: Jailbreaking Large Vision-Language Models via Auto-Generated FlowchartsGeneration-based
BEST-OF-NBEST-OF-N JAILBREAKINGGeneration-based
ArondightArondight: Red Teaming Large Vision Language Models with Auto-generated Multi-modal Jailbreak PromptsGeneration-based
ImgTrojanImgTrojan: Jailbreaking Vision-Language Models with ONE ImageOptimization-based
VisualGCGWhite-box Multimodal Jailbreaks Against Large Vision-Language ModelsOptimization-based
IDEATORIDEATOR: Jailbreaking and Benchmarking Large Vision-Language Models Using ThemselvesGeneration-based
Align is not EnoughAlign is not Enough: Multimodal Universal Jailbreak Attack against Multimodal Large Language ModelsOptimization-based
JPPNUtilizing Jailbreak Probability to Attack and Safeguard Multimodal LLMsOptimization-based
SI-AttackJailbreaking Multimodal Large Language Models via Shuffle InconsistencyGeneration-based
MIRAGEMIRAGE: Multimodal Immersive Reasoning and Guided Exploration for Red-Team Jailbreak AttacksGeneration-based
CS-DJDistraction is All You Need for Multimodal Large Language Model JailbreakingOptimization-based

Our evaluation results of MLLMs jailbreak attacks across six models are as follows:

ASR

Multi-modal jailbreak defense

Usage

Installation

conda create -n MMJ-Bench python=3.10
conda create MMJ-Bench
pip install -r requirements.txt
python -m spacy download en_core_web_sm

Step 1 - Generate Test Cases

In the first step, jailbreak attack techniques are used to generate test cases with generate_test_cases.py.

./scripts/generate_test_cases.sh $method_name $behaviors_path $save_dir

Step 2 - Generate Completions

After generating test cases , we can generate completions for a target model with or without defense techniques.

Without defense methods:

./scripts/generate_completions.sh $model_name $behaviors_path $test_cases_path $save_path $max_new_tokens $incremental_update

With defense methods.

./scripts/generate_completions_defense.sh $attack_type $target_model $defense_type

Step 3 - Evaluate Completions

After generate completions from a target_model from Step 2, We will utilize the classifier provided by HarmBench to label whether each completion is an example of its corresponding behavior.

./scripts/evaluate_completions.sh $cls_path $behaviors_path $completions_path $save_path

Acknowledgement and citation

We thank the following open-source reposities.

[1]  https://github.com/centerforaisafety/HarmBench
[2]  https://github.com/thuccslab/figstep
[3]  https://github.com/isXinLiu/MM-SafetyBench
[4]  https://github.com/Unispac/Visual-Adversarial-Examples-Jailbreak-Large-Language-Models
[5]  https://github.com/abc03570128/Jailbreaking-Attack-against-Multimodal-Large-Language-Model
[6]  https://github.com/yunqing-me/AttackVLM
[7]  https://github.com/AoiDragon/HADES
[8]  https://github.com/shiningrain/JailGuard
[9]  https://github.com/SaFoLab-WISC/AdaShield

thunxxx/MLLM-Jailbreak-evaluation-MMJ-Bench

Python

85

29 commits

updated Mar 30, 2025

See the code

README

MMJ-Bench

MMJ-Bench

MMJ-Bench is a comprehensive benchmark designed to systematically evaluate existing multi-modal jailbreak attacks and defenses in a unified manner. We present jailbreak attack and defense techniques evaluated in our paper in the following tables.

Multi-model jailbreak attack

MethodSourceKey Properties
FigStepFigStep: Jailbreaking Large Vision-language Models via Typographic Visual PromptsGeneration-based
MM-SafetyBenchMM-SafetyBench: A Benchmark for Safety Evaluation of Multimodal Large Language ModelsGeneration-based
VisualAdvVisual Adversarial Examples Jailbreak Aligned Large Language ModelsOptimization-based
ImgJPJailbreaking Attack against Multimodal Large Language ModelOptimization-based
AttackVLMOn Evaluating Adversarial Robustness of Large Vision-Language ModelsGeneation-based
HadesImages are achilles’ heel of alignment: Exploiting visual vulnerabilities for jailbreaking multimodal large language modelsGeneration-based
FC-AttackFC-Attack: Jailbreaking Large Vision-Language Models via Auto-Generated FlowchartsGeneration-based
BEST-OF-NBEST-OF-N JAILBREAKINGGeneration-based
ArondightArondight: Red Teaming Large Vision Language Models with Auto-generated Multi-modal Jailbreak PromptsGeneration-based
ImgTrojanImgTrojan: Jailbreaking Vision-Language Models with ONE ImageOptimization-based
VisualGCGWhite-box Multimodal Jailbreaks Against Large Vision-Language ModelsOptimization-based
IDEATORIDEATOR: Jailbreaking and Benchmarking Large Vision-Language Models Using ThemselvesGeneration-based
Align is not EnoughAlign is not Enough: Multimodal Universal Jailbreak Attack against Multimodal Large Language ModelsOptimization-based
JPPNUtilizing Jailbreak Probability to Attack and Safeguard Multimodal LLMsOptimization-based
SI-AttackJailbreaking Multimodal Large Language Models via Shuffle InconsistencyGeneration-based
MIRAGEMIRAGE: Multimodal Immersive Reasoning and Guided Exploration for Red-Team Jailbreak AttacksGeneration-based
CS-DJDistraction is All You Need for Multimodal Large Language Model JailbreakingOptimization-based

Our evaluation results of MLLMs jailbreak attacks across six models are as follows:

ASR

Multi-modal jailbreak defense

Usage

Installation

conda create -n MMJ-Bench python=3.10
conda create MMJ-Bench
pip install -r requirements.txt
python -m spacy download en_core_web_sm

Step 1 - Generate Test Cases

In the first step, jailbreak attack techniques are used to generate test cases with generate_test_cases.py.

./scripts/generate_test_cases.sh $method_name $behaviors_path $save_dir

Step 2 - Generate Completions

After generating test cases , we can generate completions for a target model with or without defense techniques.

Without defense methods:

./scripts/generate_completions.sh $model_name $behaviors_path $test_cases_path $save_path $max_new_tokens $incremental_update

With defense methods.

./scripts/generate_completions_defense.sh $attack_type $target_model $defense_type

Step 3 - Evaluate Completions

After generate completions from a target_model from Step 2, We will utilize the classifier provided by HarmBench to label whether each completion is an example of its corresponding behavior.

./scripts/evaluate_completions.sh $cls_path $behaviors_path $completions_path $save_path

Acknowledgement and citation

We thank the following open-source reposities.

[1]  https://github.com/centerforaisafety/HarmBench
[2]  https://github.com/thuccslab/figstep
[3]  https://github.com/isXinLiu/MM-SafetyBench
[4]  https://github.com/Unispac/Visual-Adversarial-Examples-Jailbreak-Large-Language-Models
[5]  https://github.com/abc03570128/Jailbreaking-Attack-against-Multimodal-Large-Language-Model
[6]  https://github.com/yunqing-me/AttackVLM
[7]  https://github.com/AoiDragon/HADES
[8]  https://github.com/shiningrain/JailGuard
[9]  https://github.com/SaFoLab-WISC/AdaShield