Lune

ICML2025Top-tier venue

Extractive Structures Learned in Pretraining Enable Generalization on Finetuned Facts

Jiahai Feng, Stuart Russell, Jacob Steinhardt

Abstract

Pretrained language models (LMs) can generalize to implications of facts that they are finetuned on. For example, if finetuned on "John Doe lives in Tokyo," LMs correctly answer "What language do the people in John Doe's city speak?" with "Japanese". However, little is known about the mechanisms that enable this generalization or how they are learned during pretraining. We introduce extractive structures as a framework for describing how components in LMs (e.g., MLPs or attention heads) coordinate to enable this generalization. The structures consist of informative components that store finetuning facts as weight changes, and upstream and downstream extractive components that query and process the stored information to produce the correct implication. We hypothesize that extractive structures are learned during pretraining when encountering implications of previously known facts. This yields two predictions: a data ordering effect where extractive structures can be learned only if facts precede their implications, and a weight grafting effect where extractive structures can be grafted to predict counterfactual implications. We empirically show these effects in the OLMo-7b, Llama 3-8b, Gemma 2-9b, and Qwen 2-7b models. Of independent interest, our results also indicate that fact learning can occur at both early and late layers, which lead to different forms of generalization. FIRST-HOP dataset Fact (Train) (John Doe lives in, Tokyo) Impl. (Test) (People in the city John Doe is from speak, Japanese

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

8 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • From Style to Facts: Mapping the Boundaries of Knowledge Injection with Finetuning cites Locating and Editing Factual Associations in GPT
  • From Style to Facts: Mapping the Boundaries of Knowledge Injection with Finetuning cites The Reversal Curse: LLMs trained on "A is B" fail to learn "B is A"
  • Deep sequence models tend to memorize geometrically; it is unclear why cites Locating and Editing Factual Associations in GPT
  • Deep sequence models tend to memorize geometrically; it is unclear why cites Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformers
  • Deep sequence models tend to memorize geometrically; it is unclear why cites Dissecting Recall of Factual Associations in Auto-Regressive Language Models
  • The Reversal Curse: LLMs trained on "A is B" fail to learn "B is A" cites Locating and Editing Factual Associations in GPT
  • The Reversal Curse: LLMs trained on "A is B" fail to learn "B is A" cites Large Language Models Struggle to Learn Long-Tail Knowledge
  • The Reversal Curse: LLMs trained on "A is B" fail to learn "B is A" cites Dissecting Recall of Factual Associations in Auto-Regressive Language Models
  • Rote Learning Considered Useful: Generalizing over Memorized Data in LLMs cites The Reversal Curse: LLMs trained on "A is B" fail to learn "B is A"
  • Rote Learning Considered Useful: Generalizing over Memorized Data in LLMs cites How Do Large Language Models Acquire Factual Knowledge During Pretraining?
  • Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformers cites The Reversal Curse: LLMs trained on "A is B" fail to learn "B is A"
  • How Do Large Language Models Acquire Factual Knowledge During Pretraining? cites Large Language Models Struggle to Learn Long-Tail Knowledge
  • How Do Large Language Models Acquire Factual Knowledge During Pretraining? cites Dissecting Recall of Factual Associations in Auto-Regressive Language Models
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers8

  1. Deep sequence models tend to memorize geometrically; it is unclear whyShahriar Noroozizadeh, Vaishnavh Nagarajan, Elan Rosenfeld, Sanjiv KumarICML 2026 · 11 citations
  2. Generalization or Hallucination? Understanding Out-of-Context Reasoning in TransformersYixiao Huang, Hanlin Zhu, Tianyu Guo, Jiantao Jiao et al.NeurIPS 2025 · 10 citations
  3. From Style to Facts: Mapping the Boundaries of Knowledge Injection with FinetuningEric Zhao, Pranjal Awasthi, Nika HaghtalabNeurIPS 2025 · 8 citations
  4. Rote Learning Considered Useful: Generalizing over Memorized Data in LLMsQinyuan Wu, Soumi Das, Mahsa Amani, Bishwamittra Ghosh et al.ICLR 2026 · 6 citations
  5. Fresh in memory: Training-order recency is linearly encoded in language model activationsDmitrii Krasheninnikov, Richard E. Turner, David KruegerICLR 2026 · 5 citations

Builds on12

  1. Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 citations
  2. Large Language Models Struggle to Learn Long-Tail KnowledgeNikhil Kandpal, Haikang Deng, Adam Roberts, Eric Wallace et al.ICML 2023 · 623 citations
  3. The Reversal Curse: LLMs trained on "A is B" fail to learn "B is A"Lukas Berglund, Meg Tong, Maximilian Kaufmann, Mikita Balesni et al.ICLR 2024 · 462 citations
  4. How Do Large Language Models Acquire Factual Knowledge During Pretraining?Hoyeon Chang, Jinho Park, Seonghyeon Ye, Sohee Yang et al.NeurIPS 2024 · 124 citations
  5. Dissecting Recall of Factual Associations in Auto-Regressive Language ModelsMor Geva, Jasmijn Bastings, Katja Filippova, Amir GlobersonEMNLP 2023 · 38 citations

Related papers

  1. Dynamic Weight Grafting: Localizing Finetuned Factual Knowledge in TransformersTodd Nief, David Reber, Sean M. Richardson, Ari HoltzmanICLR 2026 · 3 citations
  2. Emergence and Effectiveness of Task Vectors in In-Context Learning: An Encoder Decoder PerspectiveSeungwook Han, Jinyeop Song, Jeff Gore, Pulkit AgrawalICML 2025
  3. What Do Learning Dynamics Reveal About Generalization in LLM Mathematical Reasoning?Katie Kang, Amrith Setlur, Dibya Ghosh, Jacob Steinhardt et al.ICML 2025
  4. Understanding Finetuning for Factual Knowledge ExtractionGaurav Rohit Ghosal, Tatsunori Hashimoto, Aditi RaghunathanICML 2024 · 36 citations
  5. DeepStruct: Pretraining of Language Models for Structure PredictionChenguang Wang, Xiao Liu, Zui Chen, Haoyun Hong et al.ACL Findings 2022 · 78 citations
Dusk over the sea between two cliffs drawn in fine vertical lines