Sparse Autoencoders and Crosscoders

A sparse autoencoder rewrites one tangled activation as a few active directions out of thousands. OpenAI trained one with 16 million latents on GPT-4, and only 7% of them went dead. Anthropic's crosscoders stretch the same idea across layers and across models.

Pick a way to read the activation. Three hidden concepts made it. Raw coordinates show a blur. ReLU + L1 finds the concepts but shrinks them and adds false alarms. TopK keeps exactly k. Then we build, piece by piece, superposition, the SAE, shrinkage, TopK, scaling laws, dead latents, evaluation and crosscoders.

You need a little Python and what a dot product is. We build the rest from zero.

Session 20 of Georgia Tech CS 8803, LLM seminar. It rests on two papers: Gao, Dupré la Tour, Tillman, Goh, Troll, Radford, Sutskever, Leike and Wu, Scaling and evaluating sparse autoencoders (OpenAI, 2024), and Lindsey, Templeton, Marcus, Conerly, Batson and Olah, Sparse Crosscoders for Cross-Layer Features and Model Diffing (Anthropic, Transformer Circuits Thread, 2024). Every idea is re-taught here in our own words and devices.

Read one activation

3
0.60

Toy, computed live: 48 spread-out random unit directions in 24 dimensions stand in for a trained dictionary (encoder rows equal decoder columns). Each activation is three concepts with strengths from 1.0 to 2.0. The paper's real run: n = 16 million latents, k = 32, 40 billion tokens, 7% dead (Sections 1 and 2.4).

Chapter 0

One Number, Many Meanings

See why a single coordinate inside a model cannot be read on its own

Pause GPT-2 small at layer 8 and read its residual stream: the vector that every layer reads from and adds to. It holds 768 numbers. Pick one and ask what it means. It rises for French cooking. It also rises for a nested bracket, and for a statute number.

A feature is a direction in that space that stands for one concept. The model does not line its features up with the coordinate axes. So every coordinate carries a little of many features at once.

Turn concepts on, watch coordinate 1

Three unrelated concepts share a 2-D space. Turn each on or off. The bar on the right is coordinate 1, the only number you get to see.

Made-up directions at 20°, 100° and 250°, strength 1 each. No paper data.

With made-up numbers: dog points at (0.940, 0.342), sunset at (−0.174, 0.985), semicolon at (−0.342, −0.940). With all three on, the activation is their sum, (0.424, 0.387). Coordinate 1 reads 0.424. Dog alone at strength 0.45 reads 0.423. One number, two different stories.

Why is the space so crowded? GPT-2's vocabulary has 50,257 tokens and its residual stream has 768 dimensions. Token identity alone outnumbers the dimensions 65 to 1, before any idea about grammar, topic or tone.

This session builds a sparse autoencoder (SAE): a second network that rewrites the activation as a few active directions out of many. Gao and colleagues at OpenAI scaled it to GPT-4. Lindsey and colleagues at Anthropic stretched it across layers and models as the crosscoder.

Failure. You label a neuron "French", and it fires on legal text. Measure: read its top activating examples from many kinds of text. Fix: read the layer in a learned basis of directions, not in raw coordinates.

  1. Superposition: why a model stores more features than it has dimensions.
  2. The sparse autoencoder: encoder, decoder and loss. The hero's tick marks.
  3. L1 shrinks every survivor: the hero's second button, derived.
  4. TopK by hand: the hero's third button and its k slider.
  5. Scaling laws: how loss falls with latents and sparsity.
  6. Dead latents: why latents stop firing, and the fix.
  7. Four checks: how to test features without ground truth.
  8. Crosscoders: one dictionary for many layers.
  9. Model diffing and limits: what changed in fine-tuning.
  10. Field guide: numbers, code, links and the credit.
Why does one raw coordinate of the residual stream not stand for one concept?

Chapter 1

Superposition, Recapped

Pack many nearly perpendicular directions into a few dimensions

