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

Hugging Face Daily Papers 论文

摘要

# Paper page - Sparse Autoencoders as Plug-and-Play Firewalls for Adversarial Attack Detection in VLMs Source: [https://huggingface.co/papers/2605.07447](https://huggingface.co/papers/2605.07447) ## Abstract SAEgis detects adversarial attacks on vision\-language models using sparse autoencoders trained for reconstruction, achieving strong performance across domains without additional training\. [Vision\-language models](https://huggingface.co/papers?q=Vision-language%20models)\(VLMs\) have advan

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.
查看原文
查看缓存全文

缓存时间: 2026/05/11 10:44

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

Source: https://huggingface.co/papers/2605.07447

Abstract

SAEgis detects adversarial attacks on vision-language models using sparse autoencoders trained for reconstruction, achieving strong performance across domains without additional training.

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 toadversarial attacks, leaving downstream applications exposed to significant risks. In this work, we propose a novel and lightweightadversarial attack detectionframework based onsparse autoencoders(SAEs), termed SAEgis. By inserting an SAE module into a pretrained VLM and training it with standardreconstruction objectives, we find that the learnedsparse latent featuresnaturally 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 incross-domain generalizationcompared 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 foradversarial attack detectionin 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.

View arXiv pageView PDFGitHub2Add to collection

Get this paper in your agent:

hf papers read 2605\.07447

Don’t have the latest CLI?curl \-LsSf https://hf\.co/cli/install\.sh \| bash

Models citing this paper0

No model linking this paper

Cite arxiv.org/abs/2605.07447 in a model README.md to link it from this page.

Datasets citing this paper0

No dataset linking this paper

Cite arxiv.org/abs/2605.07447 in a dataset README.md to link it from this page.

Spaces citing this paper0

No Space linking this paper

Cite arxiv.org/abs/2605.07447 in a Space README.md to link it from this page.

Collections including this paper0

No Collection including this paper

Add this paper to acollectionto link it from this page.

相似文章

用于可解释性分布外检测的稀疏自编码器

arXiv cs.LG

本文介绍了一种新颖的方法,利用稀疏自编码器(SAEs)从网络中间激活中学习可解释特征,用于分布外(OOD)检测,该方法达到了最先进的性能,并提供了关于分布偏移如何影响所学表示的见解。

变分有损自编码器

OpenAI Blog

# 变分有损自编码器 来源: [https://openai.com/index/variational-lossy-autoencoder/](https://openai.com/index/variational-lossy-autoencoder/) ## 摘要 表示学习旨在将观测数据的某些方面暴露在学习表示中,这种表示便于分类等下游任务。例如,对于二维图像,一个好的表示可能是只描述全局结构并丢弃有关详细纹理信息的表示。在本文中,我们提出