6.3.9 · D1Interpretability & Explainability

Foundations — Activation patching

2,703 words12 min readBack to topic

This page assumes you have seen none of the notation in the Activation patching parent note. We will build every symbol — , , , , , , — from the ground up, in the order they depend on each other. By the end you will be able to read the parent note's formulas as plain English.


0. What is a model, really?

Before any symbol, picture the object we study.

Figure — Activation patching

A language model reads some text and produces a guess for the next word. Look at the figure: text goes in on the left, flows rightward through a stack of identical layers (drawn as boxes), and a prediction comes out on the right. Between every pair of boxes there are numbers travelling along the wires — those travelling numbers are the whole subject of this page.


1. Activations — the travelling numbers

This is the star of the show, so it gets its own figure.

Figure — Activation patching

Now we decorate the letter so it can point at an exact spot in the machine.

Putting the tags together, reads: "the activation, at layer , that showed up when we ran the clean input." Three facts stacked on one letter: what (an activation ), where (layer , up-right; component if named), from which run (clean, down-right).


2. The output side — logits, softmax, probabilities, ,

The model does not shout a single word. Internally its final box hands out one raw number per candidate word — these raw scores are called logits — and a fixed formula turns those into a confidence score for every possible next word. We need to spell out that pipeline, then the tools (, ) that read it.

Figure — Activation patching

Why do we need the next two tools ( and the minus sign)? Because raw probabilities are awkward to compare: the interesting ones are tiny (like ) and our eyes can't rank tiny numbers well. We want a ruler that stretches out small numbers and turns "more confident" into "smaller score."


3. Change and gap — the symbol


4. How it all fits together

Figure — Activation patching

Three runs, one comparison. The figure shows the clean run (correct answer), the corrupt run (wrong answer), and the patched run — corrupt input, but one component's numbers replaced by the clean ones. We then ask: did the answer snap back toward correct?

The causal fraction the parent uses, is now readable symbol-by-symbol: top = "how much surprise we removed," bottom = "the total surprise there was to remove," ratio = "what fraction of the mistake this one component explains," a number from (did nothing) to (explains everything).


Prerequisite map

Model as a function f

Logits z from f

softmax makes P of next word

Activations a on the wires

Layer index and component

natural log stretches small numbers

Loss L equals minus log P

Delta the change in loss

Activation patching

Causal fraction 0 to 1

Each foundation feeds the next: you cannot judge a patch (need , right branch) without a loss (needs and , which needs logits + softmax), and you cannot do a patch without knowing what an activation is (left branch).


Where to go next


Equipment checklist

Cover the right side and see if you can answer each before revealing.

What does the single letter stand for?
The whole model treated as one machine; = "run the model on input ".
What type of thing does actually return, before any probability?
A list of raw real-number scores called logits, , one per candidate word.
Which formula turns logits into probabilities ?
Softmax: — exponentiate then normalise so they are positive and sum to 1.
What is an activation?
The list of numbers a component holds on the wires while processing one input.
In , what does the raised mean, and what does it NOT mean?
It means "at layer " (a location). It does NOT mean a power/exponent.
What is the difference between the subscript in and in ?
says WHICH component (location inside the box); says WHICH run produced the numbers (a name tag).
The bar appears in and in — same meaning?
No. First = "given that" (conditional probability); second = "run under this intervention". Different jobs, same symbol.
Which base does use in this note, and does the base change any conclusion?
Natural log, base . Switching to only rescales every loss by ; ratios and comparisons are unchanged.
— is it a plain number or a function? Spell out the chain it computes.
A function: input logits softmax negate, giving one surprise number.
What does abbreviate?
— the surprise of the corrupt run's output.
In words, what is ?
The drop in loss caused by patching component = (surprise before) − (surprise after).
What does a causal fraction of mean? Of ?
= this component fully explains the clean-vs-corrupt difference; = it explains none of it.