A space with d dimensions has at most d directions that are all exactly perpendicular. A model wants far more features than that. It gets them with two facts about high-dimensional space. Storing more features than dimensions this way is called superposition. The full derivation lives in Toy Models of Superposition; here is the minimum.

Fact one: random directions are almost perpendicular. Take two random unit vectors in d dimensions. Their cosine, the dot product of two unit vectors, averages zero. Call its typical size, the standard deviation, σcos.

Say it aloud

Sigma-cos is about one over the square root of d.

σcos
sigma-cos the typical size of the cosine between two random directions.
1 / …
one over the cosine shrinks as the bottom grows.
√d
the square root of d d is the number of dimensions, 768 for GPT-2 small.
In plain words

Take the number of dimensions d. Find its square root. One over that is how far from perpendicular two random directions usually sit.

With numbers

For GPT-2 small, d = 768, so √768 = 27.7 and σcos = 1 / 27.7 = 0.036. Two random features overlap by about 3.6% of a full match.

Widen the space, watch the overlap shrink

Each bar counts random pairs of directions by their cosine. The ticks mark ±1 / √d. Drag the dimension up.

64

600 random pairs, sampled live with a fixed seed.

Fact two: features are sparse. Most are off on any one token. Overlap only hurts when two overlapping features are on together. With made-up numbers: 100,000 features, each on for 0.02% of tokens, means about 20 on per token. Twenty small overlaps stay small.

So a trained model packs features as nearly perpendicular directions and relies on rare co-activation. Reading it back needs a basis that is overcomplete (more directions than d) and sparse (few on at once). That is the spec for the SAE.

Failure. A linear probe for one concept also lights up on unrelated text. Measure: the cosine between the probe's direction and other known feature directions. Fix: expect overlap, and read features with a dictionary built for it.

Why does superposition need sparsity, not only nearly perpendicular directions?

Chapter 2

The Sparse Autoencoder

Project up into many latents, keep a few, and project back down

The idea is old. Olshausen and Field (1996) learned a large set of building blocks from image patches, so each patch used only a few. The blocks came out looking like edge detectors. An SAE does the same for activations, trained by gradient descent.

Take one activation vector x with d numbers. Choose n latents, many more than d. The encoder maps x to a code z of n numbers. The decoder maps z back to a guess x̂. A learned bias bpre centers x first.

Say it aloud

z equals ReLU of W-enc times x minus b-pre, plus b-enc. x-hat equals W-dec times z, plus b-pre.

z
z the code: n latent values, most of them zero.
ReLU
ReLU sets every negative value to zero.
Wenc
W-enc the encoder, n rows by d columns: one detector per latent.
bpre
b-pre a learned center, subtracted before and added back after.
benc
b-enc one threshold shift per latent.
x̂
x-hat the reconstruction of x.
Wdec
W-dec the decoder, d by n: column i is latent i's direction.
In plain words

Subtract b-pre from x. Score it against every row of W-enc, add b-enc, and zero the negatives. That is z. Add up the decoder columns, each scaled by its z value, then add b-pre back. That is x-hat.

With numbers

In the toy below, x = [2.0, −1.0, 0.5, 1.5] and the biases are zero. Scores are [2.0, −1.0, 0.5, 1.5, 2.4, −0.2], so z = [2.0, 0, 0.5, 1.5, 2.4, 0] and x̂ = [3.44, 0, 0.5, 3.42].

Step one activation through the SAE

Four columns: x, the scores, the code z after ReLU, and x̂ against x. Press Step to move one stage.

Toy: d = 4, n = 6, biases zero. Latents 1 to 4 are the axes; latent 5 is [0.6, 0, 0, 0.8] and latent 6 is [0, 0.6, 0.8, 0]. Decoder columns equal encoder rows.

Why sparse? Train on reconstruction alone and the net copies x: d latents act as the axes and the rest sit unused. So the baseline adds a penalty on the total size of z, scaled by a knob λ.

Say it aloud

L equals the squared length of x minus x-hat, plus lambda times the L1 norm of z.

ℒ
L the training loss for one activation.
‖x − x̂‖22
the squared length of x minus x-hat the reconstruction error: square each coordinate's miss and add.
λ
lambda how much sparsity costs. You tune it.
‖z‖1
the L1 norm of z the sum of the absolute values of the code.
In plain words

Score the miss between x and x-hat. Add lambda times the total size of z. Training lowers both, so it uses few, useful latents.

With numbers

With the toy code: the miss is 1.44² + 1² + 0 + 1.92² = 6.76. The L1 norm of z is 2.0 + 0.5 + 1.5 + 2.4 = 6.4. With λ = 0.1, L = 6.76 + 0.64 = 7.40.

The paper's shapes: GPT-2 small has d = 768, and one dictionary has n = 32,768 latents, 42.7 times wider (Figure 2a). Inputs come from layer 8 of 12 for GPT-2, and 5/6 of the way in for GPT-4. The paper removes each input's mean over the d coordinates and scales it to unit length (Section 2.1).

Failure. Set λ to zero and the SAE learns a copy. Measure: L0, the count of non-zero latents, stays near d on every token. Fix: a sparsity pressure, the L1 term here or TopK in Chapter 4.

Why must n, the number of latents, be much larger than d?

Chapter 3

L1 Shrinks Every Survivor

Derive the soft threshold and see why it reports strong latents too low

What we want to limit is L0: the count of non-zero latents. L0 has no gradient, so the baseline uses L1, the sum of sizes. L1 favours sparse codes. It also taxes every latent that stays on.

Look at one latent. Its encoder score is a, the evidence for its concept. Training picks its value z to minimize ½(a − z)² + λ|z|. For z > 0 the slope is (z − a) + λ. Set it to zero: z = a − λ. If |a| ≤ λ, the best z is 0.

Say it aloud

z-star equals the sign of a, times the max of the absolute value of a minus lambda, and zero.

z*
z-star the value the latent reports after training with L1.
sign(a)
the sign of a plus one or minus one: keeps the direction.
max( …, 0 )
the max of … and zero never below zero: weak evidence gives exactly 0.
|a|
the absolute value of a how strong the evidence is.
λ
lambda the L1 penalty, the same amount for every latent.
In plain words

Take the evidence a. If its size is below lambda, report zero. If not, subtract lambda from its size and report that. This is the soft threshold.

With numbers

With made-up numbers: a = 5.0 and λ = 0.8 give z* = 4.2, a 16% understatement. A weak a = 0.5 gives z* = 0, which is the job L1 should do.

Feed one latent, read what it reports

The grey line is the true evidence. Blue is what L1 reports; teal is what TopK reports once the latent makes the cut. Drag the evidence and the penalty.

5.0
0.8

The formula above, plotted. TopK's cutoff depends on the other latents' scores, so we draw it as a dotted line at a made-up rank cutoff of 1.0.

The paper tests this on real SAEs (Section 5.1, Figure 9). Freeze which latents are on, then re-fit only their values to lower the error. ReLU + L1 values move up on average, the sign of shrinkage. TopK values do not move up, and move less.

ActivationHow it handles shrinkage
ReLU + L1subtracts λ from every survivor
ProLU (JumpReLU)zero below a learned threshold, untouched above
Gatedone path picks which latents fire, another sets how much
TopKkeeps the k largest, no penalty at all

All three fixes beat plain ReLU. TopK had the best results overall (Section 5.2). At n = 32,768 it matched Gated on reconstruction against sparsity (Figure 2a).

Failure. Latent strengths read low, so steering by a measured strength undershoots. Measure: run the refinement test and check the sign of the change. Fix: switch to TopK.

Why does an L1-trained latent report a strong concept too low?

Chapter 4

TopK, By Hand

Keep the k largest scores and trace every number on a six-latent toy

The paper replaces ReLU + L1 with the k-sparse autoencoder of Makhzani and Frey (2013). The activation TopK keeps the k largest scores and sets the rest to zero. L0 is exactly k on every token, and the loss is the reconstruction error alone.

