Grimoire
Sheet
pathinterpretability/causal
difficultyadvanced
timeO(L²·n)
described2022
revised4w ago

Path Patching

Activation patching changes a component’s output for every downstream reader at once. Path patching changes it for one reader only, which is what a claim about an edge in a circuit actually requires.

Theory

Because the residual stream is a sum, a component’s output reaches every later block. Patching it measures the total effect along all paths simultaneously. To isolate an edge ABA \rightarrow B you must present the patched value of AA to BB alone, while every other consumer of AA continues to see the original.

effect(AB)=M(do(inputB(A)a))M()\mathrm{effect}(A \rightarrow B) = M\bigl( \mathrm{do}(\mathrm{input}_B(A) \leftarrow a') \bigr) - M(\cdot)
eq. 1 — one edge, all other consumers untouched

Implementation requires three runs: a clean run, a corrupt run, and a run in which BB is recomputed from a residual stream that has had AA‘s contribution swapped, with everything downstream of BB then freely recomputed. Doing it for all pairs is quadratic in components, which is why attribution methods exist.

Related
References
[1]Wang et al. — Interpretability in the Wild: a Circuit for Indirect Object Identification (2022)arXiv:2211.00593
[2]Goldowsky-Dill et al. — Localizing Model Behavior with Path Patching (2023)arXiv:2304.05969