Two activation-patching experiments on the same model and task can point to different layers and attention heads simply because they use different corruption protocols or scoring metrics. Across factual recall, Indirect Object Identification (IOI), Python docstring completion, Greater-Than, and arithmetic benchmarks, Fred Zhang and Neel Nanda show that switching from Gaussian noise to in-distribution token replacement swings middle-MLP localization peaks by 2x to 5x, while probability scoring can erase entire negative heads.

  • Corruption swings peak size 2x to 5x: On GPT-2 XL factual recall (145 prompt pairs, 49.0% accuracy), Gaussian noise (GN) produces a layer-16 MLP peak 2x to 5x larger than symmetric token replacement (STR), whereas on GPT-J arithmetic STR yields up to 4x sharper peaks than GN.
  • Noise puts attention off distribution: On 500 IOI prompts, Name Mover heads place 0.58 attention on IO cleanly and preserve that pattern under STR, but GN splits attention (0.26 on IO vs 0.21 on S1) and halves recovery from S-Inhibition values (0.49 vs 1.04 logit difference).
  • Probability misses negative heads: Under STR on IOI, corrupted P(IO) averages 0.03; Negative Name Mover 11.10 scores -0.022 (inside the 2 SD cutoff of -0.027) and vanishes, while under three-name replacement (P(IO) = 5e-4) probability misses both 10.7 and 11.10.
  • Sliding windows inflate peaks: Jointly patching 3, 5, or 10 adjacent MLP layers produces 1.40x, 1.75x, and 1.59x higher peaks than summing the corresponding single-layer patches.
How corruption and metric choices alter localization in GPT-2
IOI Name Mover attention on IO (500 GPT-2 Small prompts, higher preserves clean routing)
Clean baseline
0.58
GN on S2 (corrupted)
0.26
Recovery after patching S-Inhibition values (IOI logit difference, higher is stronger)
STR (in-distribution)
1.04
GN (noised embedding)
0.49
Factual recall: last-subject vs middle-subject MLP effect ratio (GPT-2 XL, STR, w = 5)
Probability metric
4.33x
Logit difference
1.22x

Source: Zhang & Nanda (2024), Sections 3.2 and 4.1.

How It Works

Activation patching runs three forward passes to test whether an internal state causally restores a behavior: a clean pass on X_clean (caching activations), a corrupted pass on X_corrupt, and a patched pass on X_corrupt overwriting one component with its clean cache. Comparing patched against corrupted outputs yields the patching effect, swept across layers, positions, or heads as in ROME factual localization and IOI circuit analysis.

Zhang and Nanda isolate three methodological choices that prior papers set inconsistently:

  • Corruption protocol: Gaussian noising (GN) adds zero-mean noise with SD equal to 3x the dataset token-embedding SD to key subject tokens. Symmetric token replacement (STR) swaps them for equal-length, valid alternatives ("The Eiffel Tower is in" paired with "The Colosseum is in"), tested via PAIRED FACTS (145 pairs).
  • Evaluation metric: Probability tracks P(r) for the clean answer; normalized logit difference tracks Logit(r) - Logit(r') divided by the clean-minus-corrupted gap; KL divergence tracks full distribution shift.
  • Layer aggregation: Sliding window patching restores k adjacent MLP layers simultaneously (k = 3, 5, 10) instead of patching single layers.

Key Findings

Switching between GN and STR changes both localization intensity and which heads appear significant. In GPT-2 XL factual recall (49.0% accuracy, 6.85 logit difference on PAIRED FACTS) and GPT-2 Large (41.1%, 5.88 logit difference), GN produces an early-middle MLP peak around layer 16 that is 2x to 5x larger than STR across window sizes. Yet in GPT-J 6B arithmetic (200 prompts each for addition, subtraction, and multiplication), STR produces up to 4x sharper MLP peaks than GN on addition and subtraction, showing that GN’s distortion is task-dependent rather than a uniform gain factor.

In GPT-2 Small circuit discovery, GN creates out-of-distribution artifacts. On IOI, GN breaks early fuzzy Duplicate Token head 0.10 (which reads noised embeddings directly) and falsely flags it as hurting performance under probability and KL divergence. On Greater-Than (300 prompts), STR recovers known heads (6.9, 7.10, 8.11, 9.1), whereas GN scatters detections with little overlap beyond 7.10 and 9.1. On Python docstring completion in a 4-layer attention-only model (200 instances, 56% accuracy), GN again adds spurious detections unless probability hides them, while heads 3.0 and 3.6 survive across methods.

Metric choice skews both token-position and component-sign conclusions. Across all positions in GPT-2 XL factual recall, probability concentrates 4.33x more effect on the last subject token than middle subject tokens under STR (1.74x under GN), whereas logit difference drops that ratio to 1.22x under STR (0.77x under GN). Probability’s zero floor also blinds it to negative components whenever corruption pushes P(r) near zero: under STR on IOI S2, logit difference and KL find both Negative Name Movers (10.7, 11.10), while probability misses 11.10. Even worse, sweeping S2 alone misses Name Movers 9.6 and 10.0 under every method; all three Name Movers (9.6, 9.9, 10.0) appear only when corrupting S1 and IO.

Finally, sliding window patching inflates localization relative to additive single-layer effects. At the last subject token in GPT-2 XL (GN plus probability), windows of size 3, 5, and 10 yield 1.40x, 1.75x, and 1.59x larger peaks than summing single-layer patches, and at least 20% higher peaks across every tested setup. Joint patching blocks corrupted flow inside the window and restores multi-layer nonlinear computation no single layer achieves alone.

Best-practice defaults across the three patching choices
1. Corruption: STR

Use in-distribution token swaps whenever token lengths align; reserve GN for cases where no counterfactual prompt exists. Always test multiple token positions.

2. Metric: Logit diff

Cancels shared name or format circuits and detects negative heads; pair with KL divergence when no binary target pair exists, and avoid raw probability.

3. Scope: Single layer

Start with single-layer patches before sliding windows; interpret any window peak as joint multi-layer computation rather than one layer acting alone.

Source: Zhang & Nanda (2024), Section 6.

Caveats & Builder Takeaway

These experiments test decoder-only models up to 6B parameters (GPT-2 Small, Large, XL, and GPT-J 6B) and examine clean-to-corrupted denoising rather than noising vs denoising asymmetry. Even with STR and logit difference, single-component sweeps on IOI miss parts of the circuit, confirming that path patching remains necessary to trace edge-level composition.

Treat any localization heatmap as conditional on the comparator prompt, corrupted token positions, and metric. Default to equal-length STR pairs with normalized logit difference, verify candidates across multiple corrupted positions, and never infer a single-layer mechanism from a sliding window alone.