DAVSP: Safety Alignment for Large Vision-Language Models via Deep Aligned Visual Safety Prompt

Yitong Zhang, Jia Li, Liyi Cai, Ge Li
6/11/2025
11 citations
cs.CRcs.CV

Official code: zhangyitonggg/DAVSP (17 stars, Python, last commit 2026-02-18).

Abstract

Large Vision-Language Models (LVLMs) have achieved impressive progress across various applications but remain vulnerable to malicious queries that exploit the visual modality. Existing alignment approaches typically fail to resist malicious queries while preserving utility on benign ones effectively.

Show full abstract

To address these challenges, we propose Deep Aligned Visual Safety Prompt (DAVSP), which is built upon two key innovations. First, we introduce the Visual Safety Prompt, which appends a trainable padding region around the input image. It preserves visual features and expands the optimization space. Second, we propose Deep Alignment, a novel approach to train the visual safety prompt through supervision in the model's activation space. It enhances the inherent ability of LVLMs to perceive malicious queries, achieving deeper alignment than prior works. Extensive experiments across five benchmarks on two representative LVLMs demonstrate that DAVSP effectively resists malicious queries while preserving benign input utility. Furthermore, DAVSP exhibits great cross-model generation ability. Ablation studies further reveal that both the Visual Safety Prompt and Deep Alignment are essential components, jointly contributing to its overall effectiveness. The code is publicly available at https://github.com/zhangyitonggg/DAVSP.

View on arXivView PDF

Code Implementations(1)

170Python, JavaScriptJun 5, 20259 months ago

Similar Papers

Cite this paper

@article{zhang2025davsp,
  title  = {DAVSP: Safety Alignment for Large Vision-Language Models via Deep Aligned Visual Safety Prompt},
  author = {Yitong Zhang and Jia Li and Liyi Cai and Ge Li},
  year   = {2025},
  eprint = {2506.09353},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.09353v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.09353.svg)](https://codeofpaper.com/paper/2506.09353)

Discussion