atlas

Research map / Large language models / Language, safety and interpretability

Towards Best Practices of Activation Patching in Language Models: Metrics and Methods

ICLR 2024 · Large language models › Language, safety and interpretability · approach: Task vectors and steering · 5 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Systematically studies how corruption method (Gaussian noise vs symmetric token replacement), evaluation metric (probability vs logit difference vs KL), and sliding window patching affect activation patching localization results, and gives best-practice recommendations.

Problem

Activation patching is a standard localization tool in mechanistic interpretability, but papers vary in corruption methods, metrics, and window choices with no consensus, so reported localization and circuit results may be sensitive to these hyperparameters.

Approach

A first systematic study of activation patching's degrees of freedom: compares Gaussian noise vs symmetric token replacement corruption, probability vs logit difference metrics, and sliding window vs single-layer summation, showing disparate localization outcomes and arguing GN induces off-distribution internals and probability can miss negative components.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use STR instead of GN corruptionActivation patching for factual recall in GPT-2 XL · GPT-2 XL factual recallpeak MLP patching effect: GN peak is 2×--5× higher than STR; STR is stronger by up to 4× on GPT-J addition and subtractionMixed
Use STR instead of GN corruptionActivation patching for IOI circuit discovery · IOIattention-head localizationMixed
Use STR instead of GN corruptionActivation patching for the greater-than circuit · Greater-thanattention-head localizationHelped
Use probability instead of logit difference (ablation)Activation patching across subject-token positions · GPT-2 XL factual recall, STR, window size 5last-to-middle subject-token effect ratio: 4.33× vs 1.22×Mixed
Use probability instead of logit difference (ablation)Activation patching across subject-token positions · GPT-2 XL factual recall, GN, window size 5last-to-middle subject-token effect ratio: 1.74× vs 0.77×Mixed
Use probability as the metric (ablation)IOI negative-head detection under STR · IOIdetection of negative head 11.10: mean 0.003, SD 0.015, and 11.10 receives -0.022Hurt
Use probability instead of logit difference (ablation)IOI negative-head detection with random-name corruption · IOIdetection of negative Name Movers: 5\mathrm{e}{-4}Hurt
Jointly patch adjacent MLP layers rather than sum individual-layer effects (ablation)Activation patching for factual recall · GPT-2 XL factual recallpeak patching effect: 1.40×, 1.75× and 1.59×Helped
Corrupt S1 and IO instead of S2 (ablation)Activation patching for IOI circuit discovery · IOIName Mover head localizationHelped
Restore the values of S-Inhibition heads under GN rather than STR (ablation)IOI Name Mover behavior · IOIlogit difference: 1.04 -> 0.49Hurt
Use the original-IO probability as the metric under strong random-name corruption (ablation)Activation patching for IOI negative-head discovery · IOInegative Name Mover detection: 5\mathrm{e}{-4}Hurt

Surprising findings

Limitations

Experimental setup

Datasets: CounterFact Known1000 IOI prompts (Wang et al.) PairedFacts (constructed)

Benchmarks: factual recall (CounterFact/Known1000) IOI circuit greater-than Python docstring basic arithmetic

Metrics: probability logit difference KL divergence patching effect standard deviation detection threshold

Baselines: Gaussian noise corruption probability metric ROME-style causal tracing

Builds on: causal tracing (ROME) IOI circuit analysis path patching TransformerLens

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy