Correcting Attribution Patching with a Few Exact Measurements
Organizations: Carnegie Mellon University · University of California, Santa Cruz
Abstract
Mechanistic interpretability asks which language model components matter for a behavior, and activation patching answers by changing one component's activation and measuring its effect, at a cost growing with components and prompts. Attribution patching estimates these effects from one gradient pass, but its estimates can be far off, and verifying each one restores the cost. Can the structure of these errors reduce this cost? We propose Guided-AP, which uses a few exact measurements to reveal attribution patching's errors and correct unmeasured estimates. On a single prompt, many components' errors share one sign, so a small exact sample yields one correction for the rest. Over many prompts of one task, components are misestimated similarly, so a few measured prompts show what to verify and how to correct each component's average effect. Our analysis shows that choosing what to verify needs error size, while correction also needs sign. On a single prompt, the correction lowers error by up to 26% across three behaviors at the compute of verifying the largest estimates and also on larger models. Over many prompts, learned corrections cut the error of average effects on factual completion by 75% to 79%, repaying their cost in long analyses.
Figures & tables
| Task | Groups | Lower MAE | Relative AP error | Warm time (s/layer) |
|---|---|---|---|---|
| Gemma-2-9B | ||||
| IOI | 100 | 17.4% | 0.94% | 2.08 |
| Factual | 100 | 26.2% | 1.20% | 1.30 |
| SVA | 100 | 19.9% | 0.71% | 1.25 |
| Qwen3-14B | ||||
| IOI | 52 | 24.0% | 1.34% | 2.95 |
| Task | Verify only | Verify + shift | Guided-AP |
|---|---|---|---|
| IOI | 1.00 | 1.93 | 0.83 |
| Factual | 1.00 | 0.97 | 0.74 |
| SVA | 1.00 | 1.80 | 0.81 |
| Task | Method | Qwen3-8B | Qwen2.5-7B | ||
|---|---|---|---|---|---|
| IOI | Guided-AP | 12% | 7% | 29% | 12% |
| ProbeCal | 17% | 19% | 39% | 15% | |
| Factual | Guided-AP | 20% | 2% | 18% | 2% |
| ProbeCal | 17% | 31% | 5% | 35% | |
| SVA | Guided-AP | 3% | 4% | 2% | 3% |
| Guided-AP | Verification to 1% | |||
|---|---|---|---|---|
| Task | Error | s/layer | Checks | s/layer |
| IOI | 0.94% | 2.08 | 2,416 | 16.37 |
| Factual | 1.20% | 1.30 | 5,664 | 21.84 |
| SVA | 0.71% | 1.25 | 32 | 0.43 |
Appendix figures & tables16 assets
Supplementary material from the paper’s appendix.
Appendix
| Guided-AP | Cheapest measured verification prefix: checks / s per layer | ||||||
| Model | Task | Groups | Error | s/layer | 2% target | 1% target | 0.5% target |
| Gemma-2-9B | IOI | 100 | 0.94% | 2.08 | 0 / 0.27 | 2,416 / 16.37 | 8,128 / 54.16 |
| Gemma-2-9B | Factual | 100 | 1.20% | 1.30 | 0 / 0.25 | 5,664 / 21.84 | 9,904 / 38.00 |
| Gemma-2-9B | SVA | 100 | 0.71% | 1.25 | 0 / 0.25 | 32 / 0.43 | 5,472 / 20.25 |
| Qwen3-14B | IOI | 52 | 1.34% | 2.95 | 16 / 0.76 | 8,016 / 73.12 | 12,608 / 114.56 |
| Qwen3-14B | Factual | 56 | 0.57% | 1.67 | 0 / 0.42 | 0 / 0.42 | 2,144 / 10.29 |
| Primary reference | FP64 reference | ||||||
|---|---|---|---|---|---|---|---|
| Task | Groups | Error | Guided-AP (s/layer) | Verify-more (s/layer) | Ratio | Error | Ratio |
| IOI | 10 | 1.093% | 6.52 | 91.16 | 14.0 | 1.110% | 16.3 |
| Factual | 31 | 1.088% | 3.54 | 51.95 | 14.7 | 1.099% | 11.8 |
| SVA | 40 | 0.664% | 3.55 | 21.06 | 5.9 | 0.658% | 2.6 |
| IOI | Factual | SVA | ||||
|---|---|---|---|---|---|---|
| Method | Error | Seconds | Error | Seconds | Error | Seconds |
| AtP | 1.474% | 0.29 | 1.828% | 0.28 | 1.404% | 0.29 |
| Verify-more | 1.292% | 2.61 | 1.725% | 1.29 | 0.909% | 1.67 |
| AtP* + AP | 1.286% | 3.46 | 1.721% | 2.69 | 0.898% | 2.62 |
| No-pilot centering | 1.320% | 2.61 | 1.722% | 1.29 | 0.942% | 1.67 |
| Selective HVP | 1.321% | 18.69 | 1.758% | 18.70 | 1.029% | 18.76 |
| Model | Task | Groups | Guided-AP vs verification (%) | Guided-AP vs verification + shift (%) | FP64: Guided-AP vs verification + shift (%) |
|---|---|---|---|---|---|
| Gemma-9B | IOI | 100 | 17.3 [14.7, 20.0] | 57.2 [53.9, 60.1] | 56.4 [53.0, 59.6] |
| Gemma-9B | Factual | 100 | 26.2 [23.4, 28.9] | 23.6 [17.4, 30.3] | 22.9 [16.4, 30.0] |
| Gemma-9B | SVA | 100 | 19.1 [16.7, 21.5] | 55.1 [48.0, 61.8] | 55.1 [47.9, 61.8] |
| Qwen3-14B | IOI | 52 | 24.0 [19.2, 28.5] | 45.8 [40.7, 50.3] | 45.4 [40.1, 50.1] |
| Qwen3-14B | Factual | 56 | 12.2 [9.6, 15.0] | 75.9 [71.0, 79.3] | 75.7 [70.7, 79.2] |
| Qwen3-14B | SVA | 53 | 10.9 [7.9, 14.1] | 75.3 [70.9, 78.8] | 75.2 [70.8, 78.6] |
| Task | Pilot | Stratified median | Uniform median | Stratified mean |
|---|---|---|---|---|
| IOI | 16 | 16.7 | 16.5 | 7.0 |
| IOI | 32 | 17.6 | 17.5 | 8.2 |
| IOI | 64 | 17.3 | 17.3 | 5.0 |
| IOI | 128 | 15.3 | 15.3 | 5.9 |
| Factual | 16 | 24.2 | 24.1 | 23.9 |
| Factual | 32 | 25.6 | 25.7 | 25.3 |
| Task | Groups | ||||
|---|---|---|---|---|---|
| IOI | 20 | 17.0 | 18.2 | 18.0 | 15.8 |
| Factual | 20 | 25.4 | 26.7 | 27.3 | 27.1 |
| SVA | 20 | 19.4 | 20.2 | 20.1 | 18.5 |
| Task | Gain | ||||
|---|---|---|---|---|---|
| IOI | 19.76 | 0.72 | 1.74 | 0.13 | 17.42 |
| Factual | 27.37 | 0.83 | 0.36 | 0.02 | 26.21 |
| SVA | 21.07 | 0.82 | 1.36 | 1.04 | 19.92 |
| Model | Task | Primary | Fixed | Refit |
|---|---|---|---|---|
| Gemma-9B | IOI | 17.4 | 10.1 | 16.3 |
| Factual | 26.2 | 23.4 | 25.4 | |
| SVA | 19.9 | 15.4 | 20.4 | |
| Qwen3-14B | IOI | 24.0 | 21.0 | 24.5 |
| Factual | 12.3 | 10.4 | 12.8 | |
| SVA | 10.9 | 4.1 | 9.5 |
| Model | Task | Full | ||
|---|---|---|---|---|
| Gemma-9B | IOI | 22.7% | 19.4% | 17.4% |
| Factual | 27.8% | 26.8% | 26.2% | |
| SVA | 22.6% | 20.9% | 19.9% | |
| Qwen3-14B | IOI | 27.4% | 25.7% | 24.0% |
| Factual | 16.2% | 13.9% | 12.3% | |
| SVA | 19.2% | 14.4% | 10.9% |
| Model | Task | AP error | Probe | Top-16 kept |
|---|---|---|---|---|
| Qwen3 | IOI | 0.69 | 0.97 | 16 / 16 |
| Qwen3 | Factual | 0.80 | 0.97 | 15 / 16 |
| Qwen3 | SVA | 0.57 | 0.95 | 14 / 16 |
| Qwen2.5 | IOI | 0.69 | 0.95 | 13 / 14 |
| Qwen2.5 | Factual | 0.81 | 0.97 | 15 / 15 |
| Qwen2.5 | SVA | 0.62 | 0.95 | 12 / 15 |
| Error ratio | Guided-AP labels | ||||
|---|---|---|---|---|---|
| Model | Task | Guided-AP | ProbeCal | Heads | Coverage |
| Qwen3 | IOI | 0.95 | 1.49 | 121/1,152 | 10.5% |
| Qwen3 | Factual | 3.98 | 1.87 | 145/1,152 | 12.6% |
| Qwen3 | SVA | 1.23 | 1.14 | 265/1,152 | 23.0% |
| Qwen2.5 | IOI | 0.66 | 1.09 | 163/784 | 20.8% |
| Qwen2.5 | Factual | 4.78 | 1.86 | 141/784 | 18.0% |
LLM Interpretability
Large language model (LLM) interpretability studies how internal representations and computations produce outputs, and how they can be explained or controlled.
See all 778 papers