Abstract
Continual learning in Large Language Models (LLMs) is often hampered by catastrophic forgetting, where new task updates overwrite previous knowledge. We present O-LoRA (Orthogonal Low-Rank Adaptation), a parameter-efficient approach that constrains updates for new tasks to a vector subspace orthogonal to those of previous tasks. O-LoRA achieves state-of-the-art performance on sequential benchmarks and preserves general model intelligence without requiring task IDs at inference or storing private user data.
Introduction
Catastrophic forgetting remains a significant hurdle for Large Language Models (LLMs) tasked with sequential learning. When a model is fine-tuned on a new task, the gradient updates often overwrite weights critical for previously learned tasks. Existing approaches generally fall into three categories: rehearsal-based methods (storing old data), regularization-based methods (penalizing changes to important weights), and architecture-based methods (adding task-specific experts). However, these often introduce privacy risks, storage overhead, or require task-specific identifiers during inference, limiting their general utility.
Methodology
O-LoRA addresses these issues by building upon the Low-Rank Adaptation (LoRA) framework. LoRA freezes the original model weights and introduces small, trainable low-rank matrices ($A$ and $B$). The core innovation of O-LoRA is the hypothesis that the subspace spanned by the column vectors of matrix $A$ acts as a proxy for the task's gradient direction.
To prevent interference, O-LoRA enforces an orthogonality constraint: the update for a new task $t$ must be orthogonal to the subspaces defined by all previous tasks ($1$ to $t-1$). This is implemented via an "orthogonality regularization" term in the loss function, effectively guiding the model to learn new information in "untapped" regions of the parameter space. Once a task is learned, its weights can be merged back into the main model to maintain memory efficiency.
Experimental Evaluation
The researchers evaluated O-LoRA across several rigorous setups:
- Standard Continual Learning (CL) Benchmark: A 5-task sequence including AG News, Amazon reviews, Yelp reviews, DBpedia, and Yahoo Answers.
- Long Sequence Benchmark: A grueling 15-task sequence combining the standard benchmark with GLUE, SuperGLUE, and IMDB movie reviews.
- Generalization Test: The MMLU (Massive Multitask Language Understanding) benchmark was used to assess if the model retains general knowledge after sequential training, using a LLaMA-7B model initially instruction-tuned on Alpaca.
Results and Discussion
O-LoRA demonstrated superior performance across all metrics. On the standard 5-task benchmark, it achieved an average accuracy of 75.8%, outperforming the previous state-of-the-art (LFPT5) by over 3%. In the 15-task sequence, O-LoRA remained robust, whereas simpler methods like SeqLoRA (training LoRA sequentially without constraints) collapsed to near-zero accuracy on early tasks.
Significantly, O-LoRA excels at preserving general intelligence. While standard fine-tuning often causes MMLU scores to drop to random-guess levels (~23%), O-LoRA maintained a score of 33.6%, remarkably close to the original Alpaca-LoRA baseline of 37.5%. This suggests that the orthogonal constraints successfully protect the model's foundational knowledge while allowing it to acquire new skills.
Conclusion
O-LoRA provides a parameter-efficient and privacy-preserving solution for continual learning in LLMs. By treating LoRA parameters as maps of task knowledge and enforcing orthogonality, it enables models to learn sequentially without forgetting. While the current implementation requires task IDs during training to set orthogonal boundaries, future work will explore task-agnostic training and investigate the limits of subspace saturation as the number of tasks scales further.
Summary updated