arXiv:2507.20994cs.CVcs.AI2025-07被引 3

用可训练向量让视觉模型学会文本安全判断。

Security Tensors as a Cross-Modal Bridge: Extending Text-Aligned Safety to Vision in LVLM

  • 引入安全张量,通过输入层传递文本安全机制到视觉模态。
  • 在恶意图像上拒绝对率提升显著,正常任务性能几乎不变。
  • 适合关注多模态安全、想低成本提升视觉模型鲁棒性的研究者。

大型视觉语言模型(LVLM)将大语言模型(LLM)与视觉模块结合,处理多模态输入。然而,针对文本型大模型开发的安全机制无法自然延伸至视觉模态,导致LVLM对有害图像输入存在漏洞。为填补这一跨模态安全差距,本文提出安全张量——一种可在推理阶段通过文本或视觉模态注入的可训练输入向量。该方法无需修改模型参数,即可将文本安全对齐能力迁移至视觉处理。安全张量基于包含三类样本的定制数据集进行优化:(i) 需要拒绝的恶意图像-文本对;(ii) 与恶意查询结构相似的对比性良性对,用于引导视觉依赖;(iii) 一般良性样本,确保模型功能完整。实验表明,文本与视觉安全张量均显著提升LVLM对多样化有害视觉输入的拒绝对能力,同时在良性任务上保持近乎一致的性能。内部分析显示,安全张量成功激活语言模块中的文本“安全层”以作用于视觉输入,有效实现文本安全向视觉模态的扩展。

原文摘要 · Abstract (English)

Large visual-language models (LVLMs) integrate aligned large language models (LLMs) with visual modules to process multimodal inputs. However, the safety mechanisms developed for text-based LLMs do not naturally extend to visual modalities, leaving LVLMs vulnerable to harmful image inputs. To address this cross-modal safety gap, we introduce security tensors - trainable input vectors applied during inference through either the textual or visual modality. These tensors transfer textual safety alignment to visual processing without modifying the model's parameters. They are optimized using a curated dataset containing (i) malicious image-text pairs requiring rejection, (ii) contrastive benign pairs with text structurally similar to malicious queries, with the purpose of being contrastive examples to guide visual reliance, and (iii) general benign samples preserving model functionality. Experimental results demonstrate that both textual and visual security tensors significantly enhance LVLMs' ability to reject diverse harmful visual inputs while maintaining near-identical performance on benign tasks. Further internal analysis towards hidden-layer representations reveals that security tensors successfully activate the language module's textual "safety layers" in visual inputs, thereby effectively extending text-based safety to the visual modality.

多模态安全视觉语言模型安全对齐输入扰动

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