A benchmark for evaluating Sparse Autoencoders (SAEs) on Vision Transformers
Project description
VISAEBench
VISAEBench is a benchmark for evaluating Sparse Autoencoders (SAEs) trained on Vision Transformer (ViT) patch activations. It scores an SAE across four interpretability dimensions (reconstruction, concept detection, spatial coherence, disentanglement) using 7 metrics (M1 through M7). It supports cross-backbone evaluation across CLIP, DINOv2, SigLIP, MAE, and DeiT (all ViT-B/16 or ViT-B/14).
Installation
# From PyPI (after v0.1.0 release)
pip install visaebench
# From source (development)
git clone https://github.com/vraj130/visaebench && cd visaebench
pip install -e .
Quickstart
import visaebench
from visaebench.hub import load_sae
sae = load_sae("visaebench/clip-vitb16-saes", subfolder="batchtopk_16x_k128")
results = visaebench.evaluate(
sae=sae,
backbone_name="clip_vitb16",
imagenet_path="/path/to/imagenet/val", # or None to stream from HF
)
for r in results:
print(f"{r.name:30s} {r.value:.4f}")
Available SAE checkpoints
One HuggingFace repo per backbone; each holds 12 configs as subfolders (batchtopk_{8x,16x,32x}_k{64,128,192,256}).
| Backbone | HuggingFace repo |
|---|---|
| CLIP ViT-B/16 | visaebench/clip-vitb16-saes |
| DINOv2 ViT-B/14 | visaebench/dinov2-vitb14-saes |
| SigLIP ViT-B/16 | visaebench/siglip-vitb16-saes |
| MAE ViT-B/16 | visaebench/mae-vitb16-saes |
| DeiT ViT-B/16 | visaebench/deit-vitb16-saes |
The detailed 12-config table (all batchtopk_{8x,16x,32x}_k{64,128,192,256} subfolders) lives in docs/quickstart.md.
Documentation
docs/quickstart.md: end-to-end quickstart and the full checkpoint config table.docs/custom_models.md: evaluating your own SAE and custom backbones.docs/metrics.md: detailed description of the 7 metrics (M1 through M7).
Metrics
| # | Registry key | Dimension | Description |
|---|---|---|---|
| M1 | localization |
spatial_coherence | Per-feature spatial coherence on patch grid |
| M2 | fvu |
reconstruction | Fraction of variance unexplained |
| M3 | downstream_preservation |
reconstruction | Linear probe accuracy after reconstruction vs raw |
| M4 | sparse_probing |
concept_detection | Sparse logistic probe AUC over class labels |
| M5 | monosemanticity |
concept_detection | Cross-model feature consistency |
| M6 | cross_domain |
concept_detection | Generalization to OOD datasets (EuroSAT, DTD) |
| M7 | absorption |
disentanglement | WordNet-hierarchy concept absorption rate |
Citation
@inproceedings{visaebench2026,
title = {ViSAEBench: Cross-Backbone Evaluation of Vision Sparse Autoencoders Reveals Backbone-Dominated Variance and Metric Dissociations},
author = {TODO: maintainer to fill in author list},
booktitle = {ICML 2026 Mechanistic Interpretability Workshop},
year = {2026}
}
License
Apache 2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file visaebench-0.1.0.tar.gz.
File metadata
- Download URL: visaebench-0.1.0.tar.gz
- Upload date:
- Size: 75.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffaa3ab6450f884bfc6c463eb1373371cd85acb872224324d93a417c01cb167b
|
|
| MD5 |
a6d24af577c873a867bd1fa5fb18180c
|
|
| BLAKE2b-256 |
80b3a29aa821055f82a3d649ac49aee3409ef66f55966111a53c76195a74dfcc
|
Provenance
The following attestation bundles were made for visaebench-0.1.0.tar.gz:
Publisher:
publish.yml on vraj130/visaebench
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
visaebench-0.1.0.tar.gz -
Subject digest:
ffaa3ab6450f884bfc6c463eb1373371cd85acb872224324d93a417c01cb167b - Sigstore transparency entry: 2066647515
- Sigstore integration time:
-
Permalink:
vraj130/visaebench@597f33989aba3d85ad7f25b9fcb3601c20b3c6fb -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/vraj130
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@597f33989aba3d85ad7f25b9fcb3601c20b3c6fb -
Trigger Event:
release
-
Statement type:
File details
Details for the file visaebench-0.1.0-py3-none-any.whl.
File metadata
- Download URL: visaebench-0.1.0-py3-none-any.whl
- Upload date:
- Size: 91.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aaedfcd842f45f243625a3ba23e2983af9897e85bd7020c41557ad138ae76cea
|
|
| MD5 |
12ddc604b1da07a67362382636cbb2f0
|
|
| BLAKE2b-256 |
c399b5478540d0789504e0b02ecf26674bde4095664d2fe93b7aac9a2f1b1346
|
Provenance
The following attestation bundles were made for visaebench-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on vraj130/visaebench
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
visaebench-0.1.0-py3-none-any.whl -
Subject digest:
aaedfcd842f45f243625a3ba23e2983af9897e85bd7020c41557ad138ae76cea - Sigstore transparency entry: 2066647533
- Sigstore integration time:
-
Permalink:
vraj130/visaebench@597f33989aba3d85ad7f25b9fcb3601c20b3c6fb -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/vraj130
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@597f33989aba3d85ad7f25b9fcb3601c20b3c6fb -
Trigger Event:
release
-
Statement type: