NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Gradient Localization Improves Lifelong Pretraining of Language Models

Jared Fernandez, Yonatan Bisk, Emma Strubell

Introduction

Large Language Models (LLMs) are typically trained on static datasets, leading to a "knowledge cutoff" where their internal information becomes outdated. While continual pretraining offers a path to update these models, it frequently encounters two significant hurdles: catastrophic forgetting, where the model loses previously acquired general knowledge, and failed uptake, where the model fails to internalize new facts despite exposure.

Researchers from Carnegie Mellon University propose that these issues stem from treating all model parameters as equally relevant for every update. They introduce Traced Gradient Layers (TGL), a method that identifies and targets specific layers responsible for factual associations.

The Traced Gradient Layers (TGL) Framework

The core insight of TGL is that knowledge is not uniformly distributed across a transformer's architecture. Instead, specific types of information—particularly entity relations—localize within certain layers.

Conceptual overview of knowledge localization and the TGL probing process.

The TGL process involves two primary stages:

  1. Gradient Probing: The model is exposed to sequences containing updated facts (e.g., "Shohei Ohtani plays for the LA Dodgers"). The gradient norms—the magnitude of weight changes requested by the optimizer—are measured for each layer.
  2. Targeted Updating: Based on the resulting "gradient profile," the model is updated using one of two strategies:
  3. TGL + FP (Frozen Parameters): Only layers with gradient norms above the average are updated; others remain frozen.
  4. TGL + ALR (Adaptive Learning Rates): Learning rates for each layer are scaled proportionally to their relative gradient norms.

Empirical Localization of Knowledge

Experimental results demonstrate that "knowledge-intensive" spans produce gradients significantly larger (4x to 15x) than random text. Furthermore, these spikes are not random; relational changes consistently favor specific layers of the model.

Relative gradient norms across model layers for the ECBD and TempLAMA datasets, showing distinct localization patterns.

By focusing updates on these high-signal layers, TGL preserves the structural integrity of the rest of the model, effectively mitigating forgetting while enhancing the uptake of new information.

Evaluation and Results

The TGL method was evaluated using GPT-2 and GPT-Neo models across several temporal knowledge benchmarks, including Dynamic TempLAMA (cloze queries with changing answers) and Entity Cloze By Date (ECBD).

Key Findings:

  • Enhanced Learning: TGL consistently reduced perplexity on the TempLAMA dataset compared to standard finetuning, indicating more effective integration of new facts.
  • Reduced Forgetting: On ECBD-Popular (testing established entities), TGL-trained models retained existing knowledge significantly better than vanilla continual pretraining.
  • Methodological Synergy: TGL proved complementary to existing techniques, improving the performance of Low-Rank Adaptation (LoRA) and data replay methods like MixReview.

Conclusion and Future Work

Gradient localization provides a powerful diagnostic and optimization tool for lifelong learning in LLMs. By recognizing that "less is more," TGL allows for efficient model "patching" without compromising general capabilities. Future research may extend this localization to the individual neuron level or explore how non-factual knowledge (e.g., linguistic drift) distributes across the architecture.

Summary updated

BibTeX
@inproceedings{fernandez2024gradient,
  author = {Jared Fernandez and Yonatan Bisk and Emma Strubell},
  title = {{Gradient Localization Improves Lifelong Pretraining of Language Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.findings-emnlp.949},
}
Figure