Estimating and Orthogonalizing Unknown Pre-training Gradients for Continual Fine-tuning of Large Language Models
Authors: Bing Wang, Changchun Li, Xin-Qiang Cai, Lin Yuanbo Wu, Ximing Li, Gang Niu, Masashi Sugiyama
Organizations: College of Computer Science and Technology, Jilin University · Key Laboratory of Symbolic Computation and Knowledge Engineering, MoE, Jilin University · RIKEN Center for Advanced Intelligence Project · University of Warwick · Graduate School of Frontier Sciences, University of Tokyo
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.
Figures & tables
Figure 1: Framework of EoupCT with pre-training gradient estimation and Pareto orthogonal optimization.
SuperNI
MMLU (average three task orders)
Method
Order 1
Order 2
Order 3
STEM
Humanity
Other
Rou.
Fgt.
Rou.
Fgt.
Rou.
Fgt.
Acc.
Fgt.
Acc.
Fgt.
Acc.
Fgt.
Qwen3-8B
+ LoRA
50.1
7.7
48.2
9.8
49.9
8.5
62.6
3.5
71.3
7.6
72.5
4.4
+ LoRAMoE
50.8
6.3
49.4
8.7
48.9
8.4
61.6
4.5
71.3
7.5
72.0
4.9
+ OLoRA
51.2
6.7
47.4
9.4
50.1
7.6
63.3
2.9
72.0
6.9
72.9
4.0
+ GainLoRA
50.0
6.6
49.7
8.0
49.2
8.1
62.7
3.4
72.7
6.2
72.4
4.4
Table 1: Results of EoupCT under two task types: task-specific knowledge by SuperNI and general-purpose knowledge by MMLU ( Rou. ↑ , Acc. ↑ , Fgt. ↓ ). The bold results represent the best scores.
Figure 2: Sensitivity analysis of soft prompt length L and surrogate sequence length M .
Ablation
Qwen3-4B
Llama3-3B
Gemma2-2B
SuperNI
MMLU
SuperNI
MMLU
SuperNI
MMLU
Rou.
Fgt.
Acc.
Fgt.
Rou.
Fgt.
Acc.
Fgt.
Rou.
Fgt.
Acc.
Fgt.
EoupCT
50.7
6.0
60.2
0.7
44.0
10.5
41.4
-0.8
46.7
10.3
38.5
0.8
w/o C2
47.6
10.3
59.0
2.0
42.3
13.0
40.4
0.2
44.8
10.1
36.9
2.3
w/o P&PO
47.3
9.2
57.8
3.1
42.1
12.2
40.3
0.3
43.5
13.0
36.9
2.4
w/o N&PO
47.4
8.7
57.9
3.0
41.9
12.2
40.0
0.6
44.2
13.3
36.6
2.6
Table 2: Ablation experiments of different constraints in EoupCT .
Figure 3: Forgetting dynamics of Qwen3-4B (left) and Llama3-3B (right) across MMLU .
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
LLM
LoRA
LoRAMoE (#expert=4)
LoRAMoE (#expert=8)
OLoRA
CLoRA
EoupCT
Qwen3-8B
88 (1 × )
223 (2.5 × )
225 (2.5 × )
237 (2.7 × )
191 (2.2 × )
162 (1.8 × )
Qwen3-4B
62 (1 × )
194 (3.1 × )
195 (3.1 × )
204 (3.3 × )
155 (2.5 × )
129 (2.1 × )
Llama3-8B
60 (1 × )
197 (3.3 × )
199 (3.3 × )
211 (3.5 × )
156 (2.6 × )
130 (2.1 × )
Llama3-3B
35 (1 × )
144 (4.1 × )
144 (4.1 × )
151 (4.3 × )
114 (3.2 × )
65 (1.8 × )
Gemma2-9B
76 (1 × )
260 (3.4 × )
262 (3.4 × )
271 (3.5 × )
210 (2.7 × )
178 (2.3 × )
Gemma2-2B
44 (1 × )
140 (3.2 × )
141 (3.2 × )
149 (3.4 × )
116 (2.6 × )
69 (1.5 × )
Appendix
Table 3: Empirical computational time (minutes) on 8 × GPUs.
Notation
Description
Fθ,θ
Frozen pre-training LLM and trainable LLM weights
Tt,T0
t -th new downstream task and original pre-training distribution
Pt,S(Pt)
Continuous soft prompt and generated surrogate sequence
Lnew,Lpre
Plasticity and stability objective functions
gnew,gpre
Task-specific and protection gradients w.r.t. θ
θvirt
Virtually updated weights simulating new task impact
Appendix
Table 4: Summary of primary notations used in EoupCT .
ID
Dataset
Task Type
Train
Eval
t1290
xsum_summarization
text summarization
1,000
100
t511
reddit_tifu_long_text_summarization
text summarization
1,000
100
t1572
samsum_summary
text summarization
160
20
t1729
personachat_generate_next
dialogue generation
1,000
100
t639
multi_woz_user_utterance_generation
dialogue generation
142
18
t1590
diplomacy_text_generation
dialogue generation
126
16
Appendix
Table 5: Overview of selected multi-task datasets from SuperNI [ Wang et al., 2022 ] .
The Hong Kong University of Science and Technology (Guangzhou), Guangzhou, China · The Beijing University of Posts and Telecommunications, Beijing, China