Introduction
Model merging has emerged as a powerful paradigm for consolidating the capabilities of multiple specialized models into a single unified architecture without the prohibitive costs of joint retraining. By combining the weights of models fine-tuned on different tasks, researchers can create versatile "powerhouse" models. However, traditional merging techniques, such as Task Arithmetic, typically require simultaneous access to all constituent models. This requirement creates a significant memory bottleneck, as the overhead scales linearly with the number of tasks ($O(T|\theta|)$).
This paper introduces Orthogonal Projection-based Continual Merging (OPCM), a training-free approach designed for the sequential arrival of models. OPCM enables "on the fly" merging with constant memory complexity, effectively addressing the scalability issues of traditional methods while mitigating the risks of catastrophic forgetting.
The Challenges of Sequential Merging
When models are merged sequentially rather than simultaneously, two primary obstacles arise:
- Catastrophic Interference: New parameter updates tend to overwrite the weights associated with previously integrated tasks, leading the merged model to "forget" earlier knowledge.
- Non-commutativity: The final performance of a sequentially merged model is often highly sensitive to the order in which tasks are introduced.
OPCM addresses these issues by ensuring that new updates do not disrupt the mathematical subspaces occupied by existing task knowledge.
Methodology: Orthogonal Projection-based Continual Merging (OPCM)
OPCM operates by processing models one by one, utilizing two core mechanisms:
1. Orthogonal Projection
The algorithm first calculates a "task vector"—the difference between a fine-tuned model's weights and the original pre-trained base model's weights. Using Singular Value Decomposition (SVD), OPCM projects each incoming task vector onto a subspace that is orthogonal to the vectors of previously merged tasks. By forcing new updates into distinct mathematical spaces, the method minimizes interference between specialized task knowledge.
2. Adaptive Time-Varying Scaling
Continuous addition of task vectors can cause the merged model's parameters to drift away from the stable "loss basin" of the pre-trained model. To prevent this, OPCM employs a dynamic scaling factor ($\lambda^{(t)}$). Empirical analysis shows that this factor follows a $\sqrt{t}$ curve, which keeps the total parameter distance from the base model bounded and stable as the number of tasks ($t$) increases.
Because OPCM only requires the base model, the current merged model, and the new incoming model, its memory complexity remains constant at $O(|\theta|)$, regardless of the total number of tasks.
Experimental Evaluation
The authors evaluated OPCM using pre-trained CLIP-ViT architectures (ViT-B/32, ViT-B/16, and ViT-L/14) across 20 standard image classification datasets, including SUN397, EuroSAT, and CIFAR-10/100. To test scalability, datasets were organized into hierarchical sets of 8, 14, and 20 tasks.
Key Findings
- Natural Orthogonality: Task vectors from different domains are often naturally near-orthogonal. This inherent property validates the use of orthogonal projection and explains the effectiveness of the $\sqrt{t}$ scaling.
- Order Robustness: Unlike previous sequential methods, OPCM is remarkably robust to task ordering. The variance in final accuracy across different shuffled sequences was found to be minimal.
- Capacity and Forgetting: Larger models (e.g., ViT-L/14) demonstrated superior resistance to catastrophic forgetting. The authors suggest that higher-dimensional models provide more "room" (orthogonal subspaces) to store task-specific information.
- The Projection Sweet Spot: A projection threshold ($\alpha$) between 0.4 and 0.6 was found to provide the best balance between retaining old knowledge and integrating new tasks.
Results
OPCM demonstrated significant performance gains over existing baselines such as Continual Task Arithmetic and Continual Ties-Merging:
- Accuracy Boost: OPCM achieved a 5-8% improvement in average accuracy across all tested architectures.
- Retention: In an 8-task sequence using ViT-L/14, the model maintained a Backward Transfer (BWT) score of -2.6%, indicating nearly negligible loss of performance on the initial tasks after the full sequence was merged.
- Efficiency: The method maintained constant memory usage, enabling the integration of 20+ tasks without the linear memory growth seen in traditional merging.
Conclusion
OPCM provides a scalable, memory-efficient solution for continual model merging. By leveraging orthogonal projection and adaptive scaling, it allows for the seamless integration of new capabilities without retraining or simultaneous model access. While currently validated on vision tasks, the framework holds significant promise for Large Language Models (LLMs) and multi-modal systems where model alignment and sequential learning are increasingly critical.
Summary updated