6.3.6 · D3Interpretability & Explainability

Worked examples — Mechanistic interpretability

3,628 words16 min readBack to topic

This page is the "run the machine on every kind of input" companion to Mechanistic interpretability. The parent note gave you the tools — activation patching, the circuits hypothesis, superposition, the logit lens. Here we use them on every case class that can come up, so you never meet a scenario you have not seen worked out.

Every symbol used here was defined in the parent note. If we re-introduce one, we re-earn it in plain words first.

The scenario matrix

Think of "mechanistic interpretability in practice" as a small number of distinct situations. Each row below is one case class — a genuinely different kind of question — and each is covered by at least one worked example.

# Case class What makes it different Covered by
A Patching recovers behaviour (positive effect) The patched component is the cause Example 1
B Patching does nothing (zero / degenerate effect) The component is irrelevant — the "null" case Example 2
C Ablation vs patching disagree Component matters but doesn't carry the information Example 3
D Superposition arithmetic (, sparsity + variance) When can you pack more features than dimensions? Example 4
E Interference / collision (worst case of D) Two features fire at once — the cost of superposition Example 5
F Logit lens across layers (limiting behaviour) How a prediction is "born" layer by layer Example 6
G Attention-pattern classification (which head?) Read a pattern matrix, name the head Example 7
H Real-world word problem End-to-end induction-circuit hunt Example 8
I Exam twist (a sign/normalisation trap) The factor and softmax scaling Example 9
Recall Why enumerate cases at all?

Because a component can be important-but-uninformative (case C), or a patch can look meaningful but be zero (case B). If you only ever practise the happy path (case A) you will mis-diagnose the other eight. Question: which two cases most often get confused? ::: Case A (patching recovers) and case C (ablation matters but patching fails) — both involve an "important" component, but only A carries the causal information.


Case A — Patching recovers behaviour

Forecast: guess — is 0.74 "most of the way back"? Roughly what fraction of the gap did we close?

  1. Define the gap. The behaviour we care about is the probability of the right token. The full drop caused by corruption is . Why this step? Recovery only makes sense relative to how much was lost; the gap is our denominator. (It is positive, so the formula is valid — see the mistake callout above.)
  2. Measure how much the patch restored. Restored amount . Why this step? We compare against the corrupted baseline, not zero — the patch's job is to climb back up from the corrupted floor.
  3. Recovered fraction. . Why this step? A normalised fraction (0–1) is comparable across tasks; a raw probability difference is not.
  4. Decide. recovery from a single head is a strong positive — this head causally mediates the completion. (Case A.)

Verify: sanity check the endpoints. If the patch had done nothing, and the fraction would be . If it had fully recovered, and the fraction would be . Our sits sensibly between them. ✓


Case B — The null case: patching does nothing

Forecast: what fraction do you expect when the number doesn't move at all?

  1. Gap unchanged: .
  2. Restored amount: . Why this step? This is the degenerate input to the recovery formula — the numerator is exactly zero (but the denominator is still the positive , so the formula stays valid).
  3. Fraction: . Why this step? Zero over a nonzero gap is a clean zero; there is no ambiguity, no division-by-zero.

Interpretation: this head is causally irrelevant to the completion. Do not confuse "we measured it" with "it matters" — the honest answer here is that the component carries none of the needed information. (Case B.)

Verify: the fraction is , matching the endpoint we derived in Example 1's Verify. The two examples share a denominator () and only the numerator changed, which is exactly what "isolate one component" should mean. ✓


Case C — Ablation and patching disagree

