Introduction
Mechanistic interpretability (MI) seeks to reverse-engineer neural networks to understand the human-interpretable algorithms embedded within their weights. While the field has seen significant growth in the natural language processing (NLP) domain—facilitated by tools like TransformerLens and the availability of pre-trained Sparse Autoencoders (SAEs)—vision and video models have remained relatively opaque. This disparity stems from high compute costs, a lack of standardized codebases, and fundamental architectural differences. Unlike language models that process discrete tokens, vision transformers (ViTs) handle continuous visual patches, utilize specialized [CLS] tokens, and are often trained via contrastive or self-supervised objectives.
To bridge this gap, we introduce Prisma, an open-source framework specifically designed for the mechanistic analysis of vision and video transformers. Prisma provides a unified interface for activation caching, circuit discovery, and sparse coding across more than 75 model architectures.
The Prisma Framework
Prisma adapts successful NLP interpretability paradigms to the visual domain through several core components:
Unified Model Interface
The library centers around the HookedViT module, which wraps models from HuggingFace, timm, and OpenCLIP. This wrapper enables layer-wise activation caching and forward-pass interventions, such as activation patching. Prisma extends this support to video-specific architectures like ViViT and V-JEPA, handling complex features like 3D tubelet embeddings.
Sparse Coder Architectures
Prisma includes built-in support for training and evaluating various Sparse Autoencoder (SAE) architectures, including ReLU, Top-K, JumpReLU, and Gated implementations. These tools allow researchers to decompose high-dimensional activations into sparse, interpretable features.
Circuit Analysis and Visualization
The toolkit integrates automated circuit discovery (ACDC), logit lenses, and attention head visualizers. To facilitate low-compute experimentation, the release also includes a suite of 1-to-4 layer "toy" ViTs, allowing for rapid hypothesis testing before scaling to larger models.
Experimental Setup and Open-Source Assets
A primary contribution of this work is the release of an extensive suite of pre-trained weights. We provide over 80 pre-trained SAEs and transcoders for CLIP-B/32 and DINO-B/32 models across all 12 layers. These models were trained using ImageNet1k to ensure a robust baseline for the community. The release includes specialized variants focusing on all patches, the [CLS] token only, or spatial patches only.
Insights into Vision Model Representations
Early experiments using Prisma have revealed several fundamental differences between vision and language models.
The Density Gap
One of the most striking findings is that vision representations are significantly denser than those in language models. While language SAEs typically achieve high explained variance with an L0 (the number of active features per token) between 12 and 74, vision SAEs require much higher density. For CLIP-B/32, more than 500 active features per patch are often necessary to maintain comparable performance. In extreme cases, such as the Kandinsky encoder, the [CLS] token can exhibit an L0 as high as 122,631.
We propose several hypotheses for this density gap:
- Information Distribution: Visual data may have a denser information distribution than text.
- Granularity: ViTs typically process fewer units (approx. 50 patches) compared to the 1000+ tokens often used in LLM contexts.
- Token Specialization: The roles of patches may be less distinct than text tokens.
- Methodological Bias: Current SAE training techniques, largely inherited from NLP, may not be optimized for the continuous nature of visual data.
The [CLS] Token as an Information Sink
Analysis of feature distribution across layers reveals that the [CLS] token acts as a global information sink. As data progresses through the network, the number of active SAE features in spatial patches decreases, while the L0 of the [CLS] token increases. This suggests a mechanical shift where local spatial information is compressed into a single, global representation.
SAEs as Denoisers
In a counterintuitive result, we found that injecting SAE reconstructions back into the model's forward pass can actually improve performance. For CLIP-B, using a Top-K=64 CLS-only SAE improved the model's cross-entropy loss, with the effect becoming more pronounced in deeper layers (reaching a +2.97% recovery at layer 11). This suggests that SAEs may be performing a form of "denoising" on the model's internal representations.
Discussion and Future Work
Prisma provides the foundational tooling necessary to advance vision MI, yet our initial findings raise new questions. The "denoising" effect of SAEs remains a mystery that warrants further investigation. Additionally, the density gap suggests that simply porting NLP techniques may be insufficient; developing vision-specific SAE training objectives is a high-priority area for future research. Finally, exploring the relationship between patch size and feature sparsity will be critical for understanding how architectural choices influence model interpretability.
Summary updated