Features that Make a Difference: Leveraging Gradients for Improved Dictionary Learning
Jeffrey Olmo, Jared Wilson, Max Forsey, Bryce Hepner, Thomas Vin Howe, David Wingate
TL;DR
This work addresses the gap where Sparse Autoencoders (SAEs) optimize reconstruction without accounting for downstream model impact. It introduces Gradient SAEs (g-SAEs), which augment the TopK sparsity with a gradient-weighted term $\beta \mathbf{z} \circ \left|W_{\text{dec}}^T \cdot \nabla_{\mathbf{x}}\mathcal{L}(\mathbf{x})\right|$, selecting the $k$ latent activations that not only carry strong signal but also strongly influence loss, enabling reconstructions that more faithfully preserve downstream behavior. Empirically, g-SAEs yield improved downstream loss compatibility, fewer dead latents, and latents that steer logits more effectively in arbitrary contexts, while maintaining interpretability comparable to standard TopK SAEs; these benefits persist across model sizes such as GPT-2 variants. The findings support a dual view of features as both representations and actions, offering a practical path to more faithful interpretability and finer-grained control of large language models. This advances dictionary learning by explicitly incorporating downstream effects into feature discovery, with potential implications for model steering and safety alongside interpretability.
Abstract
Sparse Autoencoders (SAEs) are a promising approach for extracting neural network representations by learning a sparse and overcomplete decomposition of the network's internal activations. However, SAEs are traditionally trained considering only activation values and not the effect those activations have on downstream computations. This limits the information available to learn features, and biases the autoencoder towards neglecting features which are represented with small activation values but strongly influence model outputs. To address this, we introduce Gradient SAEs (g-SAEs), which modify the $k$-sparse autoencoder architecture by augmenting the TopK activation function to rely on the gradients of the input activation when selecting the $k$ elements. For a given sparsity level, g-SAEs produce reconstructions that are more faithful to original network performance when propagated through the network. Additionally, we find evidence that g-SAEs learn latents that are on average more effective at steering models in arbitrary contexts. By considering the downstream effects of activations, our approach leverages the dual nature of neural network features as both $\textit{representations}$, retrospectively, and $\textit{actions}$, prospectively. While previous methods have approached the problem of feature discovery primarily focused on the former aspect, g-SAEs represent a step towards accounting for the latter as well.
