mej7.comHow AI Works

What are sparse autoencoders (SAEs)?

Author: Mehdi Sadriu, independent educator. Last reviewed: 25 November 2026. How we check claims: methodology.

A sparse autoencoder is a small extra network trained on a model's activations so that each activation is rebuilt as a sum of a few dictionary directions. Sharkey, Braun & Millidge (2022) sketched the programme; Cunningham et al. (2023) and Bricken et al. (2023) showed interpretable features in language models; Templeton et al. (2024) and Gao et al. (2024) and Lieberum et al. (2024) scaled the same idea. An SAE is not the model, and a pretty feature is not yet a proof of use.

In one paragraph. SAE: train encoder f(x) and decoder so x̂ = W_dec f(x) (+ bias), with f sparse, to approximate activations x.

Toy SAE reconstruction x ≈ Σ f_i d_i, with most f_i = 0.
FeatureActivation fDictionary vector (3-dim)
1 'cat'0.9[1, 0, 0]
2 'Python'0.0[0, 1, 0]
3 'French'0.4[0, 0, 1]
4 unused0.0[0.5, 0.5, 0]

Reconstruction: 0.9·[1,0,0] + 0.4·[0,0,1] = [0.9, 0, 0.4]. Sparsity is why feature 2 and 4 stay off. A real SAE dictionary has thousands or millions of entries (Bricken et al., 2023; Templeton et al., 2024).

What is the plain-language idea?

The residual stream is a mixed juice. An SAE tries to list the ingredients and the amount of each, with most amounts zero. Those ingredients are candidate features you can name, plot, and later patch.

What do the papers actually claim?

Bricken et al. (2023) decompose a small transformer's activations and show many dictionary features that a human can interpret on a dashboard. Templeton et al. (2024) apply SAEs to Claude 3 Sonnet-scale residual streams and discuss safety-relevant features among millions of latents. Gao et al. (2024) emphasize metrics (reconstruction vs sparsity vs dead features). Lieberum et al. (2024) release an open SAE suite on Gemma 2. None of these papers claim the dictionary is the model's unique true ontology.

What can go wrong?

Imperfect reconstruction, feature splitting as the dictionary grows, dead latents, shrinkage from the sparsity penalty, and features that look clean on the dashboard but fail a patch. mej7.com does not train an SAE; Neuronpedia is one place to browse trained ones.

What is the math?

f = ReLU(W_enc (x − b_dec) + b_enc),   x̂ = W_dec f + b_dec

Loss ≈ ‖x − x̂‖² + λ ‖f‖₁ (or a different sparsity mechanism). Architectures vary: k-sparse, top-k, gated SAEs, and others appear in later work. Treat the formula above as the pedagogical default, not the only published SAE.

Worked example

Activation x ≈ [0.9, 0, 0.4]. Dictionary columns e1=[1,0,0], e3=[0,0,1]. Sparse codes 0.9 and 0.4 reconstruct x. If you then steer by adding e1 at that layer, you are testing whether the model uses a 'feature 1' direction — that test is not the training of the SAE.

Check your understanding

Five questions. Answers are in the disclosure under each item, so this page still works if JavaScript is off.

1. An SAE is trained on…
Show answer

B. Dictionary learning on activations.

2. Sparsity means…
Show answer

A. That is the point of the penalty.

3. A feature dashboard proves…
Show answer

B. Need patching or steering.

4. Feature splitting is…
Show answer

B. Dictionary size is a choice.

5. Does mej7.com run an SAE?
Show answer

B. Stated in the teaching-model disclaimer.

Further reading

  1. Taking Features Out of Superposition with Sparse Autoencoders (interim report) — Sharkey, Braun & Millidge (2022). Alignment Forum.
  2. Sparse Autoencoders Find Highly Interpretable Features in Language Models — Cunningham et al. (2023). arXiv.
  3. Towards Monosemanticity: Decomposing Language Models With Dictionary Learning — Bricken et al. (2023). Transformer Circuits (Anthropic).
  4. Scaling Monosemanticity: Extracting Interpretable Features from Claude 3 Sonnet — Templeton et al. (2024). Transformer Circuits (Anthropic).
  5. Scaling and Evaluating Sparse Autoencoders — Gao et al. (2024). arXiv / OpenAI.
  6. Gemma Scope: Open Sparse Autoencoders Everywhere All At Once on Gemma 2 — Lieberum et al. (2024). arXiv / Google DeepMind.