用跨层编码器解析ViT内部激活,让模型决策过程更透明。
Can Cross-Layer Transcoders Replace Vision Transformer Activations? An Interpretable Perspective on Vision

- 设计跨层译码器,从前面层的稀疏表示重建每层MLP输出
- 重建精度高且保持零样本分类性能,部分任务还提升
- 揭示关键层贡献,帮助理解视觉模型如何逐层构建最终结果
理解视觉Transformer(ViT)内部激活对构建可解释、可信模型至关重要。尽管稀疏自编码器(SAEs)可用于提取人类可读特征,但它们仅作用于单层,无法捕捉Transformer的跨层计算结构及其各层对最终表示的相对重要性。为此,我们引入跨层译码器(CLTs)作为ViT中MLP模块的可靠、稀疏且深度感知的代理模型。CLTs采用编码-解码架构,从先前层的稀疏嵌入中重建每层后MLP激活,实现线性分解,将ViT的最终表示由黑箱嵌入转化为可加的、分层可追溯的构造,支持精准归因与过程级可解释性。我们在CLIP ViT-B/32和ViT-B/16上,针对CIFAR-100、COCO和ImageNet-100训练CLTs。结果显示,CLTs在重建后MLP激活方面具有高保真度,同时维持甚至在某些情况下提升了CLIP零样本分类准确率。在可解释性方面,跨层贡献分数提供忠实归因,表明最终表示集中于少数主导层项,其移除会显著降低性能,而保留则能基本维持性能。这些结果展示了使用CLTs作为视觉领域可解释代理模型的潜力。
原文摘要 · Abstract (English)
Understanding the internal activations of Vision Transformers (ViTs) is critical for building interpretable and trustworthy models. While Sparse Autoencoders (SAEs) have been used to extract human-interpretable features, they operate on individual layers and fail to capture the cross-layer computational structure of Transformers, as well as the relative significance of each layer in forming the last-layer representation. Alternatively, we introduce the adoption of Cross-Layer Transcoders (CLTs) as reliable, sparse, and depth-aware proxy models for MLP blocks in ViTs. CLTs use an encoder-decoder scheme to reconstruct each post-MLP activation from learned sparse embeddings of preceding layers, yielding a linear decomposition that transforms the final representation of ViTs from an opaque embedding into an additive, layer-resolved construction that enables faithful attribution and process-level interpretability. We train CLTs on CLIP ViT-B/32 and ViT-B/16 across CIFAR-100, COCO, and ImageNet-100. We show that CLTs achieve high reconstruction fidelity with post-MLP activations while preserving and even improving, in some cases, CLIP zero-shot classification accuracy. In terms of interpretability, we show that the cross-layer contribution scores provide faithful attribution, revealing that the final representation is concentrated in a smaller set of dominant layer-wise terms whose removal degrades performance and whose retention largely preserves it. These results showcase the significance of adopting CLTs as an alternative interpretable proxy of ViTs in the vision domain.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。