Forecast: if a head is important, must patching it recover the behaviour? Guess yes/no.

  1. Ablation score (from parent's formula ): . Large. Why this step? Ablation asks "does removing it hurt?" — here, strongly yes.
  2. Patching recovered fraction: . Small. Why this step? Patching asks "does its specific value carry the task information across inputs?" — here, barely.
  3. Reconcile. The head is doing generic work every input needs (so removing it hurts everything — high ablation), but it is not where the clean-vs-corrupt distinguishing information lives (so transplanting it recovers little — low patch). The answer to the forecast is no: importance ≠ information. (Case C.)

Verify: the two numbers are on different scales by design — is a raw performance drop, is a normalised recovery fraction. They should disagree; that disagreement is the diagnostic, exactly the "Why patching over ablation?" point in the parent note. ✓


Case D — Superposition arithmetic

Forecast: 1000 features into 100 dimensions sounds impossible. Is it — and even if the average is fine, could a rare crowded moment still overflow?

  1. Orthogonal budget. If features had to be orthogonal, we'd need one dimension each: — impossible. This is why we need superposition at all.
  2. Expected simultaneous features. From the parent's derivation, the number active at once is . Why this step? Superposition only fails when too many features fire together; the expected co-activation count is what competes for the directions.
  3. Feasibility test (average). Compare to : , so on average there is room. Headroom spare directions. Why this step? is exactly the packing condition; the margin tells us how comfortably it holds on average.
  4. The variance / worst-case burst. The count of active features is a sum of independent yes/no draws (a binomial), so its variance is , giving a spread (standard deviation) . Why this step? The average being safe is not enough — a rare crowded input could still overflow the dimensions, causing extra interference. We need to know how wide the fluctuations are.
  5. How risky is an overflow? Overflow () means being standard deviations above the mean. That is astronomically unlikely. Why this step? Expressing the danger threshold in standard deviations tells us whether the headroom is comfortable (, safe) or fragile (, risky). Here means bursts essentially never overflow.

Interpretation: yes — we can pack more features than dimensions, and not just on average: even the crowded tail of inputs stays under budget because sits over standard deviations above the mean load. Shrink toward , and this margin collapses — that is the true edge of feasibility. (Case D.)

Verify: units are consistent — (count) (dimensionless probability) count ; variance is also a count, so is a count . And the sanity limit: if then and packing fails immediately, matching intuition. ✓


Case E — Interference (the cost of D)

What to look at in the figure below: the two black solid arrows are the stored feature directions (along the horizontal axis) and (tilted up). The black dashed arrow is their sum — the thing actually sitting in activation space when both fire. The red arrow is the readout: the shadow the stored sum casts onto 's direction. Notice the red arrow overshoots 's tip — that overshoot is the leaked interference from .

Figure — Mechanistic interpretability

Forecast: if the vectors were apart there'd be zero interference. At , more or less than the signal itself?

  1. Set up the stored vector. stored . Why this step? Superposition stores a sum of active feature directions (parent's ) — this is the black dashed arrow.
  2. Read out feature 1 with the ideal reader (unit): readout . Why this step? The dot product is the natural "how much of this direction is present?" measure — it is the length of the red projection arrow. Splitting the sum lets us see the true signal and the leak as separate terms.
  3. Evaluate. (unit vector, the true signal). (the leaked interference). Why this step? The dot product of two unit vectors is the cosine of their angle — this is the exact reason non-orthogonality causes leakage, and why the red arrow is longer than .
  4. Report. Signal , interference . The readout is : the true plus half of feature 2 bleeding in. Why this step? Separating the number into "what we wanted" () and "what leaked" () is the whole point — it quantifies the tax, so a downstream layer (or an SAE) knows how much noise to expect.

Interpretation: interference () is smaller than the signal () but not negligible — this is the tax superposition pays. Sparsity (case D) keeps such collisions rare. (Case E.)

Verify: if the angle were , and interference vanishes (orthogonal = no cost). If , and the features are indistinguishable — maximal collision. Our gives the intermediate . ✓


Case F — Logit lens across layers (limiting behaviour)

Two symbols from the parent note appear here; we re-earn them in plain words before using them:

Forecast: does the correct answer appear suddenly at the last layer, or grow gradually?

  1. Layer 0: Why this step? Two-outcome softmax collapses to the logistic sigmoid — the cleanest way to turn one relative logit into a probability.
  2. Layer 2: . The model is undecided. Why this step? A logit of means the target and competitor are tied; the sigmoid must return exactly , which is our anchor point for reading the trajectory — anything above it means "leaning correct".
  3. Layer 4: Why this step? We reuse the same sigmoid because the readout mechanism () is identical at every layer — only the residual-stream vector , hence the logit, has changed. Comparing layers is therefore an apples-to-apples read of accumulated evidence.
  4. Layer 6 (final): Why this step? This is the model's actual output layer, so is the real prediction; computing it lets us see how far the earlier layers were from the finished answer.

Trajectory / limiting behaviour: — the correct token is built up gradually across the residual stream, exactly the parent's picture: each layer adds a little more evidence. In the limit , ; as , . (Case F.)

Verify: monotonic increase ✓ (each layer's probability exceeds the previous). exactly ✓. And : e.g. , which pins layer 0. ✓


Case G — Classify the attention head

What to look at in the figure below: each grid is one pattern matrix. Rows are query positions (the token doing the looking), columns are key positions (the token being looked at); a red cell marks weight (all the attention), a white cell weight . In the left grid the red cells sit just below the diagonal — every token looks one step back. In the right grid the red cells jump two columns back to the matching letter — each A looks at the earlier A, each B at the earlier B. The shape of the red pattern is the head's fingerprint.

Figure — Mechanistic interpretability

Forecast: one of these is a "previous token head". Which one, and what is the other?

  1. Test for previous-token behaviour: parent's signature is . Check row 3: attends to position 2 (). Row 4: attends to position 3 (). ✓ (Rows 1–2 hit position 1 since there's nothing earlier.) So is a previous-token head — the sub-diagonal red band in the left grid. Why this step? Each interpretable head has a fingerprint in the pattern matrix; we match the red pattern against the parent's catalogue.
  2. Test for duplicate-token behaviour: signature is high weight where tokens match. Tokens are A B A B. Row 3 (token A at pos 3) attends to position 1 (the other A). Row 4 (token B at pos 4) attends to position 2 (the other B). ✓ So is a duplicate-token head — the "two-back to the matching letter" red pattern in the right grid. Why this step? The duplicate signature is what the figure's rightward-then-back red cells reveal; it is the ingredient an induction circuit uses.
  3. Conclusion: = previous-token head, = duplicate-token head. Together they are the two halves of an induction circuit. (Case G.)

Verify: every row sums to 1 — valid softmax output. For , the "attends to " pattern means the weight sits just below the diagonal (a sub-diagonal band), which is exactly what the figure shows. For , weights land on matching tokens two positions back — the hallmark the parent listed. ✓


Case H — Real-world word problem (end to end)

Forecast: which single head should recover more — the previous-token head or the induction head?

  1. Gap: . Why this step? This positive gap is the denominator for every recovery below; corruption genuinely broke the task (from down to ), so the experiment is valid.
  2. Induction head alone: . Why this step? The induction head is what copies the completion; expect it to carry most of the signal.
  3. Previous-token head alone: . Why this step? It only supplies the key the induction head reads; alone it can't finish the job.
  4. Both together: . Why this step? The circuit is the composition; patching both should approach full recovery.
  5. Ranking: induction head () > previous-token head (), and together — the two compose into the circuit the parent described. Forecast answer: the induction head recovers more.

Verify: partial recoveries need not add to the joint recovery (circuits are not linear): but the joint is — close, showing near-additivity with mild redundancy, which is physically sensible for a two-head circuit. All fractions lie in . ✓


Case I — Exam twist: the trap

Forecast: does forgetting the divide make the attention sharper or softer?

  1. Correct (scaled) logit: . Why this step? Parent note: the factor keeps logit variance regardless of , so softmax stays out of saturation.
  2. Scaled weight: — confident but not saturated.
  3. Unscaled logit: the student keeps . Weight . Why this step? Without the divide the logit is larger, pushing the softmax into full saturation.
  4. The trap: the unscaled softmax is a near-hard argmax (), giving vanishing gradients and brittle attention; the scaled one () is trainable. Same head, wrong by the missing . (Case I.)

Verify: the ratio of logits is exactly () ✓. Scaled matches Example 6's layer-6 value (same logit) ✓ — a nice cross-check that our sigmoid is consistent.

Recall

Recovered fraction formula
When is the recovered-fraction formula undefined?
when the gap (division by zero) — corruption did nothing, so the experiment is invalid
Superposition feasibility condition (average)
expected co-active features must be (dimensions)
Spread of the co-active count
standard deviation (binomial) — check bursts stay under
Interference between two unit feature directions at angle
Two-way softmax on one relative logit
the sigmoid
The scaled attention logit for

See also: Sparse Autoencoders (the modern tool for undoing superposition, Cases D–E), Attention Mechanisms and Transformer Architecture (Cases G, I), Probing Classifiers and Feature Visualization (reading what a direction means), Model Editing (acting on a located circuit), and the parent Mechanistic interpretability.