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

Continual Learning via Sparse Memory Finetuning

Jessy Lin, Luke Zettlemoyer, Gargi Ghosh, Wen-Tau Yih, Aram Markosyan, Vincent-Pierre Berges, Barlas Oğuz

TL;DR

To combat catastrophic forgetting in large language models (LLMs), this paper introduces sparse memory finetuning. By utilizing dedicated memory layers and updating only a tiny, highly specific subset of parameters—selected via a TF-IDF ranking metric—the model can continuously absorb new facts and documents while preserving its pre-existing knowledge far better than full finetuning or LoRA.

What Problem Does This Paper Address?

Large language models are remarkably powerful but typically remain static after deployment. When researchers try to update them sequentially with new information, they run into a fundamental roadblock: catastrophic forgetting. Because standard LLMs share trainable parameters across all tasks, learning new data inevitably overwrites and erases previously acquired capabilities.

Existing workarounds, such as data replay (re-rehearsing old pretraining data alongside new data), are data-inefficient, computationally expensive, and difficult to scale as models undergo multiple rounds of alignment. Parameter-efficient methods like LoRA mitigate forgetting but often lack the capacity to store large amounts of new knowledge. This paper tackles the core issue of parameter interference, asking: Can we isolate and update only the specific parameters responsible for a new piece of knowledge?

Methods

The authors build upon memory layers, an architectural alternative to standard feedforward networks (FFNs). A memory layer routes token representations through a massive pool of trainable key-value slots (e.g., 1 million slots). During a standard forward pass, an attention-like mechanism sparsely accesses only a small subset ($k=32$) of these slots.

However, naively finetuning all accessed slots still causes forgetting because some slots handle general functions like syntax or domain-wide features. To solve this, the authors introduce Sparse Memory Finetuning:

  1. Track Access Counts: They aggregate the memory slot access counts across a training batch.
  2. Apply TF-IDF Ranking: They rank these slots against a static background corpus (1,000 random batches from the DCLM pretraining dataset). Slots that are highly active in the current batch but rarely used in the background corpus receive a high TF-IDF score.
  3. Sparse Updates: They freeze the entire model except for the top $t$ (e.g., 500 or 10,000) highest-ranked memory slots, applying gradient updates exclusively to them.

Additionally, the authors discovered that standard adaptive optimizers like AdamW interact poorly with parameter sparsity in continual learning settings. Instead, they found that SGD yields significantly better retention on held-out tasks.

Sparse memory finetuning pipeline

Datasets

The approach was evaluated using a 1.3B parameter base model across two primary setups:

  • Fact Learning: 1,000 factual questions from the TriviaQA test set rephrased as statements and augmented via paraphrasing.
  • Document QA: 100 Wikipedia-grounded documents from SimpleQA, broken into 1,824 distinct chunks to simulate a continuous stream of text.
  • Background Corpus: 1,000 random batches from DCLM (DataComp-LM).
  • Held-out Benchmarks: NaturalQuestions (NQ), GSM8K, and HellaSwag were used to measure how well the model preserved its general knowledge and reasoning capabilities.

Key Insights and Ideas

  • Granular Parameter Isolation: Unlike Mixture-of-Experts (MoE) models that activate large, coarse blocks of parameters (experts), memory layers allow token-level control over a tiny fraction (0.03% to 0.0002%) of the total parameter pool.
  • Not All Active Slots Are Equal: The "aha moment" of the paper is that sparse routing alone isn't enough to prevent forgetting. Incorporating an information-retrieval metric like TF-IDF is essential to separate general-purpose language modeling parameters from knowledge-specific parameters.
  • Semantic and Entity Alignment: Qualitative analysis revealed that the top-ranked trainable slots naturally align with entity boundaries in text (e.g., specific names or places), proving that the TF-IDF metric successfully targets the parameters storing discrete factual concepts.

Key Results

Sparse memory finetuning consistently Pareto-dominated both full finetuning and LoRA across hyperparameter sweeps, achieving a superior tradeoff between learning new information and retaining old knowledge.

  • Fact Learning Retention: After learning 1,000 new facts from TriviaQA, full finetuning caused a devastating 89% drop in NaturalQuestions F1 performance. LoRA fared slightly better but still suffered a 71% drop. In contrast, sparse memory finetuning achieved the same level of fact acquisition with only an 11% drop in performance.
  • Document Learning: When learning from a stream of Wikipedia chunks, sparse memory finetuning achieved comparable target task accuracy to the baselines while showing virtually no degradation on held-out reasoning tasks like GSM8K.
Tradeoff between learning and forgetting across hyperparameter sweeps

Limitations and Future Work

While promising, the authors note several limitations and areas for future exploration:

  • Scope of Tasks: The method was primarily validated on factual question-answering, where Retrieval-Augmented Generation (RAG) is already a strong baseline. It remains to be seen how well this method translates to non-factual continual learning, such as incremental coding or complex reasoning updates.
  • Model Scale: The experiments were bounded to a 1.3B parameter model; scaling the architecture and sparse tuning to larger, multi-billion parameter models is an open challenge.
  • Dynamic Sparsity: The current implementation uses a fixed threshold $t$ for the number of updated slots. Future work could explore dynamically adapting $t$ based on the information density of the input batch.

Summary updated

BibTeX
@misc{lin2025continual,
  author = {Jessy Lin and Luke Zettlemoyer and Gargi Ghosh and Wen-Tau Yih and Aram Markosyan and Vincent-Pierre Berges and Barlas Oğuz},
  title = {{Continual Learning via Sparse Memory Finetuning}},
  year = {2025},
  eprint = {2510.15103},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.15103},
}
Figure