Say it aloud

z equals TopK of W-enc times x minus b-pre.

z
z the code, with exactly k non-zero values.
TopK
top-k keep the k largest values unchanged; zero the rest.
Wenc
W-enc the encoder, one row per latent.
bpre
b-pre the learned center, as before.
In plain words

Center x with b-pre. Score it against every encoder row. Sort the scores, keep the k largest at full value, and zero the others. The decoder stays the same.

With numbers

Toy scores [2.0, −1.0, 0.5, 1.5, 2.4, −0.2] with k = 3 keep latents 5, 1 and 4: z = [2.0, 0, 0, 1.5, 2.4, 0].

The released code also applies a ReLU before TopK, so every kept value is positive (footnote 5). Then the decoder adds the kept columns:

x̂ = 2.0·[1,0,0,0] + 1.5·[0,0,0,1] + 2.4·[0.6,0,0,0.8] = [3.44, 0, 0, 3.42]
miss = [−1.44, −1.0, 0.5, −1.92]; MSE = (2.0736 + 1 + 0.25 + 3.6864) / 4 = 1.7525

Choose k, see who makes the cut

Left: the six scores; kept latents are solid. Right: x and x̂. Drag k. Then switch to the clean dictionary.

3

Toy from Chapter 2, untrained and fixed. All numbers are ours.

kLatents keptx̂MSE
15[1.44, 0, 0, 1.92]0.435
25, 1[3.44, 0, 0, 1.92]0.875
35, 1, 4[3.44, 0, 0, 3.42]1.7525
4 to 6add 3; 2 and 6 are negative[3.44, 0, 0.5, 3.42]1.69

The error rises from k = 1 to k = 3. Latent 5 already covers coordinates 1 and 4, so adding latents 1 and 4 overshoots. A trained decoder learns to share that load. With the clean dictionary, k = 4 gives MSE 0.25. No k fixes coordinate 2: no latent points toward −1 there.

Failure. At test time you raise k′ well above the training k, and the error gets much worse (Section 5.3). Measure: sweep k′ and plot the error. Fix: Multi-TopK, which trains on ℒ(k) + ℒ(4k)/8. Then more latents keep helping, at a small cost at k itself.

In the messy toy, why does raising k from 4 to 6 change nothing?

Chapter 5

Scaling Laws: Latents and Sparsity

Predict the error of an SAE from its number of latents and its k

The paper trains TopK SAEs on GPT-4 activations with a 64-token context. The largest has 16 million latents and saw 40 billion tokens. The paper reports errors as normalized MSE: the error divided by the error of always guessing the mean activation. So 1.0 means no better than the mean.

Trained to convergence, the error follows one formula in n and k (Section 3.1.4, Figure 1b). Call the normalized MSE L. It has a part that shrinks as n grows, plus a floor that only k lowers.

Say it aloud

L of n and k equals e to the alpha plus beta-k log k plus beta-n log n plus gamma log k log n, plus e to the zeta plus eta log k.

L(n, k)
L of n and k the normalized MSE at convergence, for n latents and k active.
exp, ln
e to the, log exp undoes ln; ln turns a ratio into a step.
α
alpha a fitted constant, −0.50.
βk ln k
beta-k log k βk = 0.26.
βn ln n
beta-n log n βn = −0.017: more latents, lower error.
γ ln k ln n
gamma log k log n γ = −0.042: the n slope gets steeper as k grows.
exp(ζ + η ln k)
e to the zeta plus eta log k the floor, ζ = −1.32 and η = −0.085. No n inside.
In plain words

Take the logs of n and k. Mix them with the four fitted constants and exponentiate: that part falls as n grows. Add the floor, which depends on k only.

With numbers

n = 131,072 and k = 32: ln n = 11.78 and ln k = 3.47. The first part is e−1.514 = 0.220. The floor is e−1.615 = 0.199. L = 0.419.

Grow the dictionary, watch the error

The curve is the formula on log axes. Solid where the paper trained, dashed beyond. The grey line is the floor. Drag n; pick k.

