Self-Aware Safety Augmentation: Leveraging Internal Semantic Understanding to Enhance Safety in Vision-Language Models

Wanying Wang, Zeyu Ma, Han Zheng, Xin Tan, Mingang Chen

TL;DR

Large Vision-Language Models (LVLMs) are notoriously vulnerable to multimodal jailbreaks because their internal safety mechanisms trigger before the model fully processes the semantic meaning of the input. To fix this structural mismatch, the authors introduce Self-Aware Safety Augmentation (SASA), a tuning-free method that projects rich semantic features from deeper layers back into early safety layers. This simple intervention dramatically reduces jailbreak success rates to near zero while preserving the model's core utility, using only a handful of training examples.

What Problem Does This Paper Address?

While Large Vision-Language Models (LVLMs) excel at multimodal tasks, they are significantly more fragile than their text-only counterparts when faced with malicious inputs. Attackers can easily bypass safety guardrails using contextually deceptive images or typographic attacks (rendering prohibited text instructions inside an image).

Existing solutions typically rely on expensive supervised fine-tuning, reinforcement learning (RLHF), or external guardrails that add latency and suffer from high false-positive rates. The authors of this paper look inward to ask why these vulnerabilities exist. By analyzing the internal dynamics of LVLMs during inference, they discover a fundamental structural mismatch: the attention heads responsible for safety perception are concentrated in the very early layers of the model, whereas the deep semantic comprehension of the multimodal input only matures later in the intermediate layers. Essentially, the model attempts to evaluate the safety of an input before it actually understands what the input means.

Methods

The authors conceptualize the LVLM forward pass as a three-phase journey:

  1. Phase I: Safety Perception (Early layers detect risk)
  2. Phase II: Semantic Understanding ("Fused" intermediate layers build a cohesive representation of text and image)
  3. Phase III: Align for Expression (Late layers format the representation into human-readable text tokens)
Figure 1: Overall Workflow of Self-Aware Safety Augmentation (SASA).

To bridge the gap between Phase I and Phase II without altering the model's weights, they propose Self-Aware Safety Augmentation (SASA):

  • Localization: They pinpoint safety-critical attention heads using Singular Value Decomposition (SVD) to track representation shifts when specific heads are ablated. They also identify the optimal "fused layers" where the model naturally separates harmful and benign inputs best.
  • Representation Projection: During the forward pass, SASA mathematically projects the hidden states of the early safety layers onto the vector space of the deeper, semantically rich fused layers. This operation effectively injects advanced semantic comprehension back in time to the safety layers.
  • Linear Probing: Finally, a lightweight logistic regression classifier (a linear probe) is trained on the output logits of the first generated token. If the probe detects a safety risk based on the augmented internal states, the system blocks the response immediately.

Datasets

The approach was validated across a robust mix of safety and utility benchmarks:

  • Safety Benchmarks:
  • MM-SafetyBench: 1,680 unsafe questions spanning 13 distinct scenarios.
  • VLGuard: A dataset containing harmful and benign image-text pairs to test fine-grained safety alignment.
  • FigStep: A dataset focusing on typographic visual jailbreaks (e.g., text instructions rendered inside images).
  • Utility/Helpfulness Benchmarks: ScienceQA (scientific question answering), COCO-VQA (visual question answering), and MM-Vet (integrated multimodal capabilities) were used to ensure the defense didn't degrade general performance.

Key Insights and Ideas

  • The Early-Layer Vulnerability: Safety is heavily dictated by early-stage processing. The authors found that ablating just the top 5 safety-related attention heads caused the model's Attack Success Rate (ASR) to skyrocket by an average of 47% to 67%.
ASR Increase by Number of Ablated Safety Heads
  • Latent Awareness vs. Expressed Output: In intermediate layers (around layers 15–18), the model's internal representations can clearly differentiate between harmful and benign prompts. However, as the information moves to deeper layers, this distinction gets diluted because the model prioritizes linguistic alignment (generating fluent text) over safety boundaries.
Figure 5: Readable rate of top-5 decoded tokens across layers.
  • Self-Correction via Internal Routing: Models already "know" when an input is harmful; they just don't pass that knowledge to the safety mechanism in time. By routing information from the future (fused layers) to the past (safety layers), the model can successfully protect itself.

Key Results

  • Near-Zero Attack Success Rates: SASA achieved massive safety improvements across multiple architectures (MiniGPT-v2, LLaVA-1.5, Qwen-VL). On MM-SafetyBench, LLaVA-1.5's baseline ASR plummeted from 97.86% to 0.64%. On typographic attacks (FigStep), SASA achieved a flawless 0% ASR across all tested models.
  • Preserved Utility: Unlike heavy fine-tuning which often causes "catastrophic forgetting" or degrades helpfulness, SASA maintained virtually identical performance on utility datasets like COCO-VQA and ScienceQA, with accuracy fluctuations typically under 1%.
  • Extreme Data Efficiency: Because it is tuning-free and relies on a simple linear probe, SASA requires an incredibly small training footprint—using as few as 10 to 50 samples per dataset to achieve optimal defense performance.
  • Strong Zero-Shot Generalization: A safety probe trained via SASA on one dataset (e.g., VLGuard) generalized seamlessly to entirely unseen attack types in other datasets without any additional training.

Limitations and Future Work

  • Layer Calibration: The optimal safety and fused layers must be identified per model architecture. While the paper outlines a clear methodology to find them, it requires a brief profiling step when adapting to entirely new model families.
  • First-Token Dependency: The linear probe operates during the generation of the first token. While highly effective for standard jailbreaks (which usually force the model to start with affirmative phrases like "Sure, here is..."), more sophisticated multi-turn or slow-burn adversarial attacks might bypass first-token detection.
  • Future Directions: The authors suggest exploring how these internal projection dynamics behave in larger-scale models (e.g., 13B+ parameters) and extending the framework to handle multi-turn conversational safety.

Summary updated

BibTeX
@inproceedings{wang2025self,
  author = {Wanying Wang and Zeyu Ma and Han Zheng and Xin Tan and Mingang Chen},
  title = {{Self-Aware Safety Augmentation: Leveraging Internal Semantic Understanding to Enhance Safety in Vision-Language Models}},
  booktitle = {ACM Multimedia},
  year = {2025},
}
Figure