arXiv:2506.15734cs.AIcs.CL2025-06被引 2

用软提示唤醒视觉语言模型的安全意识,防攻击不扰正常对话。

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

  • 通过周期性注入可学习提示,主动唤醒模型延迟激活的安全感知。
  • 在三个安全基准上显著降低攻击成功率,保持正常任务性能不变。
  • 仅在检测到有害内容时触发,适合部署于真实场景的高安全性需求。

随着视觉语言模型(VLMs)在代码生成和聊天助手等实际应用中能力不断提升,其安全性日益重要。与传统大语言模型不同,由于多模态特性,攻击者可通过修改视觉或文本输入绕过安全防护,诱导生成有害内容。系统分析表明,安全对齐的VLMs存在‘延迟安全意识’现象:初始可能生成有害内容,但随后会识别风险并自我修正,说明其内在安全意识仍存,只是激活有延迟。基于此,我们提出‘安全提醒’(The Safety Reminder),一种软提示微调方法,通过在文本生成过程中周期性注入可学习提示词,主动唤醒安全意识,有效防止有害内容生成。该机制仅在检测到潜在危害时激活,不影响正常对话,且保持模型在良性任务上的性能。在三个标准安全基准和一个对抗攻击测试中验证,该方法显著降低攻击成功率,为现实应用中部署更安全的VLMs提供实用方案。

原文摘要 · Abstract (English)

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.

安全增强视觉语言模型软提示

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。