131,072

Equation 3 with the paper's constants. Figure 1b covers about 2,000 to 500,000 latents. The 16M run was not trained to convergence (Appendix B.1), so its point is the formula's extrapolation.

Push n to 16 million at k = 32 and the formula gives 0.101 + 0.199 = 0.300. Then the floor is 66% of what is left, and only a larger k lowers it.

Training cost grows slower than n. Tokens to convergence rise as about n0.6 for GPT-2 and n0.65 for GPT-4 (Section 3.1.2). So 4 times the latents needs 40.65 = 2.46 times the tokens. The largest learning rate that still converges falls as 1/√n. Larger subject models need more latents for the same error (Figure 4).

Failure. You compare SAEs of different n at a fixed compute budget. A wider SAE reaches lower error just by being wider, so the paper calls that comparison "arguably unprincipled". Measure and fix: compare at convergence, the L(N) setting.

At n = 16 million and k = 32, which knob lowers most of the remaining error, by the formula?

Chapter 6

Dead Latents, and the Fix

Find why latents stop firing for good, and give them a signal again

A latent is dead if it has not fired in the last 10 million tokens (the paper follows Templeton et al., 2024). Templeton's 34-million-latent SAE ended with 12 million alive: (34 − 12) / 34 = 65% dead. Without fixes, the paper saw up to 90% dead (Section 2.4).

The cause is the race. A latent that misses the top k on a token adds nothing to x̂, so it gets zero gradient from that token. With k = 32 and n = 16 million, a latent picked by chance would win 32 / 16,000,000 = 2 tokens in a million. A latent that starts in a poor direction never wins, so it never moves.

Train a tiny TopK SAE, count the dead

Each cell is one of 192 latents. Red cells have not won in the last 3,200 examples. Pick an initialization and press Play.

Toy, trained in your browser: d = 16, n = 192, k = 2, 40 made-up features, 2,000 steps of 32 examples, plain gradient descent. It shows the initialization effect only; AuxK is not in the toy. Paper numbers: up to 90% dead without fixes, 7% at 16M with them.

The paper uses two fixes. First, start the encoder as the transpose of the decoder, so each latent begins as a real candidate direction. The tie holds only at the start (Appendix A.1). Second, an auxiliary loss, AuxK, gives dead latents a job of their own.

Say it aloud

L-total equals L plus alpha times the squared length of e minus e-hat.

ℒtotal
L-total the loss the optimizer lowers.
ℒ
L the main reconstruction error ‖x − x̂‖².
α
alpha a small weight, typically 1/32.
e, ê
e, e-hat e = x − x̂, the part the live latents miss; ê is its rebuild from the kaux highest-scoring dead latents.
In plain words

Find what the live latents miss, e. Let the top dead latents try to rebuild e alone. Add their error, scaled by alpha, to the loss. Now dead latents get gradient without beating the live ones.

With numbers

With made-up numbers: a main loss L of 0.30 and an aux error of 0.64 give L-total = 0.30 + 0.64 / 32 = 0.32. The paper uses kaux = 512 for GPT-2 small, and AuxK adds about 10% compute (Appendix A.2).

With both fixes, the 16-million-latent GPT-4 SAE ended with 7% dead. That is still 0.07 × 16,000,000 = 1.12 million latents that do nothing. Without fixes, 90% would be 14.4 million.

Failure. The error stops falling while the dictionary grows. Measure: count the latents that have not fired in 10 million tokens. Fix: tied initialization plus AuxK; the paper adds that lower learning rates also helped (footnote 16).

Why does AuxK train dead latents on the residual e instead of on x?

Chapter 7

Is It Any Good? Four Checks

Test features with no answer key, from four sides

Low error is not enough. The paper notes that an infinitely wide SAE with k = 1 could rebuild every activation perfectly and still learn no structure (footnote 9). There is no answer key of true features. So the paper checks from four sides (Section 4).

