Cache a successful computation.
Run the clean prompt and save activations at each candidate location. The clean output defines the behavior you want to recover.
A hands-on mechanistic interpretability experiment
Activation patching swaps a hidden state from a clean run into a corrupted run. If the original behavior returns, that location is causally implicated in the behavior under this intervention.
Each heatmap cell represents a synthetic intervention at one token position and transformer layer. Click a cell, change the patch width, or run the sweep to see how localization depends on the experiment.
The Eiffel Tower is in
The Colosseum is in
Localization comes from an intervention, not from reading a representation in isolation. The comparison needs a clean baseline, a meaningful corruption, and a declared output metric.
Run the clean prompt and save activations at each candidate location. The clean output defines the behavior you want to recover.
Change the input so the model's target behavior degrades. A weak or off-target corruption gives an uninformative denominator.
Insert a cached clean activation into the corrupted forward pass. Repeat across locations to build a causal-response map.
Activation patching can identify places where a clean state is sufficient to restore output behavior in a specific setup. Interpretation still depends on corruption choice, metric, granularity, and interactions among components.
The result describes this prompt family, intervention, component type, and score. Change those choices and the map can move.
Exact patching needs another forward pass for each tested location. A 12-layer, 8-token sweep means 96 patched runs, plus baselines.
98 runsA patch showing sufficiency does not prove the component is uniquely necessary; redundant or interacting pathways may exist.
The site of the patch changes the unit of explanation. Broader patches can recover more behavior while localizing less precisely.
This lab uses a transparent synthetic response surface to teach the intervention protocol. Real model claims require real forward passes, held-out prompts, multiple corruption methods, and behavioral evaluation.