The Safety Reminder: A Soft Prompt to Reactivate Delayed Safety Awareness in Vision-Language Models

PeiYuan Tang, Haojie Xin, Xiaodong Zhang, Jun Sun, Qin Xia, Zijiang YangarXiv 2025

Abstract

As Vision-Language Models (VLMs) demonstrate increasing capabilities across real-world applications such as code generation and chatbot assistance, ensuring their safety has become paramount. Unlike traditional Large Language Models (LLMs), VLMs face unique vulnerabilities due to their multimodal nature, allowing adversaries to modify visual or textual inputs to bypass safety guardrails and trigger the generation of harmful content. Through systematic analysis of VLM behavior under attack, we identify a novel phenomenon termed "delayed safety awareness." Specifically, we observe that safety-aligned VLMs may initially be compromised to produce harmful content, but eventually recognize the associated risks and attempt to self-correct. This pattern suggests that VLMs retain their underlying safety awareness but experience a temporal delay in their activation. Building on this insight, we hypothesize that VLMs' safety awareness can be proactively reactivated through carefully designed prompts. To this end, we introduce "The Safety Reminder", a soft prompt tuning approach that optimizes learnable prompt tokens, which are periodically injected during the text generation process to enhance safety awareness, effectively preventing harmful content generation. Additionally, our safety reminder only activates when harmful content is detected, leaving normal conversations unaffected and preserving the model's performance on benign tasks. Through comprehensive evaluation across three established safety benchmarks and one adversarial attacks, we demonstrate that our approach significantly reduces attack success rates while maintaining model utility, offering a practical solution for deploying safer VLMs in real-world applications.

Introduction

Vision-Language Models (VLMs), such as LLaVA and Qwen2-VL, have revolutionized multimodal interaction. However, their integration of visual and textual modalities introduces unique security vulnerabilities. Adversaries can exploit these models through "multimodal jailbreaks," using perturbed images or deceptive text prompts to bypass safety guardrails. While safety alignment is a standard part of model training, recent research identifies a critical failure mode: safety awareness is often present but delayed.

The Phenomenon of Delayed Safety Awareness

A systematic analysis of VLM behavior under attack reveals a phenomenon termed "delayed safety awareness." In many instances, a safety-aligned VLM initially complies with a malicious request, generating the first few steps of a harmful instruction. However, as the generation progresses, the model eventually recognizes the risk and attempts to self-correct by adding a safety disclaimer.

Illustration of delayed safety awareness in VLMs.

This behavior suggests that the model's safety guardrails are not entirely broken; rather, they are suppressed by the "momentum" of the initial harmful generation. Because VLMs are autoregressive, once they begin a harmful response, the preceding tokens exert a strong influence on subsequent predictions, making it difficult for the model to pivot to a refusal. The safety alignment isn't lost; it is simply activated too late to prevent the initial leak of dangerous information.

Methodology: Safety-Aware Soft Prompt Tuning (SAPT)

To address this delay, the authors propose Safety-Aware Soft Prompt Tuning (SAPT). SAPT is a lightweight, post-hoc defense mechanism designed to proactively reactivate a model's latent safety awareness before harmful content is fully generated. The framework consists of three core components:

  1. Safety State Detector: A logistic regression classifier that monitors the model's internal hidden states at the final layer. This detector identifies the subtle internal signals of "risk" that often precede the actual generation of harmful text.
  2. The Safety Reminder: Instead of using natural language, SAPT employs "soft prompts"—optimized mathematical vectors. These tokens are specifically tuned to trigger the model's internal safety mechanisms.
  3. Dynamic Injection: During inference, the detector evaluates the model's state every $k$ tokens (e.g., every 16 tokens). If an unsafe state is detected, the "Safety Reminder" soft prompt is injected into the sequence, acting as a "nudge" to force the model into a refusal state.

Experimental Evaluation

The researchers evaluated SAPT across multiple benchmarks, including FigStep (text hidden in images), MMSafetyBench (harmful images), and VLSafe (harmful text-based queries), as well as adversarial visual attacks like AdvBench.

Safety Performance

The results demonstrate that SAPT significantly enhances model safety. For LLaVA-1.5-7B, the average Attack Success Rate (ASR) across harmful benchmarks plummeted from 76.05% to 3.22%. Even against sophisticated gradient-based visual adversarial perturbations, the ASR was reduced from 94.17% to 3.59%.

Utility and Efficiency

Crucially, SAPT maintains the model's core capabilities. On the MM-Vet utility benchmark, performance remained stable (e.g., LLaVA's score changed marginally from 31.4 to 31.0). Furthermore, the defense is computationally efficient; by leveraging KV caching and periodic detection, the inference speed overhead is limited to approximately 10%, making it faster than many multi-model filtering approaches.

Conclusion

The discovery of "delayed safety awareness" provides a new perspective on VLM vulnerabilities. By recognizing that safety alignment is often latent rather than absent, SAPT offers a practical and efficient method to "snap" models back into a safe state. This approach provides a robust defense against multimodal jailbreaks without requiring expensive retraining or sacrificing model utility.

Summary updated

BibTeX
@misc{tang2025safety,
  author = {PeiYuan Tang and Haojie Xin and Xiaodong Zhang and Jun Sun and Qin Xia and Zijiang Yang},
  title = {{The Safety Reminder: A Soft Prompt to Reactivate Delayed Safety Awareness in Vision-Language Models}},
  year = {2025},
  eprint = {2506.15734},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.15734},
}
Figure