arXiv:2605.07447cs.CVcs.AI2026-05被引 1

用稀疏自编码器检测视觉语言模型的对抗攻击,无需额外训练。

Sparse Autoencoders as Plug-and-Play Firewalls for Adversarial Attack Detection in VLMs

论文配图:Sparse Autoencoders as Plug-and-Play Firewalls for Adversarial Attack Detection in VLMs
图 1 · 摘自论文原文
  • 在预训练模型中插入稀疏自编码器,通过重建目标学习攻击敏感特征。
  • 跨域场景下检测准确率显著提升,对未见过的攻击类型也有效。
  • 轻量级插件式设计,无须对抗训练,适合实际系统部署。

视觉语言模型(VLMs)快速发展并广泛应用于现实场景,尤其在基于智能体的系统中。然而其安全性仍受关注不足,即使最新的开源与专有VLMs仍极易受到对抗攻击,使下游应用面临重大风险。本文提出一种基于稀疏自编码器(SAEs)的新型轻量级对抗攻击检测框架——SAEgis。通过在预训练VLM中插入SAE模块,并以标准重建目标进行训练,我们发现学习到的稀疏潜在特征能自然捕获攻击相关信号。这些特征可可靠判断输入图像是否被对抗扰动,甚至对未见过的样本有效。大量实验表明,SAEgis在域内、跨域及跨攻击设置下均表现优异,尤其在跨域泛化上相比现有基线有显著提升。进一步融合多层信号可增强鲁棒性与稳定性。据我们所知,这是首个探索SAE作为VLM中即插即用对抗攻击检测机制的工作。该方法无需额外对抗训练,开销极小,为提升真实VLM系统的安全性提供实用方案。

原文摘要 · Abstract (English)

Vision-language models (VLMs) have advanced rapidly and are increasingly deployed in real-world applications, especially with the rise of agent-based systems. However, their safety has received relatively limited attention. Even the latest proprietary and open-weight VLMs remain highly vulnerable to adversarial attacks, leaving downstream applications exposed to significant risks. In this work, we propose a novel and lightweight adversarial attack detection framework based on sparse autoencoders (SAEs), termed SAEgis. By inserting an SAE module into a pretrained VLM and training it with standard reconstruction objectives, we find that the learned sparse latent features naturally capture attack-relevant signals. These features enable reliable classification of whether an input image has been adversarially perturbed, even for previously unseen samples. Extensive experiments show that SAEgis achieves strong performance across in-domain, cross-domain, and cross-attack settings, with particularly large improvements in cross-domain generalization compared to existing baselines. In addition, combining signals from multiple layers further improves robustness and stability. To the best of our knowledge, this is the first work to explore SAE as a plug-and-play mechanism for adversarial attack detection in VLMs. Our method requires no additional adversarial training, introduces minimal overhead, and provides a practical approach for improving the safety of real-world VLM systems.

对抗攻击视觉语言模型稀疏编码安全检测

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