Activation Steering Meets Preference Optimization: Defense Against Jailbreaks in Vision Language Model

Sihao Wu, Gaojie Jin, Wei Huang, Jianhong Wang, Xiaowei Huang

TL;DR

This paper introduces SPO-VLM, a novel two-stage defense for Vision-Language Models (VLMs) that combines activation steering with sequence-level preference optimization. SPO-VLM effectively mitigates jailbreak attacks and reduces toxic outputs while preserving the VLM's core visual understanding capabilities, offering a more balanced approach than existing methods.

What Problem Does This Paper Address?

Vision-Language Models (VLMs) are powerful tools for understanding and reasoning across visual and textual data. However, they are susceptible to "jailbreak" attacks, where carefully crafted prompts can trick the model into generating harmful or restricted content. Existing defenses, like activation steering, often rely on specific prompts to identify "harmful directions" within the model's internal workings. This approach can be brittle, failing to generalize across different attack types and potentially degrading the model's ability to understand images correctly. The paper aims to address this by developing a more robust and generalizable defense that can suppress harmful behaviors without sacrificing visual grounding performance.

Methods

SPO-VLM employs a two-stage defense framework:

  • Stage I: Initialization of Steering Activation: This stage focuses on creating adaptive, layer-specific "steering vectors." Instead of relying on a single, fixed prompt, these vectors are derived from diverse datasets and capture various attribute-specific "harmful directions." This allows for a more generalized suppression of unwanted behaviors during inference. The final steering vector is a weighted combination of these attribute-specific components.
  • Stage II: Sequence-Level Preference Optimization: This stage refines the steering vectors using a Reinforcement Learning from Human Feedback (RLHF) approach, specifically a sequence-level variant of Proximal Policy Optimization (PPO). Unlike token-level optimization, SPO-VLM optimizes the entire generated sequence. It uses a multi-objective reward function that includes:
  • Toxicity Reduction: Penalizing toxic content using a pre-trained classifier.
  • Visual-Textual Consistency: Rewarding alignment between visual content and generated captions. This stage aims to align the model's behavior with desired safety and visual grounding objectives, effectively steering it away from harmful outputs.

Datasets

The paper uses several datasets for training and evaluation:

  • For Steering Vector Initialization (Stage I): RealToxicityPrompt, AdvBench, and Anthropic_Harmful datasets.
  • For Evaluation:
    • Toxicity Assessment: RealToxicityPrompts benchmark.
  • Jailbreak Detection: AdvBench and Anthropic_Harmful datasets.
  • Visual Comprehension: MM-Vet, SQA, CogVLM, and MME benchmarks.

Key Insights and Ideas

  • Generalizable Steering Vectors: The paper argues that deriving steering vectors from diverse datasets and attributes, rather than single contrastive prompts, leads to more robust and generalizable defenses against various jailbreak attacks.
  • Sequence-Level Optimization is Crucial: Optimizing the entire generated sequence (SPO-VLM) is more effective than token-level optimization for aligning VLMs with complex safety and visual grounding objectives. This allows for a more holistic approach to controlling model behavior.
  • Balancing Safety and Utility: The core insight is that it's possible to significantly improve safety without a substantial trade-off in visual understanding capabilities. SPO-VLM demonstrates this balance, outperforming other methods that achieve safety at the cost of performance.
  • Adaptive Steering: The adaptive nature of the steering vectors, influenced by the specific attributes and refined through preference optimization, allows the defense to be more nuanced and effective.

Key Results

SPO-VLM demonstrates significant improvements across various benchmarks:

  • Toxicity Reduction: Achieved the lowest toxicity scores, reducing it by over 27.79% compared to the original model and an additional 11.55% compared to ASTRA on the Real Toxicity Prompt dataset.
  • Jailbreak Mitigation: Reduced the average Attack Success Rate (ASR) on AdvBench by approximately 1.28% and nearly halved it on Anthropic_Harmful compared to ASTRA.
  • Visual Understanding Preservation: SPO-VLM largely preserves visual understanding capabilities, showing only modest drops in scores (e.g., ~1.5% on MM-Vet for MiniGPT-4) compared to significant declines observed with other methods like ASTRA (e.g., ~45% drop on MM-Vet for MiniGPT-4). In some cases, it even enhances visual understanding.
  • Transferability: SPO-VLM shows strong transferability to structure-based attacks, significantly reducing success rates even on challenging combined attacks like SD + OCR.

Limitations and Future Work

  • Limitations: While SPO-VLM shows excellent results, the paper acknowledges that it's an ongoing effort. The effectiveness of the defense might still be challenged by novel or highly sophisticated jailbreak techniques. The reliance on pre-trained toxicity classifiers and the complexity of the reward function could also be areas for improvement.
  • Future Work: The authors suggest that their work lays the foundation for future research in activation-space intervention and preference-driven alignment. They aim to further enhance the trustworthiness of VLMs and LLMs for deployment. Future work could explore more sophisticated reward functions, investigate the interpretability of the learned steering vectors, and test the defense against an even wider array of adversarial attacks. The release of their code and model weights is intended to facilitate this future research.

Summary updated

BibTeX
@inproceedings{wu2025activation,
  author = {Sihao Wu and Gaojie Jin and Wei Huang and Jianhong Wang and Xiaowei Huang},
  title = {{Activation Steering Meets Preference Optimization: Defense Against Jailbreaks in Vision Language Model}},
  booktitle = {ACML Conference Track},
  year = {2025},
  url = {https://openreview.net/forum?id=kOW62wiMr9},
}
Figure