ElemedexA pocket encyclopedia of AI architectures

Glossary (TM) › Interpretability and evaluation

TM167

Activation patching

Also: causal tracing, interchange intervention

In Spanish: Parcheo de activaciones

An intervention technique that swaps a component's activation in one run for the one it had in another, to measure whether that component is causally responsible for a behavior.

The recipe has three steps (Millière & Buckner, 2024b, sec. 2.5). Run the model on "The capital of France is…" and cache its activations; run it on "The capital of Germany is…", which gives "Berlin"; and run Germany again, but replace the activation of a single component (an attention head, a feedforward layer, a position in the residual stream) with the cached one. If the probability of "Paris" recovers, measured for instance by the difference in logits between the two answers, that component carries causally relevant information. Repeated over every component, the method draws a map of circuits.

The same idea goes by several names: causal mediation analysis (Vig et al., 2020), causal tracing (Meng et al., 2022), interchange intervention (Geiger et al., 2021). Meng's team used it to locate factual associations in middle feedforward layers and then edit them; Wang et al. (2023) explained how GPT-2 small identifies the indirect object in sentences like "When Mary and John went to the store, John gave a drink to…" with 26 attention heads grouped into seven classes.

Unlike probing, which only shows that information can be read off, patching shows that it is used. Its philosophical frame is Woodward's interventionism: X causes Y if intervening on X changes Y with everything else held fixed (Millière & Buckner, 2024b, sec. 2.4); and its formalization is causal abstraction, which measures how well a high-level algorithm reproduces the effects of interventions on the network (2024b, sec. 2.6).

The caveats are technical and conceptual. Patched activations can push the network into states it would never visit; some layers compensate for the ablation of others (the "Hydra effect" of McGrath et al. (2023)); and Hase et al. (2023) showed that where a fact is localized does not predict where it is best edited. If causation is distributed and redundant, what does it mean to say that a component "represents" something?

Sources