Table of Contents
Fetching ...

Dynamic Token Reweighting for Robust Vision-Language Models

Tanqiu Jiang, Jiacheng Liang, Rongyi Zhu, Jiawei Zhou, Fenglong Ma, Ting Wang

TL;DR

DTR is presented, a novel inference-time defense that mitigates multimodal jailbreak attacks through optimizing the model's key-value (KV) caches and introduces a new formulation of the safety-relevant distributional shift induced by the visual modality.

Abstract

Large vision-language models (VLMs) are highly vulnerable to multimodal jailbreak attacks that exploit visual-textual interactions to bypass safety guardrails. In this paper, we present DTR, a novel inference-time defense that mitigates multimodal jailbreak attacks through optimizing the model's key-value (KV) caches. Rather than relying on curated safety-specific data or costly image-to-text conversion, we introduce a new formulation of the safety-relevant distributional shift induced by the visual modality. This formulation enables DTR to dynamically adjust visual token weights, minimizing the impact of adversarial visual inputs while preserving the model's general capabilities and inference efficiency. Extensive evaluation across diverse VLMs and attack benchmarks demonstrates that DTR outperforms existing defenses in both attack robustness and benign-task performance, marking the first successful application of KV cache optimization for safety enhancement in multimodal foundation models. The code for replicating DTR is available at: https://github.com/TanqiuJiang/DTR.

Dynamic Token Reweighting for Robust Vision-Language Models

TL;DR

DTR is presented, a novel inference-time defense that mitigates multimodal jailbreak attacks through optimizing the model's key-value (KV) caches and introduces a new formulation of the safety-relevant distributional shift induced by the visual modality.

Abstract

Large vision-language models (VLMs) are highly vulnerable to multimodal jailbreak attacks that exploit visual-textual interactions to bypass safety guardrails. In this paper, we present DTR, a novel inference-time defense that mitigates multimodal jailbreak attacks through optimizing the model's key-value (KV) caches. Rather than relying on curated safety-specific data or costly image-to-text conversion, we introduce a new formulation of the safety-relevant distributional shift induced by the visual modality. This formulation enables DTR to dynamically adjust visual token weights, minimizing the impact of adversarial visual inputs while preserving the model's general capabilities and inference efficiency. Extensive evaluation across diverse VLMs and attack benchmarks demonstrates that DTR outperforms existing defenses in both attack robustness and benign-task performance, marking the first successful application of KV cache optimization for safety enhancement in multimodal foundation models. The code for replicating DTR is available at: https://github.com/TanqiuJiang/DTR.

Paper Structure

This paper contains 35 sections, 7 equations, 13 figures, 15 tables, 1 algorithm.

Figures (13)

  • Figure 1: Dtr mitigates the safety-relevant shift induced by adversarial visual inputs through dynamically reweighting visual token importance, reinforcing VLMs' built-in safety alignment.
  • Figure 2: (a) Refusal direction and estimate of safety-relevant shift; (b) Estimate of (optimizable) reversal safety-relevant shift.
  • Figure 3: RSS of jailbreak and benign queries.
  • Figure 4: The scaling vector $\bm{\alpha}$ provides intuitive interpretability for visual token importance regarding safety-relevant shifts, differentiating adversarial and feature tokens in jailbreak queries.
  • Figure 5: Sensitivity analysis: (a) number of reference samples to estimate the refusal direction; (b) number of optimization steps in Dtr; (c) hyper-parameter $\lambda$; (d) number of evicted visual tokens.
  • ...and 8 more figures