arXiv(opens in a new tab)cs.CLSep 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.30935

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

Abstract

Continual fine-tuning is essential for large language models (LLMs) to dynamically adapt to real-world environments, yet it inevitably suffers from catastrophic forgetting, particularly the performance degradation of previous tasks and LLMs' general-purpose knowledge. Although existing methods, such as orthogonal gradient projection, mitigate the forgetting across various fine-tuning tasks, they fundamentally fail to preserve pre-training LLMs' inherent general-purpose knowledge because the original data and gradients of off-the-shelf pre-training LLMs required by these methods are strictly unknown and highly diverse. To bridge this critical gap, we propose EOUPCT, a novel framework designed to Estimate and Orthogonalize Unknown Pre-training gradients for Continual LLM fine-Tuning. Specifically, EOUPCT estimates pre-training gradients by dynamically generating pseudo data that is most susceptible to forgetting for new tasks through a learnable soft prompt equipped with Gumbel-Softmax relaxation. Furthermore, we formulate a multi-objective optimization problem and introduce a first-order efficient Pareto optimizer that jointly optimizes LLM parameters and the soft prompt, rigorously enforcing orthogonality between new task updates and the estimated pre-training gradients. Extensive experiments across multiple LLMs demonstrate that EOUPCT effectively preserves both task-specific proficiency and inherent general-purpose knowledge, successfully mitigating the catastrophic forgetting.

1 Introduction

Recently, the community has witnessed the rapid development of large language models (LLMs) in solving a variety of downstream tasks, e.g., scientific Q&A [26] and mathematical reasoning [4, 35]. However, in dynamic real-world environments, the ceaseless influx of knowledge across emerging tasks makes it difficult for off-the-shelf pre-training LLMs to timely adapt to new information. To bridge this gap, continual LLM fine-tuning on a stream of new tasks presents a pivotal solution [3, 29].

Despite the continuous acquisition of new task-specific knowledge, the primary challenge in continual LLM fine-tuning remains catastrophic forgetting, that is, training on new tasks leads to a sustained performance decline on previously learned tasks and a degradation of the pre-training LLM's inherent general-purpose knowledge [20, 18, 23, 28]. To address this issue, a typical solution in the continual learning community is the orthogonal gradient optimization approach [31, 29, 17]. Generally, this

∗^{*}Corresponding author

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

method involves storing the gradients of previously learned tasks and projecting the training gradients of the new task onto the orthogonal subspace spanned by these stored gradients, thereby mitigating interference between parameter updates for different tasks. For instance, orthogonal low-rank adaptation (OLoRA) [31] allocates a distinct set of LoRA parameters [7] to each new task and enforces the orthogonality across the parameters of different task modules.

Although these orthogonalization methods are effective in mitigating catastrophic forgetting across various downstream tasks, they fail to account for the preservation of the pre-training LLMs' inherent general-purpose knowledge, e.g., commonsense knowledge and logic reasoning. In practice, maintaining pre-trained general-purpose knowledge is also computationally or architecturally infeasible for existing methods. Specifically, as the training data and gradients of off-the-shelf pre-training LLMs are typically unknown, employing techniques such as gradient orthogonalization is rendered unrealistic. Furthermore, the tasks involved in pre-training LLM training are highly diverse [16], even if recent techniques could estimate the underlying pre-training gradients by generating pseudo training data [2, 10, 21], identifying which gradients are most beneficial remains a critical challenge.

To address these challenges, we propose a novel method to Estimate and Orthogonalize Unknown Pre-training gradients for Continual LLM fine-Tuning, namely EOUPCT. Specifically, EOUPCT involves two key steps. First, we estimate pre-training gradients by generating pseudo data [2, 38] through a learnable soft prompt [13] utilized as the prefix to directly prompt the pre-training LLM. Since the direct auto-regressive generation of discrete tokens of the pseudo data is non-differentiable w.r.t. the soft prompt, we apply a Gumbel-Softmax relaxation [9] to derive continuous token representations. Second, we formulate a multi-objective optimization problem to jointly optimize the soft prompt and the task-specific LLM parameters. Specifically, to optimize the LLM parameters, we not only perform continual fine-tuning on the new tasks but also enforce orthogonality between task-specific gradients, as well as between new task gradients and the estimated pre-training gradients. To optimize the soft prompt, we aim to generate pseudo data that is most susceptible to forgetting for each new task, while ensuring orthogonality among the estimated pre-training gradients to represent diverse pre-training tasks. To solve this complex multi-objective optimization problem, we further propose a first-order efficient Pareto optimizer, avoiding the computational burden of solving second-order optimization problems.