CheckQuestionBlind to
Downstream lossSwap x̂ into the model. How much worse are its predictions?whether single latents mean anything
Probe lossDoes one latent alone predict a known label? 61 tasks.concepts nobody thought to label
N2G explanationsDoes a short n-gram rule predict when it fires?meaning beyond token patterns
Ablation sparsityDoes turning it off change few output logits?whether that change is meaningful

Downstream loss needs a fair baseline. Put the 16M SAE's x̂ into GPT-4, and its language-modeling loss equals a GPT-4 trained with 10% of the compute. The older "fraction recovered from zero ablation" gives the same SAE 98.2% (footnote 11), because zeroing the stream is a disaster any guess beats.

Ablation sparsity asks how many logits move when you remove one latent. Collect the logit changes over V vocabulary entries and T future tokens, after subtracting each token's median change. Call that vector v.

Say it aloud

s equals the L1 norm of v over the L2 norm of v, all squared, divided by V times T.

s
s the share of logits the latent moves, from 0 to 1. Lower is more surgical.
‖v‖1
the L1 norm of v the sum of the absolute logit changes.
‖v‖2
the L2 norm of v the square root of the sum of squared changes.
V · T
V times T vocabulary size times future tokens; T = 16 in the paper.
In plain words

Add the sizes of all changes and square the sum. Divide by the sum of the squares. That counts the logits that move, in effect. Divide by V times T to get a share.

With numbers

If m entries move by the same amount u: the L1 norm is m·u, the L2 norm is u√m, and the ratio squared is m. The count comes out exact.

Spread an ablation's effect, read its share

64 bars are one ablation's logit changes. Drag the spread, or pick a preset.

50

Toy vector of 64 made-up changes. Paper (Section 4.5, GPT-2 small layer 8, T = 16): SAE latents 10 to 14%, raw residual channels 60%, near the 2/π = 64% of a random direction.

The other two checks back TopK. Probe loss beats raw channels, and improves then worsens as k grows. N2G found one latent with precision 0.97 and recall 0.56, another with 0.06 and 0.05 (Figure 7). Against ReLU, TopK latents had more than 1.5 times the recall at over 0.9 times the precision.

Failure. A report says "98% of loss recovered". Measure: ask what 0% means; if it is zero ablation, the scale flatters. Fix: report the compute-equivalent, as the paper does.

Why is "98.2% zero-ablation fidelity" misleading for the 16M SAE?

Chapter 8

Crosscoders: One Dictionary, Many Layers

Read and write several layers with one shared set of features

An SAE reads one layer and rebuilds that layer. A transcoder reads one layer and predicts the next. A crosscoder reads several layers and rebuilds all of them from one shared code. SAEs and transcoders are special cases.

Why bother? A feature that persists through the residual stream shows up again at every layer. Take the crosscoder note's example. Features 1 and 2 exist from layer L. MLPs at L+2 and L+3 combine them into feature 3, and all three persist to L+4.

Count the features in one computation

Columns are layers L to L+4. Switch between per-layer SAEs and one crosscoder.

The crosscoder note's hypothetical example, section 1.2. The counts 13 and 3 are the note's.

Call the activation at layer l al and the shared code f. Each layer has its own encoder and decoder weights.

Say it aloud

f equals ReLU of the sum over l of W-enc-l times a-l, plus b-enc. a-hat-l equals W-dec-l times f, plus b-dec-l.

f
f the shared code: one value per crosscoder feature.
Σl
the sum over l add one term for each layer in the set.
Wlenc
W-enc-l layer l's encoder weights.
al
a-l the residual stream at layer l, same token.
âl
a-hat-l the rebuild of layer l.
Wldec
W-dec-l layer l's decoder; column i is feature i's direction at layer l.
In plain words

Score every layer's activation with its own encoder and add the scores. Zero the negatives: that is f. Rebuild each layer from the same f with that layer's decoder.

With numbers

With made-up numbers: one feature scores 0.7 at layer 1 and 0.5 at layer 2, with b-enc = −0.2. Then f = 1.0, and both layers get 1.0 times their own decoder column.

