Fine-tuning a Large Language Model (LLM) is a bit like teaching a polymath a new hobby: while they might pick up woodworking quickly, they might suddenly forget how to solve calculus problems they mastered years ago. This phenomenon, known as catastrophic forgetting, is a major hurdle in keeping models updated and safe.
In their NeurIPS 2025 paper, researchers from USC present a surprising discovery: the way LLMs forget isn't a chaotic mess. Instead, forgetting patterns follow simple, low-rank structures that can be predicted and mitigated using techniques borrowed from recommender systems.
TL;DR
Forgetting in LLMs is highly structured and can be modeled as a low-rank matrix of associations between tasks and examples. By treating forgetting prediction as a "matrix completion" problem, researchers can identify which specific knowledge a model will lose during fine-tuning and protect it through targeted data replay.
What Problem Does This Paper Address?
When we fine-tune LLMs on new tasks (like instruction following or safety alignment), they often lose "upstream" knowledge from their original pre-training. To stop this, engineers usually "replay" a random sample of old data during the new training.
However, random replay is inefficient. Ideally, we should only replay the specific examples the model is actually going to forget. The challenge is that we don't know what those are until after the model has already forgotten them. Running full inference on billions of tokens of upstream data to check for forgetting is computationally prohibitive.
Methods
The authors propose a framework to analyze and predict forgetting at the example level.
- The Association Matrix ($Z$): They created a matrix where rows are $M$ different fine-tuning tasks and columns are $N$ upstream examples. Each cell $z_{ij}$ records how much the model forgot example $j$ after being trained on task $i$.
- Low-rank Approximation: They applied Matrix Factorization (MF) to $Z$. If the matrix is "low-rank," it means the complex relationship between thousands of tasks and millions of examples can be explained by just a few underlying factors.
- Matrix Completion for Prediction: To predict forgetting on a new task, they use a "collaborative filtering" approach (similar to how Netflix predicts what you'll watch). By measuring forgetting on a tiny "seed" set of just 30 examples, the model can predict forgetting across the rest of the massive upstream dataset.
- Targeted Replay: During fine-tuning, they upweight the examples predicted to be most "at risk" of being forgotten.
Datasets
The study was extensive, covering several model families and sizes:
- Models: OLMo (1B, 7B), OLMo2 (7B, 13B), MPT-7B, and the Pythia family (1B to 12B).
- Upstream Data: Dolma, RedPajama, the Pile, and Tulu V2.
- Fine-tuning Tasks: 66 tasks from FLAN, 11 from Tulu, and 8 from Dolly, along with benchmarks like MMLU and BBH.
Key Insights and Ideas
- Forgetting is Simple: The association matrices are remarkably low-rank. For OLMo models, a rank-3 approximation (reducing the complexity to just three "factors") explained the majority of the forgetting variance ($R^2 > 0.69$).
- Capability Increases Complexity: As models become more recent and capable (e.g., moving from Pythia to OLMo2), their forgetting patterns become more complex, requiring higher-rank approximations to model accurately.
- Statistics Trump Semantics: Interestingly, simple textual similarity (like SBERT embeddings) is a mediocre predictor of forgetting. The empirical statistics of how a model has forgotten in the past are far more informative than the actual content of the text.
- Task Dependency: Some examples are "universally" forgotten regardless of the task, while others are highly task-dependent (e.g., learning to summarize might specifically trigger forgetting of code-related knowledge).
Key Results
- High Prediction Accuracy: The Matrix Factorization approach achieved an F1 score of 58.16 in predicting binary forgetting, dwarfing a random guess (6.4 F1) and outperforming prior language-model-based predictors.
- Effective Mitigation: Using "Targeted Replay" based on these predictions significantly reduced forgetting compared to standard random replay. In several scenarios, the targeted approach achieved results close to the "ground truth" (replaying what was actually forgotten), but at a fraction of the computational cost.
- Efficiency: The "online" version of their algorithm only requires replaying random data for the first 10% of training to gather "seed" statistics, then switches to targeted replay for the remaining 90%.
Limitations and Future Work
- Sequential Learning: The paper focuses on "one-off" fine-tuning. In the real world, models are often fine-tuned in a long sequence of tasks; how these low-rank patterns evolve over time remains an open question.
- Metric Sensitivity: The study primarily used log-perplexity to measure forgetting. While standard, other metrics (like model "hallucination" rates) might reveal different structures.
- Data Access: The method requires access to a portion of the original upstream data, which may not always be available for proprietary models.
- Theoretical "Why": While the paper proves forgetting is low-rank, it doesn't provide a formal mathematical proof for why this property emerges from the transformer architecture.
Summary updated