Why does weak-OOD help? A Further Step Towards Understanding Jailbreaking VLMs

Yuxuan Zhou, Yuzhao Peng, Yang Bai, Kuofeng Gao, Yihao Zhang, Yechao Zhang, Xun Chen, Tao Yu, Tao Dai, Shu-Tao Xia · DOI

Introduction

Large Vision-Language Models (VLMs) like GPT-4o and Qwen2.5-VL are designed to be both highly capable and strictly aligned with safety guidelines. However, a persistent vulnerability exists: attackers can bypass safety filters by embedding malicious prompts within images. This research identifies a "Goldilocks zone" for these attacks, termed weak-OOD (Out-of-Distribution). By applying a precise amount of visual distortion, attackers can disable a model's refusal mechanism while maintaining its ability to understand the harmful intent.

The Weak-OOD Phenomenon

The core of the jailbreak success lies in the discrepancy between a model's pre-training and its safety alignment. VLMs are pre-trained on massive datasets to achieve robust "intent perception"—the ability to understand complex visual and textual information. In contrast, safety alignment (learning to refuse harmful requests) typically occurs on much smaller datasets.

This creates a gap: the model's intelligence generalizes to OOD samples far better than its morality does. If an image is too distorted (strong OOD), the model fails to understand the intent. If it is not distorted enough (in-distribution), the safety filter triggers a refusal. "Weak-OOD" represents the middle ground where the safety "alarm" is confused, but the underlying intelligence remains functional.

Mechanistic Interpretability

To understand why this happens, the researchers analyzed hidden layer activations using Principal Component Analysis (PCA). They discovered that harmful intent and the refusal trigger are encoded in distinct regions of the model's latent space.

PCA analysis of hidden layers (17, 19, and 21) showing how shuffled patches (weak-OOD) shift activations relative to the safety class boundary.

As shown in the PCA plots, as the level of shuffling increases (from Shuffle_4 to Shuffle_25), the activations for harmful queries move across the class boundary. In earlier layers (e.g., Layer 17), the separation is less distinct, but by Layer 21, the weak-OOD samples successfully migrate to the "non-refusal" side of the boundary while still retaining enough structure for the model to process the prompt's intent.

The JOCR Attack

Leveraging these insights, the authors developed JOCR (Jailbreak via OCR-Aware Embedded Text Perturbation). VLMs are specifically optimized for Optical Character Recognition (OCR) during pre-training, making their text-reading capabilities an "anchor" of robustness.

JOCR embeds malicious text into images and applies random perturbations to font size, character spacing, word spacing, color, and layout. This specific form of weak-OOD is readable by the model's robust OCR engine but fails to trigger the brittle safety alignment filters. Unlike iterative attacks, JOCR is highly efficient, requiring only a single query to generate the perturbed image.

Key Results and the "Goldilocks Zone"

The effectiveness of weak-OOD attacks follows a consistent bell curve across different models and attack types. Whether shuffling patches (SI-attack) or using MixUp Alpha (JOOD), there is a clear peak where Attack Success Rate (ASR) and toxicity scores are maximized.

Performance curves across various attacks (SI-attack, CS-DJ, JOOD) and models (GPT-4o, GPT-4.1, Doubao-1.6), illustrating the peak success rate in the weak-OOD "Goldilocks zone."

JOCR consistently outperforms state-of-the-art (SOTA) baselines. On the HarmBench dataset, JOCR achieved an ASR of 78.00% on Qwen2.5-VL, significantly higher than the 49.50% achieved by FigStep. The attack proved equally potent against proprietary models like GPT-4o and Gemini 2.5 Pro, often exceeding baseline success rates by over 10%.

Conclusion and Future Work

This study moves beyond identifying vulnerabilities to providing a mechanistic explanation for why VLMs fail. The findings suggest that current safety alignment is too narrow and fails to generalize as broadly as the model's core perceptual capabilities. Future defense strategies must focus on "OOD-aware" safety training to close the gap between a model's intelligence and its refusal mechanisms, ensuring that safety remains robust even when the input deviates from the training distribution.

Summary updated

BibTeX
@misc{zhou2025why,
  author = {Yuxuan Zhou and Yuzhao Peng and Yang Bai and Kuofeng Gao and Yihao Zhang and Yechao Zhang and Xun Chen and Tao Yu and Tao Dai and Shu-Tao Xia},
  title = {{Why does weak-OOD help? A Further Step Towards Understanding Jailbreaking VLMs}},
  year = {2025},
  eprint = {2511.08367},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.08367},
}
Figure