Prisma: an open-source toolkit for mechanistic interpretability of vision and videoPrisma: An Open Source Toolkit for Mechanistic Interpretability in Vision and Video
The authors introduce Prisma, a toolkit for visual and video mechanistic interpretability. Their analysis indicates that visual SAEs exhibit lower sparsity than language SAEs, and that reconstruction in certain layers can reduce the model's cross-entropy loss.
- Mechanistic interpretability research in vision and video is constrained by the lack of unified, easy-to-use open-source tools and pretrained weights. Because vision models differ structurally from language models in continuous inputs, spatial patch tokenization, and non-autoregressive objectives, directly reusing language tools faces obstacles.
- The authors developed the open-source framework Prisma, which provides a unified HookedViT interface and activation caching supporting more than 75 models, implements a training and evaluation suite for SAEs, transcoders, and crosscoders, open-sources more than 80 pretrained SAE weights covering all layers of CLIP and DINO, and integrates circuit analysis and visualization tools.
- Experiments found that the internal representations of vision SAEs are denser than those of language SAEs, with the Kandinsky pretrained SAE reaching a CLS L0 of 122,631. In the Top-K (k=64) CLS-dedicated SAE for CLIP-B-32 and in some layers of DINO-B, injecting the SAE reconstruction during the forward pass reduced the model's cross-entropy loss.
- The reasons for the low sparsity of visual SAEs remain undetermined, and the cross-modal sparsity differences and the internal mechanism by which injected reconstructions reduce loss are still unclear; currently, only CLIP-B-32 and DINO-B-32 have been trained and evaluated on ImageNet-1k, and the transcoder has only been evaluated on CLIP's MLP layers.
- Evaluated models
- CLIP-ViT-B-32DINO-B-32toy vision transformers (toy ViTs)Kandinsky ViT encoder
- Benchmarks
- ImageNet-1k
- Metrics
- L0% Explained varCos simRecon cos simCERecon CE% CE recovered% Alive featuresTop-1 AccuracyTop-5 Accuracy
The researchers release Prisma, an open-source toolkit for mechanistic interpretability of vision and video transformers, providing a unified interface to over 75 vision and video models, supporting SAE, transcoder, and crosscoder training, and open-sourcing weights for over 80 pretrained SAEs. The paper states that effective vision SAEs have much lower sparsity than language SAEs, with CLIP-B/32 having an L0 of around 500 or more per patch, while the language model GPT-2 Small has 12 to 74, and the CLS token L0 for the Kandinsky encoder is as high as 122,631. The authors also find that injecting SAE reconstructions into the forward pass sometimes reduces the original model's cross-entropy loss, and speculate this may be related to the denoising properties of SAEs, though the exact mechanism is unclear.
Why it was selectedThe paper open-sources a mechanistic interpretability toolkit for vision and video transformers and reports a preliminary observation that visual SAEs have lower sparsity than language SAEs.
Paper analysis
What problem does this paper attempt to solve?
The authors aim to address the lack of standardized open-source tools, pretrained weights, and cross-modal adaptation support for vision and video mechanistic interpretability.
This paper addresses the lack of a unified, scalable mechanistic interpretability toolkit and pretrained sparse autoencoder (SAE) resources for vision and video Transformers.
- Lagging tool ecosystem: Mechanistic interpretability has developed rapidly in language models, thanks to mature circuit analysis tools and publicly available SAE weights; however, research in vision and video has lagged due to the lack of easy-to-use frameworks and pretrained weights.
- Fundamental cross-modal differences: Vision and language models differ fundamentally in architecture and function; vision inputs are continuous signals with spatial patch tokenization, lack a canonical dictionary, and outputs typically rely on contrastive learning or unsupervised objectives rather than next-token prediction, preventing direct transfer of existing language tools.
- High barrier to video analysis: Mechanistic interpretability of video Transformers is constrained by high computational costs and the lack of dedicated tools; existing work often relies on proxy tasks or automatic concept discovery and lacks fine-grained hierarchical activation intervention support.
- Open-source toolkit solution: The paper proposes the open-source framework Prisma, which provides a unified hook and activation caching interface for more than 75 vision and video models, supports training and evaluation of SAEs, transcoders, and crosscoders, and provides pretrained weights and circuit analysis tools.
What related research exists?
The authors review language and visual mechanistic interpretability, sparse coding and circuit analysis methods and tools, and point out the lack of specialized open-source toolkits tailored to visual characteristics.
Language and vision mechanistic interpretability
- Conmy et al. (2023), Marks et al. (2024), and Wang et al. (2022) explored causal circuit tracing and sparse representation reverse engineering in language models; early vision interpretability work by Caron et al. (2021), Naseer et al. (2021), and Raghu et al. (2021) mainly used feature visualization and attention analysis.
- Achtibat et al. (2023), Gandelsman et al. (2024), and Joseph and Nanda (2024) advanced mechanistic interpretability for vision Transformers; Kowal et al. (2024), Ghodrati et al. (2018), and Li et al. (2018) studied automatic discovery of spatiotemporal concepts, dynamic information utilization, and scene bias mitigation for video models.
Sparse coding and circuit analysis methods
- Bricken et al. (2023) and Cunningham et al. (2023) proposed sparse autoencoders (SAEs) that decompose single-layer representations into interpretable features; Dunefsky et al. (2024, 2025) and Marks (2024) extended these into cross-layer transcoders; Lindsey et al. (2024) proposed crosscoders for tracing persistent features across layers and models.
- Heimersheim and Nanda (2024) and Nanda (2023) studied activation patching and gradient-based attribution patching for isolating key components; Conmy et al. (2023) and Rajaram et al. (2024) developed the automated circuit discovery algorithm ACDC in the language and vision domains, respectively.
Open-source interpretability tool ecosystem
- Nanda and Bloom (2022) developed TransformerLens, a circuit analysis tool for language models; Fiotto-Kaufman et al. (2024) developed NNsight, a general framework supporting model interventions, but the authors note it was not specifically designed for vision models.
- Bloom and Chanin (2024) developed SAELens to assist SAE training and analysis; Gao et al. (2024) and EleutherAI (2024) open-sourced Top-K SAE training code and the Sparsify tool library; Lieberum et al. (2024) open-sourced Gemma Scope covering all layers of Gemma 2.
- Joseph and Nanda (2024) proposed a foundational framework for vision circuits in Transformers; the authors note that Prisma extends this with sparse encoder training, and that currently no other open-source toolkit is specifically designed for vision mechanistic interpretability.
Evaluation and method settings
- The paper trains and evaluates sparse encoders for CLIP-ViT-B-32 and DINO-B-32 on the ImageNet-1k benchmark, covering ReLU, Top-K, JumpReLU, and Gated architectures as well as transcoder variants.
The authors state that existing open-source toolkits are not specifically designed for vision mechanistic interpretability, and that vision models differ from language models in tokenization, architecture, and analysis paradigms; Prisma fills this gap in tools and open-source pretrained resources.
How does the paper address this problem?
Prisma builds a HookedViT interface that uniformly integrates more than 75 models, supports multiple sparse encoders and circuit analysis, and open-sources pretrained weights.
The authors developed the open-source framework Prisma, which, by continuing TransformerLens's naming conventions and hook interface, provides a complete toolchain from model wrapping and sparse encoder training to circuit analysis, tailored to vision and video characteristics.
Model integration and HookedViT architecture
- Unified model wrapping: The core module HookedViT integrates more than 75 pretrained model configurations from Hugging Face, OpenCLIP, and timm, covering architectures such as ViT, CLIP-ViT, and DINO; the authors state it facilitates integration of newly released open-source models from the community.
- Video and generative model extensions: Dedicated support such as 3D tubelet embeddings is introduced for video Transformers (ViViT, V-JEPA); the Kandinsky ViT encoder and its pretrained SAE are also adapted for image generation guidance in diffusion models.
Sparse encoders and circuit analysis core components
- Multi-architecture encoder support: Supports training sparse autoencoders (SAEs), transcoders, and crosscoders on HookedViT representations, implementing four sparse activation mechanisms: ReLU, Top-K, JumpReLU, and Gated.
- Circuit analysis and intervention: The HookedSAEViT module supports replacing network layers during the forward pass for feature-level circuit analysis, and integrates the ACDC algorithm for automated circuit discovery.
Training configuration and optimization mechanisms
- Flexible training strategies: Training configurations support encoder and decoder initialization choices (encoder weights initialized as the transpose of decoder weights), activation normalization, dead feature resampling, and early stopping; both activation caching and on-the-fly computation modes are provided to balance latency and GPU memory usage.
- Training hyperparameter settings: Trained for 1 epoch on ImageNet-1k with the Adam optimizer, with the learning rate warmed up over 200 steps and then cosine-annealed from 1e-5 to 1e-1, and a batch size of 4096; the L1 penalty coefficient is swept over the range [10^-11, 1], and ghost gradients auxiliary loss is introduced to suppress dead features.
- Dictionary dimension expansion: Uses an x64 expansion multiplier, mapping the 768-dimensional activation space to a dictionary containing 49,152 features.
Evaluation suite and auxiliary resources
- Evaluation and visualization: Built-in evaluation for sparse encoders covering L0 sparsity, reconstruction loss, and replacement loss, with support for max-activating image retrieval; also provides attention weight and logit lens visualization tools.
- Open-source weights and toy models: Open-sources more than 80 pretrained SAE and transcoder weights for the full residual stream of CLIP-B and DINO-B; also releases 1–4 layer toy ViT checkpoints trained on ImageNet (including full-architecture and attention-only variants) for hypothesis validation in low-compute settings.
What experiments did the paper conduct?
The paper evaluates full-layer SAEs and transcoders for CLIP and DINO on ImageNet-1k, reporting the high-density characteristics of visual representations and the phenomenon of reconstruction reducing loss.
Experimental Setup
- Models tested: CLIP-ViT-B-32 (abbreviated CLIP-B-32 or CLIP-B), DINO-B-32 (abbreviated DINO-B), the Kandinsky ViT encoder, and 1–4 layer toy ViT models (tiny, base, small, medium).
- Dataset and scale: ImageNet-1k (the paper does not report the specific number of samples).
- Sparse encoder variants: Vanilla ReLU SAE and Top-K SAE (k=64, 128) for CLIP-B with full patch, CLS-only, and spatial patch configurations; CLIP MLP transcoders (k = 256, 512, 768, 1024); and a full patch Vanilla ReLU SAE for DINO-B.
- Evaluation metrics: % Explained var, Avg L0 (average number of active features), Cos sim (cosine similarity), Recon cos sim (reconstruction cosine similarity), CE (original cross-entropy loss), Recon CE (reconstruction cross-entropy loss), % CE recovered, % Alive features, and Top-1 and Top-5 accuracy.
- Evaluation and testing protocol: Cross-entropy loss changes and reconstruction fidelity metrics are computed by replacing activations during forward passes; classification tasks report Top-1 and Top-5 accuracy; the paper does not report an LLM judge model, decision thresholds, or the number of repeated runs.
Main Results
According to Table 4, Table 5, Table 6, Table 7, Table 8, and Table 9, the performance of each sparse encoder at the final layer (residual stream layer 11 or MLP layer 10) is as follows:
Swipe horizontally to read the table
Model and configuration Explained variance L0 Cosine similarity Reconstruction CE % CE recovered (source) CLIP-ViT-B-32 (Vanilla full patch, L11 resid_post) 98.4% 1405.0 0.993 6.765 98.03% (Table 4) CLIP-ViT-B-32 (Vanilla CLS, L11 resid_post) 65% 386.09 0.81890 6.7853 84.1918% (Table 5) CLIP-ViT-B-32 (Top-K k=64 CLS, L11 resid_post) 84% 64 0.91880 6.7578 102.97% (Table 6) CLIP-ViT-B-32 (Vanilla spatial patch, L11 resid_post) 99% 829.09 0.99 6.7622 100.00% (Table 7) CLIP-ViT-B-32 (Top-K transcoder, L10 MLP) 97% not reported 0.9334 6.7636 93.95% (Table 8) DINO-B (Vanilla full patch, L11 resid_post) 99% 1085 0.99673 1.911608 99.48% (Table 9) Note: The original CE for CLIP is 6.7621 or 6.7622, and the original CE for DINO-B is 1.885370; in Table 8, the transcoder k=1024 has an Avg CLS L0 of 1019, and the Avg L0 for full patch is not reported. The table omits data for intermediate layers and classification accuracy for the toy ViT models.
- Trade-off between sparsity and explained variance: The authors note that while maintaining relatively high explained variance, the number of active features (L0) in visual SAEs is generally high (full patch often exceeds 800 to 1400), with sparsity significantly lower than that of language SAEs.
- Reconstruction improving model loss: The authors note that in the CLIP Top-K (k=64) CLS-only SAE at layer 11, Recon CE drops to 6.7578 (below the original CE of 6.7622), and % CE recovered reaches 102.97%, indicating that injecting SAE reconstructions into the forward pass can reduce the original model's cross-entropy loss at specific layers.
- Transcoder and spatial patch performance: The authors note that no similar loss reduction was observed in the CLIP transcoder (Table 8) or the Vanilla spatial patch SAE (Table 7), and the mechanism remains to be explored.
High Density of Visual SAEs and Cross-Modal Comparison
- What was measured: The L0 active feature counts of CLIP-B/32 and Kandinsky pretrained SAEs were measured and compared with language models (e.g., GPT-2 Small) in terms of sparsity.
- Results: CLIP-B/32 has an L0 exceeding 500 per patch (Section 5.1), while GPT-2 Small has an L0 of only 12–74 per token (Bloom, 2024); the Kandinsky encoder's pretrained SAE has an L0 of 122,631 per CLS token (Section 5.1).
- Authors' interpretation: The authors state that visual input representations may be inherently denser than language and lack a power-law distribution; after normalizing by scale using approximately 50 patches for CLIP-B/32 and 1024 tokens for GPT-2, the sparsity of the two becomes more comparable.
Token Specialization and Hierarchical Dynamics of Alive Features
- What was measured: The trend in the proportion of alive features for CLS tokens and spatial patch tokens across network layers in CLIP-B/32 was analyzed (Figure 2, Table 5, Table 6).
- Results: The proportion of alive features in the Vanilla CLS SAE rises from 4.33% at layer 0 to 99.996% at layer 11 (Figure 2, Table 5); spatial patches, in contrast, show a decreasing utilization trend in deeper layers (Figure 2).
- Authors' interpretation: The authors state that this reflects the aggregation of visual information from local spatial patches to global CLS tokens; CLS tokens require more features in deeper layers to carry rich global representations, suggesting that the optimal Top-K setting should be dynamically adjusted according to token type and layer depth.
Toy Vision Transformer Training Benchmark
- What was measured: Toy ViT models with 1–4 layers (including full architectures with MLP and attention-only architectures, with patch sizes of 16 and 32) were trained on ImageNet-1k and evaluated for classification accuracy (Table 2, Table 3).
- Results: With patch size 16, the 4-layer full architecture (medium) achieves Top-1 accuracy of 0.33 and Top-5 of 0.56, while the 4-layer attention-only architecture achieves Top-1 of 0.17 and Top-5 of 0.36 (Table 2); with patch size 32, the 3-layer full architecture achieves Top-1 of 0.22 and Top-5 of 0.42 (Table 3).
- Authors' interpretation: The authors state that attention-only variants are easier to analyze mathematically, and that toy models can provide a controlled experimental environment for validating initial hypotheses about full-size networks under low computational resources.
Other Ablations and Analyses
- L1 regularization coefficient sweep: scanned over the interval [10^-11, 1] to balance sparsity and reconstruction quality (Section 4).
- Learning rate scheduling: cosine annealing learning rates were scanned over the range 1e-5 to 1e-1, with 200 steps of warmup (Section 4).
- Dictionary expansion multiplier: an x64 expansion multiplier was used, mapping the 768-dimensional activation space to 49,152 features (Section 4).
- Transcoder K value variations: k was set to 256, 512, 768, and 1024 in the MLP transcoder, with explained variance ranging from 76% to 98% (Table 8).
- Top-K spatial patch SAE variants: configurations with k=64 and k=128 were provided (Table 1).
Negative Results and Exceptions
- In the CLIP transcoder (Table 8), the CLIP Vanilla spatial patch SAE (Table 7), and the CLIP Vanilla CLS-only SAE (Table 5), no improvement in cross-entropy loss was observed from injecting reconstructions, and the authors state that the specific mechanism remains unclear.
What are some points that can be further explored?
The authors note that the optimal sparsity for visual SAEs, the impact of patch size, and the mechanism by which reconstruction reduces loss remain to be explored, and that specialized visual training techniques have yet to be developed.
Limitations and future directions noted by the authors
- Optimal sparsity and training techniques for vision SAEs: The authors note that current vision SAE training methods originate from the language domain, dedicated vision SAE training techniques have not yet been developed, and the sparsity differences between modalities remain an open question (Section 5.1).
- Relationship between patch size and L0: The authors note that the specific relationship between patch size and L0 sparsity still requires further investigation (Section 5.1).
- Underlying mechanism by which reconstruction reduces loss: The authors note that the specific mechanism by which injecting SAE reconstructions in some layers reduces model loss remains unclear, offering an attractive future research direction for the vision mechanistic interpretability community (Section 5.2).
- Delving into internal network mechanisms and open-source collaboration: In the conclusion, the authors express hope that researchers will build on this work to explore the internal mechanisms of vision Transformers and participate in the open-source development of Prisma (Section 6).
Experimental coverage
- Models tested: Experiments conducted sparse autoencoder and classification evaluations on two vision backbones, CLIP-ViT-B-32 and DINO-B-32, as well as toy ViT models with 1–4 layers, and analyzed the L0 of the pretrained SAE for the Kandinsky ViT encoder (Sections 4, 5.1, 9, 10).
- Training and evaluation data: Sparse autoencoders, transcoders, and toy models were all trained for 1 epoch on the ImageNet-1k dataset and evaluated (Sections 4 and 10).
- Transcoder evaluation scope: Transcoder evaluations covered only the MLP sublayers of the CLIP model; transcoder metrics for attention sublayers were not reported (Table 8).
- Video model support: The codebase architecturally integrates ViViT and V-JEPA video encoders, but the experimental evaluation section does not report SAE training or loss data on video models (Sections 3.1.1 and 10).
- Unreported experimental parameters: The paper does not report the specific number of test samples, number of repeated runs, or statistical dispersion metrics such as standard deviation (Section 10).
Summarize the main content of the paper
The paper proposes Prisma, a toolkit for visual and video mechanistic interpretability. The authors analyze that visual representations have high-density characteristics and that reconstruction can reduce model loss at specific layers.
This paper introduces Prisma, an open-source mechanistic interpretability toolkit for vision and video Transformers.
- Positioning and goals: Given the lack of standardized tools and pretrained weights for vision and video models, Prisma aims to lower the research barrier and fill the gap in cross-modal mechanistic interpretability tools.
- Core tool support: Built on HookedViT, which is compatible with TransformerLens conventions, it integrates more than 75 vision and video models, provides training support for sparse autoencoders such as ReLU, Top-K, JumpReLU, and Gated, as well as transcoders and crosscoders, and open-sources more than 80 pretrained weights and circuit analysis functionality.
- High density of vision representations: The authors' analysis shows that vision SAE activation density is higher than that of language models; CLIP-B/32 has an L0 exceeding 500 per patch (Section 5.1), and the Kandinsky pretrained SAE reaches a CLS L0 of 122,631 (Section 5.1), demonstrating differences in cross-modal representation characteristics.
- Forward-pass reconstruction reduces loss: On CLIP-ViT-B-32, the Top-K (k=64) CLS-dedicated SAE at layer 11 achieves a Recon CE of 6.7578 (lower than the original CE of 6.7622), with a cross-entropy recovery rate of 102.97% (Table 6); DINO-B reaches a recovery rate of 100.30% at layer 7 (Table 9).
- Token specialization and surviving feature dynamics: In deeper layers, the proportion of surviving features for the CLS token increases from 4.33% at layer 0 to 99.996% at layer 11 (Table 5), forming a complementary distribution with spatial patches and reflecting the pattern of local features converging globally.
- Authors' conclusions and implications: The authors believe current vision SAE training methods are constrained by the language interpretability framework, that dedicated vision training paradigms need to be developed, and they look forward to the community using Prisma to explore open questions such as representation density and denoising mechanisms.