Standard gradient-based attribution patching (AtP) screens model components orders of magnitude faster than brute-force activation patching, yet it systematically drops key attention queries, keys, and self-cancelling neurons when pushed to 100% recall on Pythia-12B. János Kramár, Tom Lieberum, Rohin Shah, and Neel Nanda diagnose both failure modes and introduce AtP*, pairing a softmax recomputation fix with backward-pass layer dropout (GradDrop) and a subset-sampling diagnostic that bounds the size of any remaining missed nodes.

  • Scale problem: A 1,024-token prompt in Chinchilla 70B contains 2.7 x 10^9 neuron nodes, making exhaustive per-node activation patching sweeps infeasible without an approximate prefilter followed by targeted verification.
  • QK fix stays under 2 passes: Recomputing attention softmax weights directly from clean and noise queries and keys cuts key-recomputation complexity from O(T^3) to O(T^2) flops, costing less than 2 transformer forward passes across all attention nodes combined.
  • GradDrop exposes cancelling paths: Sweeping single-layer gradient drop across all L layers ((L + 1) / 2 backward passes with caching) catches neuron false negatives whose direct and indirect effects nearly cancel; highlighted missed neurons on Pythia-12B had direct-to-total effect ratios of 5.35 and 12.2 against a median of 0.77 among direct-effect nodes.
  • Orders-of-magnitude cheaper recall: Across Pythia 410M, 1B, 2.8B, and 12B on single prompt pairs, random text, and 100 to 120 pair distributions, AtP and AtP* consistently beat iterative, subsampling, block, and hierarchical baselines in forward-pass cost to verify top nodes.
Two false-negative mechanisms in Attribution Patching and how AtP* fixes them
Baseline: AtP

Costs 2 forward + 1 backward pass. Uses a single linear Taylor step around clean activations, so saturated attention softmaxes and cancelling paths yield near-zero gradients.

Fix 1: QK Fix

Explicitly recomputes post-softmax attention weights after swapping queries or keys (O(T^2) flops, under 2 forward passes), then dots weight deltas with attention gradients.

Fix 2: GradDrop

Zeros out residual gradients from one downstream layer l at a time and averages absolute scores over L layers ((L + 1) / 2 backward passes), breaking direct-vs-indirect cancellation.

Source: Kramár et al. (2024), Section 3.1.

How It Works

The authors frame causal localization as a two-stage pipeline: first score every node in a model using an estimator, then iterate down the ranked shortlist and verify each candidate with real activation patching forward passes. False positives are cheap because verification immediately discards them; false negatives are costly because missing a true node forces a linear scan through thousands or millions of irrelevant components.

Standard attribution patching (AtP) estimates noising impact via (n(x_noise) - n(x_clean))^T * grad_n L(M(x_clean)), taking absolute values inside the prompt expectation to avoid cross-prompt cancellation. AtP* repairs two blind spots where this local gradient vanishes even when a node matters:

  • Attention saturation (QK Fix): When a query or key pushes attention weights into a flat tail of the softmax on x_clean (or x_noise), the local gradient near zero hides huge jumps in attention probability. AtP* caches Q, K, and attention weights on both runs, explicitly recomputes the perturbed softmax probabilities, and multiplies the exact attention-weight delta by dL / d(attn).
  • Path cancellation (GradDrop): When a node’s direct effect on the logits has similar magnitude and opposite sign to its indirect effect routed through later layers (such as downstream self-repair in the Hydra effect), small nonlinear errors in AtP let the two terms cancel. AtP* runs L backward passes (reducible to (L + 1) / 2 by reusing intermediate states), blocking gradients through each layer l in turn and averaging |I_l| scaled by L / (L - 1).

To certify that nothing large remains unverified outside the top K candidates, AtP* pairs its shortlist with a subset-sampling diagnostic: it draws random Bernoulli masks (p = 0.01 or 0.03) over remaining nodes, runs patched passes, and applies a one-sided Welch’s t-test across all unverified nodes to compute 90%, 99%, and 99.9% upper confidence bounds on the largest missed effect.

Key Findings

The authors benchmark AtP, AtP+QKfix, and AtP* across Pythia 410M, 1B, 2.8B, and 12B on NeuronNodes (post-activation MLP neurons) and AttentionNodes (per-head Q, K, V, and output per token position), using negative log probability as the target metric. Baselines include iterative single-node patching, Bernoulli subsampling, fixed-size Blocks (sizes 2 to 250), and recursive Hierarchical grouping (branching factor 3).

On Pythia-12B single prompt pairs (CITY-PP and IOI-PP), iterative sweeps burn 10^4 to 10^6 forward passes just to surface top nodes, while grouping baselines (Subsampling, Blocks, Hierarchical) sit near 10^3 to 10^4 upfront passes before climbing past 10^5 for full recall. AtP hugs the oracle diagonal for the top 10 to 100 nodes before false negatives push verification to 10^4 to 10^5 passes. Adding QKfix removes the worst query and key misses, and GradDrop recovers cancelling neurons, keeping AtP* near oracle cost across orders of magnitude more nodes.

Relaxing from 100% to 90% verified recall sharply cuts AtP’s cost on CITY-PP, confirming that missed nodes are a small minority of top contributors. On multi-prompt distributions (IOI across 120 pairs, A-AN across 100 pairs) and unstructured RAND-PP text pairs from The Pile, AtP and AtP+QKfix stay far cheaper than non-gradient baselines, and cross-prompt averaging dampens single-pair cancellation so GradDrop’s extra backward passes matter less on distributions.

Which fast attribution method the authors recommend by setting
ScenarioRecommended methodUpfront cost & reason
Single prompt pair (neurons or attention)AtP* (QKfix + GradDrop)(L + 1)/2 backward passes pays off by catching brittle single-pair cancellations and saturated Q/K heads.
Prompt distribution, attention nodesAtP + QKfixUnder 2 extra forward passes per pair; averaging across prompts already reduces cancellation noise.
Prompt distribution, MLP neuronsStandard AtP2 forward + 1 backward pass; post-activation neurons sit away from softmax saturation.
Coarse layers or sliding windowsDirect patching, Blocks, or SubsamplingFull-layer edits violate local linearity and LayerNorm scaling; Blocks fits single pairs, Subsampling fits distributions.

Source: Kramár et al. (2024), Section 5.4 and Appendix B.

Caveats & Builder Takeaway

Every benchmark runs on Pythia models up to 12B using node-level noising and negative log-probability loss; in preliminary denoising checks on IOI (Appendix B.4), AtP* ranked nodes noticeably worse for reasons the authors leave unexplained. Their ground truth also ranks total causal effect rather than direct effect, and neuron patches operate in the standard basis rather than sparse autoencoder features (though sparse autoencoders cut active nodes per token by 20x to 50x, speeding up verification).

For practitioners localizing behaviors in billion-parameter models, use AtP* (or AtP+QKfix on distributions) as a fast ranker, verify the top K nodes with true activation patching, and run the subset-sampling diagnostic whenever missed nodes could invalidate your circuit discovery or interpretation claim.