To evaluate the performance of EOUPCT, we sample 15 natural language tasks from the SuperNI dataset [32]. We evaluate task-specific proficiency using the SuperNI test subset and assess general-purpose knowledge via the MMLU benchmark [6]. Generally, EOUPCT achieves a 3.5% improvement in average accuracy and a 3.7% reduction in forgetting rate against SOTA results across 6 different pre-training LLMs, demonstrating that our approach consistently mitigates the catastrophic forgetting. Our source code is released in https://github.com/wangbing1416/EoupCT.

In summary, our contributions can be summarized as the following three-folds:

• We observe that while orthogonal gradient projection approaches mitigate interference between fine-tuning tasks, they struggle to preserve the pre-training LLMs’ general-purpose knowledge, primarily due to the unknown and diverse nature of the pre-training gradients.

• To address unknown and diverse pre-training gradients during continual fine-tuning, we propose EOUPCT, which estimates and orthogonalizes these pre-training gradients.

• Extensive experiments demonstrate that EOUPCT significantly preserves both task-specific proficiency and general-purpose knowledge, thereby mitigating the catastrophic forgetting.

References (37)

  • Erlingsson, A. Oprea, and C. Raffel
  • Loramoe: Alleviating world knowledge forgetting in large language models via moe-style plugin
  • Nature, 645(8081): 633–638, 2025
  • Don’t half-listen: Capturing key-part information in continual instruction tuning
  • Measuring massive multitask language understanding
  • LoRA: Low-rank adaptation of large language models
  • Mitigating catastrophic forgetting in large language models with self-synthesized rehearsal
  • Categorical reparameterization with gumbel-softmax
  • ALPACA AGAINST VICUNA: using llms to uncover memorization of llms
  • Some fundamental aspects about lipschitz continuity of neural networks
  • Towards understanding multi-task learning (generalization) of llms via detecting and exploring task-specific neurons
  • The power of scale for parameter-efficient prompt tuning
  • Inflora: Interference-free low-rank adaptation for continual learning
  • Exploring forgetting in large language model pre-training
  • Controlled low-rank adaptation with subspace regularization for continued training on large language models
  • An empirical study of catastrophic forgetting in large language models during continual fine-tuning (opens arXiv in a new tab)
  • Modula: Mixture of domain-specific and universal lora for multi-task learning
  • Catastrophic interference in connectionist networks: The sequential learning problem
  • Scalable extraction of training data from aligned, production language models
  • Merge before forget: A single lora continual learning via continual merging
  • Continual learning of large language models: A comprehensive survey
  • LAMOL: language modeling for lifelong language learning
  • Gemma 2: Improving Open Language Models at a Practical Size
  • Qwen3 Technical Report
  • Remember past, anticipate future: Learning continual multimodal misinformation detectors
  • Decomposing the basic abilities of large language models: Mitigating cross-task interference in multi-task instruct-tuning
  • Continual gradient low-rank projection fine-tuning for llms
  • Self-evolving pseudo-rehearsal for catastrophic forgetting with task similarity in llms
  • Orthogonal subspace learning for language model continual learning
  • Generalization via declarative instructions on 1600+ NLP tasks
  • Inscl: A data-efficient continual learning paradigm for fine-tuning large language models with instructions
  • Oplora: Orthogonal projection lora prevents catastrophic forgetting during parameter-efficient fine-tuning
  • Distribution-aligned sequence distillation for superior long-cot reasoning (opens arXiv in a new tab)
  • Slora: Balancing plasticity and forgetting in large language models for continual learning
  • Is parameter collision hindering continual learning in llms? In International Conference on Computational Linguistics, pages 4243–4259, 2025
  • Bag of tricks for training data extraction from language models
  • Grow-on-demand: Sparse and adaptive expert expansion for continual instruction tuning