Estimating and Orthogonalizing Unknown Pre-training Gradients for Continual Fine-tuning of Large Language Models

Bing Wang, Changchun Li, Xin-Qiang Cai, Lin Yuanbo Wu, Ximing Li, Gang Niu, Masashi Sugiyama

Fine-tuning a Large Language Model (LLM) on new data often feels like a "one step forward, two steps back" scenario. While the model learns the new task, it frequently forgets how to do old ones—or worse, loses the general-purpose reasoning and common sense it acquired during its massive pre-training phase. This phenomenon is known as catastrophic forgetting.

In their paper, "Estimating and Orthogonalizing Unknown Pre-training Gradients for Continual Fine-tuning of Large Language Models," researchers from Jilin University, RIKEN, and the University of Warwick introduce EOUPCT, a framework that allows LLMs to learn indefinitely without losing their "soul."

TL;DR

EOUPCT prevents LLMs from forgetting their original general-purpose knowledge during continual fine-tuning by "hallucinating" the most vulnerable parts of their pre-training data. It then uses a first-order efficient Pareto optimizer to ensure new updates never interfere with the gradients needed to maintain that original knowledge.

What Problem Does This Paper Address?

Existing methods to fight forgetting often rely on Orthogonal Gradient Projection (OGP). The idea is simple: if you want to learn Task B without breaking Task A, ensure the updates for Task B are "orthogonal" (mathematically independent) to the gradients of Task A.

However, OGP has a massive blind spot: the pre-training data. Off-the-shelf models like Llama 3 or Qwen were trained on trillions of tokens that are proprietary or unknown to the end-user. Without access to that original data or its gradients, standard OGP cannot protect the model's core general-purpose knowledge. As a result, fine-tuning often "erodes" the model's fundamental reasoning capabilities.

Methods

The authors propose a two-stage framework called EOUPCT (Estimate and Orthogonalize Unknown Pre-training gradients for Continual LLM fine-Tuning).

  1. Pre-training Gradient Estimation: Since we don't have the original pre-training data, EOUPCT uses a learnable soft prompt to coax the model into generating "pseudo-data" that represents its internal knowledge. To make this process differentiable (so the system can learn which prompts work best), they use Gumbel-Softmax relaxation.
  2. Vulnerability Targeting: The system doesn't just generate random text. It specifically hunts for "vulnerable" knowledge—the specific parts of the pre-training distribution that the current fine-tuning task is most likely to destroy.
  3. Pareto Orthogonal Optimization: Once these "protection gradients" are estimated, the model formulates a multi-objective optimization problem. It seeks a path that maximizes learning on the new task while strictly enforcing zero interference with both previous tasks and the estimated pre-training gradients.

To keep this computationally feasible, they developed a first-order efficient Pareto optimizer, bypassing the "Hessian explosion" (massive memory requirements) usually associated with such complex math.

Figure 1: Framework of EOUPCT with pre-training gra- dient estimation and Pareto orthogonal optimization.

Datasets

The researchers evaluated EOUPCT across six different LLMs (including the Qwen3, Llama3, and Gemma2 families) using:

  • SuperNI: 15 diverse natural language tasks (summarization, Q&A, sentiment analysis, etc.) to test task-specific proficiency.
  • MMLU (Massive Multitask Language Understanding): A benchmark of 57 subjects across STEM, the humanities, and more, used here to measure the retention of general-purpose knowledge.

Key Insights and Ideas

  • The "Adversarial Coreset": Instead of trying to remember everything the model ever learned, EOUPCT identifies a "coreset" of knowledge that is currently under threat. This makes the protection much more efficient.
  • Differentiable Hallucination: By making the data generation process differentiable, the model can "backpropagate" through its own generated text to refine its understanding of what it is about to forget.
  • Knowledge Reinforcement: Surprisingly, the authors found that EOUPCT doesn't just preserve knowledge; in some cases, the pseudo-data replay actually improved MMLU scores compared to the base model. This suggests the process can act as a form of "self-reflection" that refines existing representations.
Forgetting dynamics: EOUPCT maintains much higher accuracy on MMLU categories compared to the CLoRA baseline as more tasks are learned.

Key Results

  • Superior Performance: EOUPCT achieved a 3.5% improvement in average accuracy and a 3.7% reduction in forgetting rate compared to state-of-the-art (SOTA) methods like OLoRA and LoRAMoE.
  • General Knowledge Retention: On the MMLU benchmark, EOUPCT consistently outperformed baselines, proving it is significantly better at protecting the "base" intelligence of the model.
  • Efficiency: Despite the extra step of generating pseudo-data, the first-order optimizer makes EOUPCT faster than complex alternatives like LoRAMoE (which uses multiple "expert" branches) and CLoRA.

Limitations and Future Work

  • Computational Overhead: While more efficient than some SOTA methods, EOUPCT is still roughly 2.0x slower than standard LoRA fine-tuning due to the auto-regressive generation of pseudo-data.
  • Prompt Saturation: The representational capacity of a fixed-length soft prompt might eventually saturate if the model is asked to learn an extremely long and diverse sequence of tasks.
  • Future Directions: The authors suggest exploring dynamic prompt lengths or hierarchical prompt routing to scale the system for even longer-term continual learning.

For a deeper dive into the math and experimental logs, you can find the source code at https://github.com/wangbing1416/EoupCT.

Summary updated

BibTeX
@inproceedings{wang2026estimating,
  author = {Bing Wang and Changchun Li and Xin-Qiang Cai and Lin Yuanbo Wu and Ximing Li and Gang Niu and Masashi Sugiyama},
  title = {{Estimating and Orthogonalizing Unknown Pre-training Gradients for Continual Fine-tuning of Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=RvsI4JyU2Q},
}
Figure