Supervised sparse auto-encoders for interpretable and compositional representations

Ouns El Harzli, Hugo Wallner, Yoonsoo Nam, Haixuan Xavier TaoarXiv 2026

TL;DR

This paper introduces Supervised Sparse Auto-Encoders (SSAEs), a framework that bypasses the optimization instabilities and semantic misalignment of traditional unsupervised SAEs by defining a concept-aligned sparse latent space upfront. Leveraging theoretical insights from neural collapse theory, the authors demonstrate that a decoder-only SSAE can successfully reconstruct and modularly edit prompt embeddings in Stable Diffusion 3.5, achieving excellent compositional generalization to unseen feature combinations.

What Problem Does This Paper Address?

Sparse Auto-Encoders (SAEs) have become a go-to tool in mechanistic interpretability for extracting human-understandable features from the internal activations of large language and vision models. However, standard SAEs are trained in an unsupervised fashion and face two major hurdles:

  1. The $L_1$ Penalty Problem: To force sparsity, unsupervised SAEs rely on $L_1$ regularization. This non-smooth penalty introduces severe optimization challenges and training instabilities that worsen as model dimensionality scales up.
  2. Semantic Misalignment: Unsupervised feature discovery often yields entangled, noisy, or uninterpretable latents that do not cleanly align with human concepts.

The authors tackle these limitations by shifting from unsupervised feature discovery to supervised sparse feature design, ensuring perfect semantic alignment by construction while completely eliminating the need for an $L_1$ penalty.

Methods

The core innovation is the Supervised Sparse Auto-Encoder (SSAE), which adapts the mathematical framework of unconstrained feature models from neural collapse theory.

Instead of forcing an encoder to discover sparse features, the authors predefine a sparse latent space matrix $Y$ based on a known dictionary of concepts. Each concept is allocated a specific, dedicated sub-vector block (or subspace) of dimension $d$ within the latent space. If a concept is present in a training sample, its corresponding sub-vector parameters are learnable; if it is absent, they are strictly zeroed out.

SSAE Training and Editing Workflow

In its simplest form, the SSAE is decoder-only. It optimizes the dictionary of concept embeddings $Y$ and the decoder weights $W_2$ jointly by minimizing a standard MSE reconstruction loss: $$\mathcal{L} = \|X - W_2\sigma(Y)\|_2^2$$ where $X$ represents the target feature representations (e.g., prompt embeddings) and $\sigma$ is an activation function like ReLU. Because the sparsity pattern is fixed a priori based on the dataset's labels, no $L_1$ regularization is required. The paper also notes that the framework can optionally incorporate an encoder using element-wise mask multiplication.

Datasets

The method was validated on the prompt embedding space of Stable Diffusion 3.5 Large Turbo.

  • Training Set: The authors constructed a custom concept dictionary of visual attributes spanning physical features (blond hair, blue eyes), poses (seated, standing), objects (gun, coffee cup), and environments (boat, car, street).
  • They generated a dataset of 1,500 prompts featuring varied combinations of these concepts.
  • To strictly evaluate compositional generalization, the training set was explicitly designed to exclude certain concept combinations (e.g., characters possessing both blond hair and blue eyes simultaneously were never shown during training).

Key Insights and Ideas

  • Auto-Encoding as an Unconstrained Feature Model: Unconstrained feature models treat features as free, learnable parameters independent of input data, which historically limited their practical use. The authors realized that auto-encoding is the perfect playground for this theory: since the input and output are intended to be identical, training the decoder parameters solely against the target outputs loses no critical information.
  • Implicit Geometric Bias: A beautiful consequence of optimizing features through a shared linear decoder via gradient descent is that the optimization dynamics naturally push different concept subspaces to become approximately orthogonal ($\langle v_{k1}, v_{k2} \rangle \approx 0$). This implicit decorrelation prevents different concepts from interfering with one another, providing a theoretical explanation for why the model generalizes so well to novel compositions.

Key Results

The trained SSAE demonstrated remarkable capabilities in feature-level intervention and semantic image editing at inference time without modifying the underlying text prompts:

  • Compositional Generalization: When evaluating unseen concept combinations (like generating a "blond hair, blue eyes" character from a baseline "brune hair, blue eyes" prompt embedding), the model successfully synthesized the new attributes while preserving the rest of the image layout.
  • Robustness: In a stress-test evaluating the hair-color swapping task across more than 50 images, the SSAE successfully altered the target attribute 100% of the time.
  • Modular Editing: The authors showcased successful zero-shot latent manipulations, including concept swapping (e.g., brune $\rightarrow$ blond), concept removal (e.g., erasing a gun), and concept insertion (e.g., adding a coffee cup or coca-cola).
Example of Modular Concept Manipulation

Limitations and Future Work

While a powerful proof-of-concept, the authors highlight several limitations:

  • Predefined Concept Scope: The model is strictly bounded by its supervised dictionary; it cannot discover new or emergent features post-hoc.
  • Manual Bottleneck: Constructing high-quality concept dictionaries currently requires human engineering, though the authors suggest this could be automated using large Vision-Language Models (VLMs) in the future.
  • Scale and Domain: The empirical evaluation was limited to a relatively small scale (1,500 prompts, concept subspace dimension $d=10$) and focused exclusively on Stable Diffusion prompt embeddings. Future work is needed to validate this architecture on internal transformer hidden states and U-Net feature maps across text and video generation domains.

Summary updated

BibTeX
@misc{harzli2026supervised,
  author = {Ouns El Harzli and Hugo Wallner and Yoonsoo Nam and Haixuan Xavier Tao},
  title = {{Supervised sparse auto-encoders for interpretable and compositional representations}},
  year = {2026},
  eprint = {2602.00924},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.00924},
}
Figure