11.6 — Sparse autoencoders for feature extraction (and scaling to frontier models)
Goal: Derive the sparse autoencoder (SAE) as the tool that recovers monosemantic features from superposed activations: encoder $f = \sigma(W x + b)$ + decoder $x \approx W^\top f$ + L1 sparsity penalty. Cover the training-time choices that matter (sparsity weight, expansion factor, dead features) and the scaling story from toy models (Bricken et al., 2023) to Claude 3 Sonnet (Templeton et al., 2024).
1. Why this session exists
Cap 11.5 established the problem: trained networks pack more features than dimensions, using oblique directions and sparsity. Neurons are polysemantic; the right unit of analysis is features — directions in activation space.
This session covers the tool that extracts those features: the sparse autoencoder (SAE). Conceptually simple: train a one-hidden-layer autoencoder on the model's activations, with a sparsity penalty on the hidden activations. The hidden units of the SAE become candidate features.
The pipeline:
- Run the model on a large dataset. Collect activations at some chosen layer.
- Train an SAE: encoder , decoder , loss .
- Set the hidden dimension — typically to — so the SAE has room for more features than the activation has dimensions.
- Interpret each hidden unit as a candidate feature; check its activation patterns across inputs.
Bricken et al. (2023, Anthropic, Towards Monosemanticity) demonstrated the tool on a -layer Transformer; Templeton et al. (2024, Scaling Monosemanticity) scaled to Claude 3 Sonnet and extracted features. The technique is now standard in mech-interp.
2. The autoencoder primitive
An autoencoder learns to reconstruct its input through a bottleneck. The standard form:
with parameters trained by . The encoder compresses; the decoder reconstructs.
For superposition recovery, we want expansion, not compression — the hidden dimension is larger than the input. The bottleneck is replaced by a sparsity bottleneck: the hidden activations are constrained to be sparse, so most hidden units are zero on any given input.
2.1 The SAE architecture
Standard sparse autoencoder (Bricken et al., 2023)[1]:
with , , . The decoder columns are unit-norm in most implementations (constrained during training).
The objective:
The L1 penalty pushes most to zero, leaving only a few active per input. This is the classical sparse-coding setup (Olshausen & Field, 1996).
2.2 Why this should work
The hypothesis: the network's true feature dictionary is the matrix whose columns are the directions in activation space corresponding to the model's features. If we set the SAE's and train to reconstruct activations sparsely, the optimum has approximating (up to column reordering and scaling), and approximating the sparse code of the active features.
This is conjectural — there are degeneracies and ambiguities — but empirically the result is striking: SAE columns do recover interpretable feature directions for the vast majority of trained units. The "majority of trained units" caveat is real (some columns are dead, some are duplicates), and is the subject of much practical engineering.
3. Training details that matter
The naive recipe works but underperforms. Several practical refinements have been adopted.
3.1 Dead features
A feature is dead if its encoder bias has become so negative that never fires for any input. Once dead, it gets no gradient updates and stays dead.
In a naive SAE, a substantial fraction of features die during training — often –. The countermeasures:
- Ghost gradients (Bricken et al., 2023). For each dead feature, periodically re-initialise its decoder direction in a high-error region of activation space, allowing it to be useful again.
- Resampling. Periodically zero out dead features and re-initialise them with random vectors aligned with reconstruction errors.
Both reduce dead-feature rates to in practice.
3.2 Sparsity weight
The hyperparameter controls the L1 strength. The Pareto front:
- Small : high reconstruction quality, low sparsity — many features active per input, polysemantic.
- Large : low reconstruction quality, high sparsity — few features active, monosemantic but lossy.
The sweet spot depends on the application. For interpretability ("what is this feature?"), sparser is better. For downstream use ("steer the model"), reconstruction quality matters more. Production SAEs target ~– active features per input.
3.3 The expansion factor
. Bricken et al. used initially; later work scaled to . Larger expansion gives finer-grained features but at higher training cost. Templeton et al. (2024)[2] used up to M for Claude 3 Sonnet's residual-stream activations of — i.e., .
Diminishing returns: doubling above tends to split existing features into finer sub-features (e.g., one "code" feature becomes "Python code", "C code", "JavaScript code") rather than discover entirely new ones. The frontier-model SAE literature is partly about this feature-splitting phenomenon.
3.4 Top-k vs. L1
A variant — Top- SAE (Gao et al., 2024, arXiv:2406.04093)[3] — replaces the L1 penalty with an explicit constraint: keep only the top- activations per input, zero the rest.
Top- SAEs train more reliably (no dead-feature problem; no tuning), achieve comparable reconstruction at similar sparsity, and have become the default in 2024–2026 production interpretability work.
3.5 JumpReLU and other activations
Refinement: the JumpReLU (Rajamanoharan et al., 2024)[4] replaces standard ReLU with a thresholded ReLU, , learning the threshold per feature. This decouples the sparsity decision (binary: active or not) from the magnitude (continuous: how much). Empirically tighter Pareto frontier than standard ReLU SAEs.
4. Interpreting features
Once trained, the SAE has candidate features. How do you interpret them?
4.1 Activation-based naming
For each feature , find the inputs in the training set that maximally activate feature . Examine the top- activating inputs (typical –) and look for a common theme.
Example feature in GPT-2 small (Bricken-style analysis):
Feature 12389: Activates on tokens that are inside a Python list comprehension's expression part. Top examples:
[x**2 for x in ...],[name.upper() for name in ...], ...
The feature has a one-sentence description that captures most of its activations. Monosemantic — it does one identifiable thing.
4.2 Auto-interpretation
For frontier-scale SAEs (millions of features), manual interpretation is infeasible. Instead, use an LLM (e.g., Claude) to read top-activating examples and propose a description (Bills et al., OpenAI, 2023). The LLM's description is then validated by predicting which novel inputs will activate the feature.
This is "auto-interp"; it's the only way to make SAE analysis tractable at frontier scale. Reliability is imperfect (the LLM sometimes misses subtleties or over-generalises), but good enough to triage millions of features into broad categories.
4.3 Causal validation
A feature's interpretation must match its causal role. A feature labelled "code-related" should, if activated artificially, push the model towards code-like outputs. This is the bridge to activation steering (Cap 11.7).
If the interpretation and the causal effect disagree, the interpretation is wrong (or incomplete). This is the strongest validation tool for SAE features.
5. The Anthropic scaling story
Bricken et al. (2023) trained SAEs on a -layer Transformer; identified thousands of interpretable features. The natural question: does this work at scale?
Templeton et al. (2024, Anthropic, Scaling Monosemanticity) answered yes. They trained SAEs on the residual stream of Claude 3 Sonnet — a frontier model. Headlines:
- M features at , scaling to M features at .
- Features for: famous people (Steve Jobs, Beyoncé), countries (USA, Japan), concepts (deception, persuasion, internal conflict), syntactic patterns (function arguments, dialogue), languages, file types, and many more.
- The famous "Golden Gate Bridge" feature: a single direction that activates whenever the Golden Gate Bridge is mentioned. Activated artificially, it makes the model write about the Golden Gate Bridge regardless of the prompt — leading to "Golden Gate Claude", a deliberately mis-steered model variant released as a demo.
The scale of feature discovery matched what the toy-model superposition theory predicted. The frontier model is also in superposition; SAEs also recover the features; the same techniques transfer.
5.1 Cross-layer transcoders
A 2024 extension: train SAE-like decoders that read activations at one layer and predict activations at a later layer, exposing the transformations a network performs on features (not just the features themselves). These "transcoders" expose pieces of circuits — how a feature in layer 8 gets transformed into a derived feature in layer 12.
This is the bridge from feature-extraction (one SAE per layer) to circuit identification (an end-to-end feature-flow story). The 2024–2026 frontier is integrating these.
6. What SAEs can and can't do
6.1 What they do well
- Recover thousands to millions of interpretable features from arbitrary trained models.
- Provide a causal handle (via activation steering) for many of those features.
- Identify behaviour-relevant features for safety analysis: which features mediate harmful behaviour, jailbreak resistance, deception detection, etc.
- Scale to frontier models (Claude 3 Sonnet, GPT-4-class models).
6.2 What they don't (yet) do
- Recover all features. SAEs miss features the network represents but the SAE's loss isn't sensitive to. Especially: features that are important for computation but rarely active have low L1 footprint and get under-represented.
- Identify circuits. A feature is a vertex; a circuit is a graph. SAEs find vertices; circuit-tracing tools layer on top.
- Provide complete coverage. Even at , frontier-model SAEs are estimated to recover – of the model's features. The long tail of rare, computation-specific features remains hidden.
- Generalise across distributions. An SAE trained on web text recovers different features than one trained on code. Multi-distribution SAEs are an active research area.
6.3 The cost
Training an SAE for a frontier model is not cheap. Templeton et al. (2024) describe SAE training runs that cost a substantial fraction of a model-pretraining run — on the order of – FLOPs. This is a real engineering investment, on the same order as a fine-tuning run.
By 2026, frontier labs treat SAE training as a standard step in the model-evaluation pipeline — every major model release includes an SAE analysis.
7. What we keep going forward
Three things.
- A sparse autoencoder is the right tool for superposition recovery. Encoder + decoder + L1 (or top-) sparsity, expansion factor . Trained on a model's activations, it recovers interpretable features as encoder rows / decoder columns.
- Scaling works. Bricken et al. (2023) on toy models → Templeton et al. (2024) on Claude 3 Sonnet. Frontier-scale models can be SAE-analysed; millions of interpretable features can be extracted.
- SAEs find features, not circuits. A feature is one direction; a circuit is a graph of feature-to-feature transformations. Cross-layer transcoders and circuit-tracing tools layer on top of SAEs to recover the flow of computation. Cap 11.7 next: with features identified, activation steering turns features into control knobs.
(a) Write the standard SAE architecture: encoder, decoder, loss. State the dimensions of , , and the relationship between and .
(b) Why is the expansion factor essential? Why is reconstruction-only training insufficient (i.e., why the L1 penalty)?
(c) State two practical problems in SAE training (dead features, sparsity-vs-reconstruction trade-off) and a mitigation for each.
(d) Top- SAEs: state the architectural change and one reason they have largely replaced L1 SAEs in 2024–2026.
(e) Auto-interpretation pipeline: state how an LLM is used to label SAE features. What's the validation step that checks the label is correct?
(f) Templeton et al. (2024) extracted features from Claude 3 Sonnet with . State the expansion factor and the implication for superposition severity in frontier models.
References
- [1]
Bricken, T., Templeton, A., Batson, J., et al. (2023). "Towards monosemanticity: Decomposing language models with dictionary learning". Transformer Circuits Thread. transformer-circuits.pub — SAEs for feature extraction (11.6).
↩ - [2]
Templeton, A., Conerly, T., Marcus, J., et al. (2024). "Scaling monosemanticity: Extracting interpretable features from Claude 3 Sonnet". Transformer Circuits Thread. transformer-circuits.pub — Frontier-scale SAEs; Golden Gate Claude (11.6, 11.7).
↩ - [3]
Gao, L., Dupré la Tour, T., Tillman, H., et al. (2024). "Scaling and evaluating sparse autoencoders". arXiv:2406.04093 — Top- SAEs (11.6).
↩ - [4]
Rajamanoharan, S., Conmy, A., Smith, L., et al. (2024). "Jumping ahead: Improving reconstruction fidelity with JumpReLU sparse autoencoders". arXiv:2407.14435 — JumpReLU SAEs (11.6).
↩