arXiv:2604.26409cs.CV2026-04

用稀疏编码分析视觉模型,发现分布外数据会破坏激活结构。

Sparsity as a Key: Unlocking New Insights from Latent Structures for Out-of-Distribution Detection

论文配图:Sparsity as a Key: Unlocking New Insights from Latent Structures for Out-of-Distribution Detection
图 1 · 摘自论文原文
  • 用Top-k稀疏自编码器解耦[CLS]特征,构建可解释的潜在空间
  • 发现分布内数据有稳定的类别激活模式,分布外则破坏该结构
  • 基于能量分布偏差设计评分函数,适合安全敏感场景

稀疏自编码器(SAEs)在解析大语言模型方面表现优异,能将密集表征分解为稀疏语义组件。然而其在视觉变换器(ViTs)中的应用尚未充分探索。本文首次将SAE应用于ViT的[CLS] token进行分布外(OOD)检测,克服了现有方法依赖纠缠特征表示的局限。我们提出一种新框架,利用Top-k SAE将密集[CLS]特征解耦为结构化潜在空间。分析发现,分布内(ID)数据呈现一致、类特定的激活模式,我们将其形式化为类别激活轮廓(CAPs)。研究揭示一个关键结构不变性:尽管ID样本在CAPs中保持稳定模式,但OOD样本会系统性破坏该结构。基于此,我们引入一种基于核心能量轮廓偏离的评分函数,量化与理想激活模式的偏差。该方法在多个基准上以高FPR95表现实现强效果,同时具备竞争力的AUROC。结果表明,SAEs揭示的稀疏解耦特征可作为视觉模型中鲁棒且可解释的分布外检测工具。

原文摘要 · Abstract (English)

Sparse Autoencoders (SAEs) have demonstrated significant success in interpreting Large Language Models (LLMs) by decomposing dense representations into sparse, semantic components. However, their potential for analyzing Vision Transformers (ViTs) remains largely under-explored. In this work, we present the first application of SAEs to the ViT [CLS] token for out-of-distribution (OOD) detection, addressing the limitation of existing methods that rely on entangled feature representations. We propose a novel framework utilizing a Top-k SAE to disentangle the dense [CLS] features into a structured latent space. Through this analysis, we reveal that in-distribution (ID) data exhibits consistent, class-specific activation patterns, which we formalize as Class Activation Profiles (CAPs). Our study uncovers a key structural invariant: while ID samples preserve a stable pattern within CAPs, OOD samples systematically disrupt this structure. Leveraging this insight, we introduce a scoring function based on the divergence of core energy profiles to quantify the deviation from ideal activation profiles. Our method achieves strong results on the FPR95 metric, critical for safety-sensitive applications across multiple benchmarks, while also achieving competitive AUROC. Overall, our findings demonstrate that the sparse, disentangled features revealed by SAEs can serve as a powerful, interpretable tool for robust OOD detection in vision models.

分布外检测稀疏编码视觉模型可解释性

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