Zer0-Jack: A memory-efficient gradient-based jailbreaking method for black box Multi-modal Large Language Models

Tiejin Chen, Kaishen Wang, Hua Wei

TL;DR

Zer0-Jack is the first direct black-box jailbreak framework for Multi-modal Large Language Models (MLLMs) that uses zeroth-order optimization to generate malicious image perturbations. By employing a novel patch-wise coordinate descent strategy, it achieves near-perfect attack success rates on open-source models and successfully jailbreaks commercial models like GPT-4o while using significantly less memory than white-box alternatives.

What Problem Does This Paper Address?

Jailbreaking MLLMs—tricking them into generating harmful or restricted content—is a major safety concern. Currently, the most effective attacks are white-box, meaning the attacker has full access to the model's internal weights to calculate gradients. However, most powerful models (like GPT-4o) are black-box; their weights are hidden behind APIs.

To attack these, researchers usually rely on transfer attacks: they optimize a malicious input on a local white-box model and hope it "transfers" to the black-box target. This is often unreliable. While Zeroth-Order (ZO) optimization—which estimates gradients by simply querying the model and observing changes in output—is a natural fit for black-box settings, it typically fails on MLLMs. The high dimensionality of images and the massive scale of these models make gradient estimation extremely noisy and computationally expensive.

Methods

The authors introduce Zer0-Jack, which bridges the gap between white-box efficiency and black-box accessibility.

  1. Zeroth-Order Gradient Estimation: Instead of backpropagation, Zer0-Jack uses a two-point estimator. It perturbs an input image in two random directions, queries the model, and uses the difference in the output probability of a target phrase (like "Sure, here is") to estimate the gradient.
  2. Patch Decomposition: To solve the "curse of dimensionality," Zer0-Jack doesn't optimize the whole image at once. It divides the image into smaller patches (e.g., $32 \times 32$ pixels).
  3. Patch-wise Block Coordinate Descent: The algorithm iterates through these patches, optimizing one at a time. This drastically reduces the variance of the gradient estimate and lowers the memory footprint, as the system only needs to track perturbations for a small fraction of the input.
  4. API Exploitation: To attack commercial models that restrict logit access, the authors use the logit_bias parameter in APIs to force the model to reveal the probabilities of specific target tokens, providing the signal needed for the ZO optimization.
The Zer0-Jack workflow: Patch decomposition, ZO gradient estimation, and greedy patch updates.

Datasets

The researchers evaluated Zer0-Jack using two primary benchmarks:

  • Harmful Behaviors Multi-modal Dataset: A set of 100 harmful instructions (e.g., "how to build a bomb") paired with random images from the COCO dataset.
  • MM-SafetyBench-T: A comprehensive benchmark covering 13 safety-critical scenarios (like illegal activities or hate speech) with 168 text-image pairs, where images were generated via Stable Diffusion.

Key Insights and Ideas

  • Images are the Weak Link: The authors found that optimizing images is far more effective for ZO than optimizing text. Because image pixels are continuous, they avoid the "discrete optimization" hurdles that make text-based ZO attacks difficult.
  • Memory Efficiency is a Game Changer: Because Zer0-Jack doesn't require storing gradients for backpropagation, it is incredibly memory-efficient. It can attack a 13B parameter model on a single consumer-grade NVIDIA RTX 4090, whereas white-box methods would require much more expensive hardware.
  • Direct > Transfer: The results confirm that attacking a black-box model directly via queries is significantly more successful than trying to transfer an attack from a different model.

Key Results

  • High Success Rates: Zer0-Jack achieved an Attack Success Rate (ASR) of 98.2% on MiniGPT-4 and 95.8% on LLaVA1.5.
  • Commercial Model Impact: It successfully jailbroke GPT-4o with a 69% ASR, a massive jump from the 18% baseline of unoptimized images.
  • Efficiency: The method is surprisingly fast, requiring only about 55 iterations on average to find a successful jailbreak, which is comparable to white-box speeds.
  • Hardware Accessibility: As shown in the paper's memory analysis, Zer0-Jack reduced memory usage from 31GB to 10GB for a 13B model, enabling attacks on standard consumer GPUs.

Limitations and Future Work

  • API Restrictions: Zer0-Jack requires access to output logits or probabilities. Some commercial APIs (like Anthropic's) do not support this, making them currently immune to this specific approach.
  • Web Interface Limitations: The method cannot directly attack the web-based chat versions of models, as these do not provide the necessary logit data.
  • Cost: While efficient, attacking commercial APIs still costs money (roughly $0.80 per successful jailbreak on GPT-4o).
  • Future Direction: The authors suggest developing methods that can jailbreak models using only the final text response, rather than relying on underlying probability scores.

Summary updated

BibTeX
@inproceedings{chen2026zer,
  author = {Tiejin Chen and Kaishen Wang and Hua Wei},
  title = {{Zer0-Jack: A memory-efficient gradient-based jailbreaking method for black box Multi-modal Large Language Models}},
  booktitle = {EACL (Volume 1: Long Papers)},
  year = {2026},
  doi = {10.18653/v1/2026.eacl-long.202},
}
Figure