Dynamic Weight Grafting: Localizing Finetuned Factual Knowledge in Transformers
Not on the map. Why?
Abstract (arXiv)
When an LLM learns a new fact during finetuning (e.g., new movie releases, newly elected pope, etc.), where does this information go? Are entities enriched with relation information immediately, or do models recall information just-in-time before a prediction? Or, are "all of the above" true, with LLMs implementing multiple redundant heuristics? Existing localization approaches (e.g., activation patching) are ill-suited for this analysis because they usually replace parts of the residual stream, thus overriding previous information. To fill this interpretability gap, we propose dynamic weight grafting, an analysis technique that selectively grafts subsets of weights from a finetuned model onto a pretrained model. Using this technique, we show two separate pathways for retrieving finetuned relation information: 1) "enriching" the residual stream with relation information while processing the tokens that correspond to an entity (e.g., "Zendaya" in "Zendaya co-starred with Timoth'ee Chalamet" and 2) "recalling" this information at the final token position before generating a target fact. In some cases, models need information from both of these pathways to correctly generate finetuned facts while, in other cases, either the "enrichment" or "recall" pathway alone is sufficient. We localize the "recall" pathway to model components -- finding that "recall" occurs via both task-specific attention mechanisms and an entity-specific extraction step in the feedforward networks of the final layers before prediction. By targeting model components and parameters, as opposed to just activations, we are able to understand the mechanisms by which finetuned knowledge is retrieved during generation.
Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Builds on 48 of its 60 references that are in the map. First posted on arXiv 25 Jun 2025.
Builds on
48 of 60 references.
References · 48
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2022Locating and Editing Factual Associations in GPTcited by 2,691
- 2019Language Models as Knowledge Bases?cited by 1,936
- 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,786
- 2019Similarity of Neural Network Representations Revisitedcited by 1,755
- 2023Sparse Autoencoders Find Highly Interpretable Features in Language Modelscited by 1,420
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
- 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,165
- 2022Editing Models with Task Arithmeticcited by 1,120
- 2022Mass-Editing Memory in a Transformercited by 1,001
- 2019How Can We Know What Language Models Know?cited by 959
- 2023Progress measures for grokking via mechanistic interpretabilitycited by 839
36 more
- 2023TIES-Merging: Resolving Interference When Merging Modelscited by 818
- 2020How Much Knowledge Can You Pack Into the Parameters of a Language Model?cited by 719
- 2021Do Vision Transformers See Like Convolutional Neural Networks?cited by 675
- 2021Editing Factual Knowledge in Language Modelscited by 553
- 2024Scaling and evaluating sparse autoencoderscited by 553
- 2022Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Spacecited by 532
- 2023Dissecting Recall of Factual Associations in Auto-Regressive Language Modelscited by 528
- 2021Fast Model Editing at Scalecited by 498
- 2021Causal Abstractions of Neural Networkscited by 422
- 2023The Reversal Curse: LLMs trained on "A is B" fail to learn "B is A"cited by 407
- 2024The Platonic Representation Hypothesiscited by 382
- 2023MQuAKE: Assessing Knowledge Editing in Language Models via Multi-Hop Questionscited by 300
- 2023Physics of Language Models: Part 3.1, Knowledge Storage and Extractioncited by 270
- 2023Does Localization Inform Editing? Surprising Differences in Causality-Based Localization vs. Knowledge Editing in Language Modelscited by 243
- 2023Evaluating the Ripple Effects of Knowledge Editing in Language Modelscited by 242
- 2020Modifying Memories in Transformer Modelscited by 224
- 2024How to use and interpret activation patchingcited by 214
- 2023How does GPT-2 compute greater-than?: Interpreting mathematical abilities in a pre-trained language modelcited by 202
- 2023Linearity of Relation Decoding in Transformer Language Modelscited by 200
- 2023Localizing Model Behavior with Path Patchingcited by 195
- 2023The Clock and the Pizza: Two Stories in Mechanistic Explanation of Neural Networkscited by 156
- 2024AtP*: An efficient and scalable method for localizing LLM behaviour to componentscited by 111
- 2023Task-Specific Skill Localization in Fine-tuned Language Modelscited by 105
- 2023Language Models Implement Simple Word2Vec-style Vector Arithmeticcited by 98
- 2024Information Flow Routes: Automatically Interpreting Language Models at Scalecited by 95
- 2021Do Language Models Have Beliefs? Methods for Detecting, Updating, and Visualizing Model Beliefscited by 79
- 2023Knowledge is a Region in Weight Space for Fine-tuned Language Modelscited by 58
- 2024LoFiT: Localized Fine-tuning on LLM Representationscited by 57
- 2024What Makes and Breaks Safety Fine-tuning? A Mechanistic Studycited by 55
- 2023Characterizing Mechanisms for Factual Recall in Language Modelscited by 48
- 2023Analyzing Feed-Forward Blocks in Transformers through the Lens of Attention Mapscited by 33
- 2023A Comprehensive Survey on Relation Extraction: Recent Advances and New Frontierscited by 22
- 2023Memory Injections: Correcting Multi-Hop Reasoning Failures during Inference in Transformer-Based Language Modelscited by 21
- 2021How do Quadratic Regularizers Prevent Catastrophic Forgetting: The Role of Interpolationcited by 19
- 2025Layers at Similar Depths Generate Similar Activations Across LLM Architecturescited by 12
- 2025Does Editing Provide Evidence for Localization?cited by 7
Built on by
Citing papers per year: 2026: 3.
3 papers.
Similar, not cited
Close in wording, no citation either way
- 2024Representation Shattering in Transformers: A Synthetic Study with Knowledge Editing
- 2024Relation Also Knows: Rethinking the Recall and Editing of Factual Associations in Auto-Regressive Transformer Language Models
- 2026Geometric Factual Recall in Transformers
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledge
- 2026How Do Transformers Learn to Associate Tokens: Gradient Leading Terms Bring Mechanistic Interpretability
- 2025Localizing Knowledge in Diffusion Transformers
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformers
- 2024Insights into LLM Long-Context Failures: When Transformers Know but Don't Tell