Large language models (LLMs) are increasingly used as knowledge bases, but keeping them up to date requires targeted knowledge editing (KE). However, it remains unclear how edits are implemented inside the model once applied. In this work, we take a mechanistic view of KE using neuron-level knowledge attribution (NLKA). Unlike prior work that focuses on pre-edit causal tracing and localization, we use post-edit attribution -- contrasting successful and failed edits -- to isolate the computations that shift when an edit succeeds. Across representative KE methods, we find a consistent pattern: mid-to-late attention predominantly promotes the new target, while attention and FFN modules cooperate to suppress the original fact. Motivated by these findings, we propose MEGA, a MEchanism-Guided Activation steering method that performs attention-residual interventions in attribution-aligned regions without modifying model weights. On CounterFact and Popular, MEGA achieves strong editing performance across KE metrics on GPT2-XL and LLaMA2-7B. Overall, our results elevate post-edit attribution from analysis to engineering signal: by pinpointing where and how edits take hold, it powers MEGA to deliver reliable, architecture-agnostic knowledge edits.
Figures & tables
Figure 1: Overview of MEGA. (Left): Post-edit NLKA identifies mid-to-late attention layers with high leverage on the target vs. original token. (Middle): MEGA uses this signal to select an edit zone and (Right): applies PCA-stabilized attention–residual steering at inference time, promoting the edited fact without changing weights.
Figure 2: MEMIT success vs. failure. Mean contribution differences across multiple cases; positive promotes new target, negative suppresses original.
Appendix figures & tables23 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 3: IKE success vs. failure on CounterFact (GPT2-XL).
Figure 4: ROME success vs. failure on CounterFact (GPT2-XL).
Figure 5: Fine-tuning success vs. failure on CounterFact (GPT2-XL).
Figure 6: ROME success vs. failure on CounterFact (LLaMA2-7B).
Figure 7: IKE success vs. failure on CounterFact (LLaMA2-7B).
Figure 8: MEMIT success vs. failure on CounterFact (LLaMA2-7B).
Figure 9: Fine-tuning success vs. failure on CounterFact (LLaMA2-7B).
Figure 10: ROME success vs. failure on Popular (GPT2-XL).
Figure 11: IKE success vs. failure on Popular (GPT2-XL).
Figure 12: MEMIT success vs. failure on Popular (GPT2-XL).
Figure 13: Fine-tuning success vs. failure on Popular (GPT2-XL).
Figure 14: ROME success vs. failure on Popular (LLaMA2-7B).
Figure 15: IKE success vs. failure on Popular (LLaMA2-7B).
Figure 16: MEMIT success vs. failure on Popular (LLaMA2-7B).
Figure 17: Fine-tuning success vs. failure on Popular (LLaMA2-7B).
Setting
Range
Acc
Gen
Spec
DI
DII
Avg
26-layer
0–25
0.16
0.08
0.99
1.00
0.47
0.54
26-layer
15–40
0.98
0.84
0.87
1.00
0.98
0.93
26-layer
22–47
0.88
0.71
0.87
0.99
0.96
0.88
17-layer
0–16
0.01
0.02
1.00
0.22
0.02
0.25
17-layer
20–36
0.86
0.73
0.88
0.98
0.93
0.88
17-layer
31–47
0.21
0.25
0.94
0.82
0.78
0.60
Appendix
Table 3: Attention steering on CounterFact for GPT2-XL: moving a fixed-size window. Attribution-guided mid layers (15–40, 20–36) clearly outperform early or very-late windows.
Comp
PCA
Acc
Gen
Spec
DI
DII
Avg
Range 0–25
ATTN
128
0.158
0.079
0.992
1.000
0.467
0.539
ATTN
512
0.183
0.075
0.987
0.925
0.533
0.541
ATTN-res
128
0.092
0.075
0.915
0.708
0.217
0.401
ATTN-res
512
0.217
0.233
0.897
0.858
0.783
0.598
FFN
128
0.008
0.004
0.998
0.008
0.017
0.207
Appendix
Table 4: Multi-layer steering on CounterFact (GPT2-XL), 26-layer windows.
Comp
PCA
Acc
Gen
Spec
DI
DII
Avg
Range 0–16
ATTN
128
0.008
0.017
1.000
0.217
0.017
0.252
ATTN
512
0.008
0.013
1.000
0.167
0.008
0.239
ATTN-res
128
0.025
0.008
0.969
0.533
0.017
0.310
ATTN-res
512
0.017
0.017
0.978
0.283
0.092
0.277
FFN
128
0.008
0.013
1.000
0.000
0.033
0.211
Appendix
Table 5: Multi-layer steering on CounterFact (GPT2-XL), 17-layer windows.
Comp
PCA
Acc
Gen
Spec
DI
DII
Avg
Layer 0
ATTN
1600
0.008
0.008
1.000
0.067
0.000
0.217
ATTN
128
0.008
0.008
1.000
0.067
0.000
0.217
ATTN
512
0.008
0.008
1.000
0.067
0.000
0.217
ATTN-res
1600
0.008
0.008
1.000
0.067
0.000
0.217
ATTN-res
128
0.008
0.008
0.998
0.000
0.000
0.203
Appendix
Table 6: Single-layer steering on CounterFact (GPT2-XL), layers 0–15.
Comp
PCA
Acc
Gen
Spec
DI
DII
Avg
Layer 20
ATTN
1600
0.008
0.013
1.000
0.125
0.000
0.229
ATTN
128
0.008
0.013
1.000
0.142
0.000
0.233
ATTN
512
0.008
0.013
1.000
0.133
0.000
0.231
ATTN-res
1600
0.025
0.029
1.000
0.467
0.067
0.318
ATTN-res
128
0.025
0.038
0.999
0.825
0.042
0.386
Appendix
Table 7: Single-layer steering on CounterFact (GPT2-XL), layers 20–30.
Comp
PCA
Acc
Gen
Spec
DI
DII
Avg
Range 13–31
ATTN
512
0.942
0.825
0.888
0.917
0.950
0.904
ATTN-res
512
0.992
0.913
0.888
1.000
0.967
0.952
FFN
512
0.000
0.008
0.888
0.250
0.433
0.316
Res
512
0.908
0.779
0.888
0.767
0.875
0.844
Range 15–27
Appendix
Table 8: Multi-layer steering on CounterFact (LLaMA2-7B), layer windows.
Comp
PCA
Acc
CI
CII
RS
SA
Avg
Range 15–40
ATTN
128
0.667
0.275
0.400
0.382
0.703
0.485
ATTN
512
0.392
0.250
0.400
0.441
0.658
0.428
ATTN-res
128
0.642
0.225
0.400
0.324
0.679
0.454
ATTN-res
512
0.817
0.200
0.450
0.324
0.648
0.488
FFN
128
0.050
0.410
0.000
0.660
1.000
0.424
Appendix
Table 9: Multi-layer steering on Popular (GPT2-XL), layer windows.
Comp
PCA
Acc
CI
CII
RS
SA
Avg
Range 13–31
ATTN
512
0.517
0.082
0.284
0.354
0.637
0.375
ATTN-res
512
0.817
0.074
0.247
0.329
0.637
0.421
Res
512
0.692
0.081
0.148
0.399
0.651
0.394
Range 15–31
ATTN
512
0.500
0.082
0.284
0.367
0.630
0.372
Appendix
Table 10: Multi-layer steering on Popular (LLaMA2-7B), layer windows.