Evaluating Sparse Autoencoders: From Shallow Design to Matching Pursuit

Valérie Costa, Thomas Fel, Ekdeep Singh Lubana, Bahareh Tolooshams, Demba E. Ba

TL;DR

Current shallow Sparse Autoencoders (SAEs) commonly used in mechanistic interpretability rely on single-step encoders that implicitly assume features are near-orthogonal, limiting their ability to extract correlated concepts. This paper introduces MP-SAE, an iterative architecture that unrolls the classic Matching Pursuit algorithm to greedily select features via residual updates. MP-SAE delivers superior reconstruction fidelity, supports adaptive sparsity at test time, and naturally learns coarse-to-fine, hierarchical concept decompositions.

What Problem Does This Paper Address?

Sparse autoencoders (SAEs) are widely used to decompose the internal activations of neural networks into sparse, human-interpretable concept vectors (motivated by the Linear Representation and Superposition Hypotheses).

However, virtually all standard SAEs (using ReLU, TopK, or JumpReLU activations) are shallow, one-step encoders. In classical sparse coding and dictionary learning theory, a single-step feedforward projection is only guaranteed to recover the true underlying sparse components if the dictionary atoms are mutually incoherent (near-orthogonal). Natural data and representations, however, are strongly correlated and hierarchical. As a result, shallow SAEs struggle to represent correlated features, display brittle behavior when test-time sparsity deviates from training, and fail to capture multi-scale structure.

Methods

The authors formulate sparse coding through unrolled dictionary learning, proposing the Matching Pursuit Sparse Autoencoder (MP-SAE):

  • Unrolled Matching Pursuit: Instead of picking all $k$ active features simultaneously in one shot (like TopK), MP-SAE runs $T = k$ sequential steps. At each step $t$:
  • It projects the current residual $r^{(t-1)} = x - \hat{x}^{(t-1)}$ onto all dictionary atoms.
  • It greedily selects the single atom $D_{j^{(t)}}$ with the largest inner product.
  • It updates the reconstruction and subtracts this atom's contribution from the residual.
  • Weight Tying: The encoder projection is tied directly to the transpose of the dictionary ($D^\top$), cutting parameter counts in half compared to standard SAEs with separate encoder weights.
  • Theoretical Guarantees:
  • Stepwise Orthogonality: The updated residual is always strictly orthogonal to the most recently chosen atom ($D_{j^{(t)}}^\top r^{(t)} = 0$).
  • Monotonic Error Reduction: The squared $\ell_2$ residual norm is guaranteed to decrease monotonically at every step ($\|r^{(t)}\|_2^2 \le \|r^{(t-1)}\|_2^2$).
  • Asymptotic Convergence: Reconstruction error converges asymptotically to the projection of the input onto $\text{span}(D)$.

Datasets

  • MNIST: Used as a controlled, interpretable testbed to evaluate learned dictionary geometries, concept visualizations, and sequential reconstruction dynamics.
  • ImageNet-1k: Evaluated on internal representations extracted from the final layers of four vision backbones: SigLIP, DINOv2, CLIP, and ViT (including spatial tokens and CLS tokens, totaling ~25 billion tokens).
  • No new datasets were introduced.

Key Insights and Ideas

  • Global Coherence vs. Local Incoherence: Using the Babel function (a cumulative coherence metric), the authors find that MP-SAE learns a globally correlated dictionary, yet its residual subtraction ensures that the subset of atoms selected for any given input is non-redundant and mutually incoherent. Shallow SAEs lack this mechanism: when their learned dictionary is coherent, they are forced to select redundant, overlapping features.
  • Emergent Hierarchy (Coarse-to-Fine): In MP-SAE, sorting atoms by activation magnitude reveals clean, full-digit prototypes that activate during early iterations to capture global structure. Subsequent iterations recruit localized pen-stroke atoms to capture residual details. Shallow SAEs show no such progression (ReLU learns only full digits; TopK learns only distributed stroke fragments).
  • Graceful Sparsity Generalization: Because MP-SAE guarantees monotonic residual decay, practitioners can tune inference sparsity dynamically ($k_{\text{test}} \neq k_{\text{train}}$) without retraining. By contrast, TopK performance catastrophically degrades when inference $k$ deviates from training $k$.

Key Results

  • Expressivity on Vision Backbones: Across SigLIP, DINOv2, CLIP, and ViT, MP-SAE consistently forms a higher Pareto frontier ($R^2$ reconstruction score vs. $L_0$ sparsity) than ReLU, TopK, and BatchTopK, despite having half the learnable parameters.
  • Dictionary Scaling on MNIST: When scaling dictionary size $p$ from $20$ to $2000$ (with $k=10$), shallow SAEs hit an error plateau beyond $p \approx 200$. In contrast, MP-SAE's Mean Squared Error (MSE) drops continuously, demonstrating efficient capacity utilization.
  • Inference Sparsity Robustness: On DINOv2 representations trained with fixed $L_0 \in \{5, 10, 20, 50\}$, evaluating at $L_0$ up to $200$ causes TopK error to explode (MSE increases sharply), whereas MP-SAE's reconstruction error decays monotonically across all settings.

Limitations and Future Work

  • Computational Overhead: MP-SAE is inherently sequential ($T$ steps per input), introducing higher latency during training and inference compared to a single matrix multiplication in shallow SAEs.
  • Evaluation on LLMs: While the paper validates MP-SAE on MNIST and multiple large vision models, language models (where SAEs are most heavily applied in interpretability) are not tested.
  • Scaling to Extreme Expansion Ratios: Evaluating whether the sequential overhead remains manageable at the massive dictionary sizes (tens or hundreds of thousands of atoms) common in LLM feature extraction remains an open question.

Summary updated

BibTeX
@inproceedings{costa2025evaluating,
  author = {Valérie Costa and Thomas Fel and Ekdeep Singh Lubana and Bahareh Tolooshams and Demba E. Ba},
  title = {{Evaluating Sparse Autoencoders: From Shallow Design to Matching Pursuit}},
  booktitle = {MOSS @ ICML},
  year = {2025},
  url = {https://openreview.net/forum?id=SLGftRJVUN},
}
Figure