Abstract: The safety alignment of Vision-Language Models (VLMs) often degrades when vision modules are integrated with safe Large Language Model (LLM) backbones. This paper investigates "safety alignment degradation," attributing it to a representation gap where multi-modal inputs shift away from the text-only distribution the backbone was optimized for. We introduce Cross-Modality Representation Manipulation (CMRM), an inference-time intervention that recovers the backbone's inherent safety by nudging representations back toward the textual space. Empirical results show that CMRM reduces the unsafe rate of LLaVA-7B from 61.53% to 3.15% with minimal impact on utility. Warning: This paper contains examples of toxic or harmful language.
Introduction
Vision-Language Models (VLMs) like LLaVA are typically constructed by integrating a pre-trained vision encoder with a safety-aligned Large Language Model (LLM) backbone. While the backbone is often robustly aligned against generating harmful content in text-only scenarios, this safety frequently collapses when visual inputs are introduced—even if the images are benign, blank, or random noise. This phenomenon, termed "safety alignment degradation," poses a significant risk for the deployment of multi-modal systems.
The Representation Gap
The core issue lies in a fundamental representation gap. LLMs are optimized and aligned within a specific textual embedding space. When visual features are projected into this space, they shift the resulting multi-modal representations into regions where the model's safety training has not been established.
As shown in Figure 1, text-only queries and multi-modal inputs form distinct, separable clusters. The safety mechanisms developed for the text cluster do not naturally generalize to the multi-modal cluster, leading to the observed degradation. Strikingly, the "blank image paradox" reveals that even a blank image—carrying no semantic information—is sufficient to trigger this shift and subsequent safety failure, proving the issue is modality-driven rather than content-driven.
Methods: Cross-Modality Representation Manipulation (CMRM)
To address this without the need for expensive retraining, we propose CMRM, an inference-time intervention. CMRM identifies the "shift vector" that pulls representations away from the safe textual distribution and subtracts it during the forward pass. This "nudges" the model's internal states back into the region where its safety alignment is active.
The method offers two approaches for shift extraction:
- Dataset-level (CMRM_dataset): Uses Principal Component Analysis (PCA) across a whole dataset to find a general image-induced shift vector.
- Sample-level (CMRM_sample): Calculates a specific shift for each individual input by comparing the representation of the prompt with the image against a "corrupted" or blank version.
Results and Discussion
The effectiveness of CMRM was evaluated on safety benchmarks (VLSafe, JailbreakLLMs) and utility benchmarks (L-Bench, S-QA).
As detailed in Figure 3, the safety improvements are dramatic. For LLaVA-7B, the unsafe rate on the VLSafe dataset dropped from 61.53% to as low as 3.15% using CMRM_sample. Crucially, this safety gain does not come at the cost of model utility; performance on benchmarks like L-Bench remained stable or even improved, demonstrating that CMRM preserves the model's functional capabilities while restoring its moral compass.
Conclusion and Limitations
Safety alignment degradation in VLMs is a structural issue arising from the shift in latent space when modalities are mixed. CMRM provides a lightweight, effective, and training-free solution to recover the safety inherent in the LLM backbone.
While effective, CMRM introduces a small computational overhead (roughly 10-20% latency increase) due to the extra calculations required to determine the shift vector. Future work may explore similar interventions for other traits like logical reasoning or hallucination reduction.
Summary updated