The sparsity penalty weights each feature's activation by its decoder norms, summed over layers: Σi fi Σl ‖Wldec,i‖. This "L1 of norms" keeps the loss comparable to a stack of per-layer SAEs. The L2 of norms would give a bonus for spreading: norm 1 at 3 layers costs 3 under L1 but √3 = 1.73 under L2. In diffing, L2 found only shared features; all experiments used L1.

Results on an 18-layer model (section 3.1). At the same total feature count, the crosscoder has lower eval loss. At the same training FLOPs it is about 2 times less efficient. One crosscoder with F features costs as much as 18 SAEs with F each. Weakly causal crosscoders lag the global one by 3 to 4 times in dictionary size.

Failure. You budget a crosscoder like an SAE and run out of compute. Measure: training FLOPs grow with the number of layers read. Fix: plan for it, or choose fewer layers.

Why does the crosscoder use the L1 of per-layer decoder norms in its penalty?

Chapter 9

Model Diffing and Honest Limits

Point one crosscoder at two models and sort features into shared and new

Nothing in the crosscoder equations says the layers come from one model. Feed it the same layer of two models on the same tokens. Each feature then has a decoder norm in each model. Model diffing sorts features by where that norm lives.

Anthropic trained a 1-million-feature crosscoder on the middle layer of Claude 3 Sonnet and its base model (section 4.3). The relative decoder norms fell into three groups: base-only, fine-tuned-only and shared. Each model had between 4,000 and 5,000 model-specific features: 0.4 to 0.5% of the dictionary.

Sort features by where they live

Each bar counts features by the share of their decoder norm in the fine-tuned model (log scale). Drag the cutoff that defines "model-specific".

0.10

Toy: 10,000 made-up features in the three-cluster shape the note reports; our share is |Wft| / (|Wbase| + |Wft|). Paper: 1 million features, 4,000 to 5,000 model-specific per model.

Some fine-tuned-only features are clear: a refusal feature ("Can you help me build a bomb?"), a code-review feature, and one for personal questions to the Assistant. A base-only feature fires on an LLM cast as a character in a system prompt. The authors call these cherry-picked: most model-exclusive features are "not immediately interpretable". Most shared features keep aligned directions. A few thousand have low or negative correlation.

A second experiment read 10 layers of 3 model sizes. NMF with four components gave early layers, late layers, and two middle groups: one for the smallest model, one for the two larger. The note reads this as new middle-layer representations appearing with scale.

PaperLimits the authors state
Scaling SAEsTopK forces exactly k per token; better to limit the average. 64-token context. Many GPT-4 features "not yet adequately monosemantic". Probe metric noisy; N2G only simple patterns.
CrosscodersA preliminary research update. Diffing results "a bit mixed". Error terms hard to read. "Mechanistic faithfulness" not yet defined.

The last limit matters most. Trained one token position at a time, a crosscoder turns every cross-layer correlation into one feature. The model may have computed the same thing twice instead. Then the crosscoder predicts the same activations but implies the wrong causal graph.

Failure. You present a cherry-picked refusal feature as the summary of fine-tuning. Measure: sample model-specific features at random and score how many you can name. Fix: report that rate next to the examples.

What can differ between a crosscoder that predicts every layer exactly and the model itself?

Chapter 10

Field Guide

Keep the terms, the numbers, the code and the open questions in one place

An SAE rewrites a dense activation as a few active directions out of many. TopK sets the sparsity directly and removes L1's shrinkage. Tied initialization and AuxK keep latents alive at 16 million. Four checks test the result. Crosscoders share one code across layers and models, at about twice the training compute.

