6.3.9 · D4Interpretability & Explainability

Exercises — Activation patching

2,172 words10 min readBack to topic

This page is a self-test. Each problem states cleanly what to do; the answer hides inside a collapsible [!recall]- box so you can try first. We climb five levels: L1 Recognition → L2 Application → L3 Analysis → L4 Synthesis → L5 Mastery. Everything here rests on the parent note — the protocol, the causal-fraction formula, and the two worked examples. If a symbol appears, we re-earn it in one line before use.

Figure — Activation patching

Before we start, one symbol the parent uses everywhere:


Level 1 — Recognition

Goal: name the pieces and read the sign of an effect.

L1.1

In one sentence, what does activation patching measure that attention weights alone cannot?

Recall Solution

It measures causation: whether forcing a component to carry clean information changes the output. Attention weights only show what a head looks at (correlation), not whether the model uses it.

L1.2

You run a patch and find , , . Is this component causally important? What is its causal fraction?

Recall Solution

Patched loss equals corrupt loss, so the patch changed nothing. The component is not causally important for this behaviour.

L1.3

For the parent's , what does a negative mean?

Recall Solution

Negative means — patching made things worse. Copying that clean activation hurt the corrupted run, e.g. the component's clean value clashes with the rest of the corrupted context.


Level 2 — Application

Goal: plug real numbers into the causal fraction.

L2.1

Reproduce the IOI number from the parent. Given , , , compute the causal fraction of head 9.6.

Recall Solution

The head explains ~90% of the corrupted error.

L2.2

A different head gives with the same corrupt () and clean (). What is its causal fraction, and is it more or less important than head 9.6?

Recall Solution

Only ~31% of the gap closed — much less important than head 9.6's 90%.

L2.3

Using the Greater-Than table, verify the "Layer 15 only" causal effect. The parent reports effect using mass on years > 12: corrupted mass , clean mass (all valid), Layer-15-patched mass . Confirm the number.

Recall Solution

Here the metric goes the other way — bigger mass is better — so the "fraction restored" uses mass directly: This restores ~0.69 of the missing greater-than mass. (The parent's table lists as a raw effect scale; our normalized fraction is the more interpretable form — both agree on "most of the behaviour returns".)


Level 3 — Analysis

Goal: reason about redundancy, synergy, and metric choice.

L3.1

Two heads and . Patched individually: , . Patched together: . Compute the synergy and interpret.

Recall Solution

Positive synergy → the heads collaborate: neither does much alone, but together they carry the behaviour. This is why single-head patching under-reports their importance.

L3.2

Now , , . Compute the synergy and interpret.

Recall Solution

Negative → redundancy: both heads compute the same thing, so patching one already recovers most of the effect and adding the second barely helps. Related to Ablation Studies, where removing one redundant unit shows little damage.

L3.3

You study toxicity. Patching layer 12 barely moves cross-entropy loss over all tokens, but the logit difference swings from to . Which metric should you trust and why? What is the swing?

Recall Solution

Swing logits — a large, decisive change. Trust the targeted logit difference. Cross-entropy averages over the whole vocabulary and drowns the one comparison you care about (toxic vs safe). The metric must measure the capability under study, not generic next-token accuracy.


Level 4 — Synthesis

Goal: combine hierarchy, path-specificity, and design a clean/corrupt pair.

L4.1 (Hierarchy)

From the Greater-Than table: Layer-15-only effect , Layer-20-only effect , both together . Compute the synergy of L15 and L20 and explain what it says about the computation's structure.

Recall Solution

Positive synergy confirms a hierarchical pipeline: L15 does the numerical "greater-than" reasoning, L20 formats the number into a token. Neither is sufficient alone — the reasoning must happen and be turned into output tokens. This is the causal chain Logit Lens visualizes layer-by-layer, and Causal Mediation Analysis formalizes as a mediator sequence.

Figure — Activation patching

L4.2 (Designing the pair)

You want to find which head resolves the subject in "The keys to the cabinet are on the table." (correct verb agreement = plural "are"). Write a matched clean/corrupt pair and the metric you'd use.

Recall Solution
  • Clean: "The keys to the cabinet ___" → correct answer "are" (plural, agrees with keys).
  • Corrupted: "The key to the cabinet ___" → correct answer "is" (singular). Only the subject number changed, everything else identical — this keeps the intervention surgical.
  • Metric: targeted logit difference .
  • Procedure: patch each head's activation from the plural-clean run into the singular-corrupt run; the head whose patch flips the logit difference toward "are" is carrying subject number. This is the Mechanistic Interpretability recipe of minimal-pair inputs.

L4.3 (Path patching)

Explain in one line why patching only the path from head into head (not head 's entire output) gives a sharper causal claim.

Recall Solution

The full-output patch changes what sends to every downstream component; the path patch changes only what reaches . So a non-zero path effect proves the mechanism specifically routes , ruling out " mattered through some other head."


Level 5 — Mastery

Goal: full quantitative story with edge cases and a fraction > 1 / < 0.

L5.1 (Over-restoration)

A patch yields , , . Compute the causal fraction. It exceeds 1 — is that a bug?

Recall Solution

Not a bug, but a flag: the patched run is more confident than the clean run itself. This can happen when the clean input is itself slightly hard; it means the component, given clean context, over-drives the correct answer. Report it honestly — it signals the corrupted context helped in some incidental way, or the metric is unstable.

L5.2 (Degenerate denominator)

Suppose . What happens to the causal fraction and what should you conclude?

Recall Solution

Denominator , so is undefined (division by zero). Conclusion: there is no behavioural gap to explain — the corruption didn't actually break the model, so patching is meaningless. Fix the experiment: find a corrupted input that genuinely lowers performance before measuring any component.

L5.3 (Full pipeline decomposition)

Three layers patched individually give effects , , ; all three together give . (a) What is the total synergy? (b) If you had to name the pipeline as "distributed" or "single-layer," which, and why?

Recall Solution

(a) (b) Distributed. No single layer reaches even half the joint effect ( is the max), yet together they hit with large positive synergy — the capability is spread across cooperating layers, not localized. Localized would look like one layer near and tiny synergy.


Recall Self-test recap (cover the right side first)

Causal fraction with loss metric ::: Causal fraction with a "good = large" mass metric ::: Synergy of two components ::: Positive synergy means ::: components collaborate (each weak alone) Negative synergy means ::: components are redundant (compute the same thing) Undefined causal fraction means ::: no behavioural gap — the corruption didn't break the model Why a minimal pair matters ::: it isolates one feature so the patch effect is interpretable