Safe Vision-Language Models via Unsafe Weights Manipulation

Moreno D'Incà, Elia Peruzzo, Xingqian Xu, Humphrey Shi, Nicu Sebe +1 more
3/14/2025
cs.CVcs.AI

No official code found. Best implementation: Moreno98/UWM (16 stars, last commit 2026-03-03).

Abstract

Vision-language models (VLMs) often inherit the biases and unsafe associations present within their large-scale training dataset. While recent approaches mitigate unsafe behaviors, their evaluation focuses on how safe the model is on unsafe inputs, ignoring potential shortcomings on safe ones. In this paper, we first revise safety evaluation by introducing SafeGround, a new set of metrics that evaluate safety at different levels of granularity. With this metric, we uncover a surprising issue of training-based methods: they make the model less safe on safe inputs. From this finding, we take a different direction and explore whether it is possible to make a model safer without training, introducing Unsafe Weights Manipulation (UWM). UWM uses a calibration set of safe and unsafe instances to compare activations between safe and unsafe content, identifying the most important parameters for processing the latter. Their values are then manipulated via negation. Experiments show that UWM achieves the best tradeoff between safety and knowledge preservation, consistently improving VLMs on unsafe queries while outperforming even training-based state-of-the-art methods on safe ones.

View on arXivView PDF

Code Implementations(1)

Moreno98/UWMCommunity73%

[WACV 26] Official code for the paper Safe Vision-Language Models via Unsafe Weights Manipulation

160Shell, PythonDec 4, 20257 months ago

Cite this paper

@article{dinc2025safe,
  title  = {Safe Vision-Language Models via Unsafe Weights Manipulation},
  author = {Moreno D'Incà and Elia Peruzzo and Xingqian Xu and Humphrey Shi and Nicu Sebe and Massimiliano Mancini},
  year   = {2025},
  eprint = {2503.11742},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2503.11742v2}
}

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/2503.11742.svg)](https://codeofpaper.com/paper/2503.11742)

Discussion