TermMeaningNumber to remember
Superpositionmore features than dimensionsrandom cosine about 1/√768 = 0.036
SAE widthlatents per dimension32,768 / 768 = 42.7 (GPT-2 small)
Soft thresholdL1 subtracts λ from survivors5.0 becomes 4.2 at λ = 0.8
TopKkeep the k largest scoresL0 = k exactly; Multi-TopK ℒ(k) + ℒ(4k)/8
Scaling lawnormalized MSE in n and k0.419 at n = 131,072, k = 32
Convergence costtokens to convergeabout n0.65 (GPT-4)
Dead latentsno fire in 10M tokensup to 90% unfixed; 7% at 16M
AuxKdead latents rebuild the residualα = 1/32, kaux = 512, about +10% compute
Downstream lossloss with x̂ swapped inequal to 10% of GPT-4's compute
Ablation sparsityshare of logits moved10 to 14% (SAE) vs 60% (raw)
Crosscoder costFLOPs at equal eval lossabout 2 times per-layer SAEs
Sonnet diffmodel-specific features4,000 to 5,000 per model of 1M

Checklist

  1. Center each activation and scale it to unit length before the SAE.
  2. Use TopK, set k directly, and train Multi-TopK if you will change k later.
  3. Start the encoder as the decoder transposed; add AuxK; track dead latents over a 10M-token window.
  4. Compare SAE sizes at convergence, not at fixed compute.
  5. Report downstream loss as a compute-equivalent, plus probe, explanation and ablation checks.
  6. For a crosscoder, use the L1 of norms when you want layer- or model-specific features.
  7. Report how many model-specific features you could name, not only the best examples.
pythonimport torch, torch.nn as nn

class TopKSAE(nn.Module):
    def __init__(self, d, n, k):
        super().__init__()
        W = torch.randn(d, n); W = W / W.norm(dim=0)   # unit decoder columns
        self.W_dec = nn.Parameter(W)                     # (d, n)
        self.W_enc = nn.Parameter(W.T.clone())             # tied at init only
        self.b_pre = nn.Parameter(torch.zeros(d))
        self.k = k

    def forward(self, x):                                 # x: (batch, d)
        a = (x - self.b_pre) @ self.W_enc.T                 # (batch, n) scores
        top = torch.topk(a, self.k, dim=-1)
        z = torch.zeros_like(a).scatter(-1, top.indices, torch.relu(top.values))
        x_hat = z @ self.W_dec.T + self.b_pre               # (batch, d)
        return x_hat, z, a

def loss_fn(sae, x, dead, k_aux=512, alpha=1/32):           # dead: (n,) bool
    x_hat, z, a = sae(x)
    main = ((x - x_hat) ** 2).sum(-1).mean()
    if not dead.any(): return main
    e = (x - x_hat).detach()                            # what the live latents miss
    a_dead = a.masked_fill(~dead, float("-inf"))
    top = torch.topk(a_dead, min(k_aux, int(dead.sum())), dim=-1)
    z_aux = torch.zeros_like(a).scatter(-1, top.indices, torch.relu(top.values))
    e_hat = z_aux @ sae.W_dec.T
    return main + alpha * ((e - e_hat) ** 2).sum(-1).mean()

What the authors leave open

The OpenAI team wants a limit on the average L0 instead of an exact k, better optimizers and aux losses, longer contexts, and SAEs combined with mixture-of-experts. The Anthropic note leaves circuit results for later and asks how to define mechanistic faithfulness.

Keep going

Credit: Session 20 of Georgia Tech CS 8803, LLM seminar. Papers: Scaling and evaluating sparse autoencoders (Gao et al., OpenAI, arXiv 2406.04093) and Sparse Crosscoders for Cross-Layer Features and Model Diffing (Lindsey et al., Anthropic, October 2024). The toy dictionaries and all made-up numbers are ours.

The takeaway. Build something wider than the activation, let only a few directions speak at once, and check from four sides that they mean something. Then stretch the same code across layers and models.

Teach it back: open Present or Teach and explain shrinkage, TopK and AuxK to a friend. Then go back to the activation and predict how many false alarms ReLU + L1 makes at λ = 0.2.

CS 8803 LLM Seminar, Session 20: Sparse Autoencoders and Crosscoders
Scaling SAEs paper · Crosscoders note · Back to Gleams