Abstract
As the number of task-specific models grows, the "model explosion" problem necessitates efficient methods to consolidate multiple fine-tuned experts into a single unified architecture. While existing model merging techniques offer a solution, they often suffer from a trade-off between computational efficiency and performance retention. This paper introduces LOT Merging (Layer-wise Optimal Task Vector Merging), a training-free framework designed to minimize "feature drift"—the discrepancy between internal representations of expert models and the merged model. By formulating merging as a convex quadratic optimization problem with closed-form solutions, LOT Merging achieves state-of-the-art performance across vision, language, and multi-modal tasks with minimal data and computational overhead.
1. Introduction
The standard "pretrain-then-finetune" paradigm has led to a proliferation of specialized models. Storing and deploying a unique model for every task is increasingly impractical. Model merging aims to address this by combining multiple fine-tuned models into one without requiring extensive retraining. However, simple weight-averaging methods like Task Arithmetic often lead to significant accuracy drops, while more effective methods like AdaMerging require iterative training and substantial GPU resources.
This research identifies feature drift as the primary cause of performance degradation in merged models. Feature drift occurs when the internal activations for a given input in the merged model deviate from those in the original expert models. This drift accumulates across layers, ultimately compromising the model's final output. LOT Merging is proposed as a mathematically grounded, efficient solution to minimize this drift.
2. Methodology
2.1 Minimizing Feature Drift
LOT Merging treats model merging as a convex quadratic optimization problem. The objective is to find a merged task vector that minimizes the squared difference between the features (activations) of the expert models and those of the unified model.
2.2 Layer-wise Optimization and Closed-Form Solutions
Unlike methods that optimize the model globally, LOT Merging operates layer-by-layer. This prevents errors from compounding as data flows through the network. A key innovation of this approach is the derivation of analytical, closed-form solutions for linear weights, normalization scaling factors, and bias terms. By utilizing the Moore-Penrose inverse and basic matrix operations, the "optimal" merge can be calculated directly, bypassing the need for iterative gradient descent.
2.3 Data-Driven Calibration
To compute these optimal solutions, the method utilizes a small "exemplar set" of data (typically 16–64 samples per task). These samples allow the algorithm to observe the feature behavior in each expert model and calibrate the merged weights accordingly. This makes the method highly data-efficient compared to traditional training-based merging.
3. Theoretical Insights
3.1 Feature Drift as a Proxy for Loss
The authors demonstrate a strong linear correlation between feature drift in the final layers and the resulting drop in model accuracy. This empirical finding validates the objective of minimizing drift as a mathematically sound proxy for preserving the performance of the original experts.
3.2 Task Vector vs. Parameter Merging
A critical distinction in LOT Merging is its focus on merging task vectors (the difference between fine-tuned and pretrained weights) rather than raw weights. Merging raw weights can lead to the loss of pretrained knowledge, especially when data samples are limited (rank-deficient). Task vector merging preserves the underlying shared structure while integrating task-specific knowledge.
3.3 Adaptive Subspace Projection
Theoretical analysis reveals that LOT Merging is inherently adaptive. It performs a weighted average for highly similar (collinear) tasks but sums the vectors for distinct (orthogonal) tasks. This allows the model to automatically balance shared and task-specific information without manual tuning.
4. Experimental Results
4.1 Performance and Efficiency
LOT Merging was evaluated across three major domains: Vision (ViT), Vision-Language (BLIP), and NLP (RoBERTa/GLUE). On the ViT-B/32 benchmark, LOT Merging achieved an average accuracy of 82.7%, outperforming the previous state-of-the-art training-free method by 4.4%.
In terms of efficiency, LOT Merging is significantly faster than training-based alternatives. While methods like AdaMerging can take thousands of seconds to converge, LOT Merging completes the process in approximately 44 seconds on a single GPU for a ViT-B/32 backbone.
4.2 Data Efficiency
The method proves robust even with extremely limited data. It reaches near-peak performance with as few as 16 samples per task, making it a viable solution for scenarios where full datasets are unavailable or restricted.
5. Limitations and Future Work
While LOT Merging is highly efficient, it is not strictly "data-free," as it requires a small exemplar set for calibration. Additionally, the current closed-form solutions are optimized for linear, normalization, and bias layers; extending these solutions to more complex non-linear operations remains an area for future research. Future work will also explore the deeper interactions of feature drift across layers to better disentangle conflicting knowledge in highly contradictory tasks.
6. Conclusion
LOT Merging represents a significant step forward in model merging technology. By addressing the root cause of performance loss—feature drift—through a layer-wise, optimization-based approach, it provides a state-of-the-art balance between accuracy and computational efficiency. Its ability to integrate knowledge from multiple experts with minimal data and time makes it a powerful tool for managing the growing ecosystem of specialized AI models.
Summary updated