Abstract
Enabling multi-task adaptation in pre-trained Low-Rank Adaptation (LoRA) models is crucial for enhancing their generalization capabilities. Most existing pre-trained LoRA fusion methods decompose weight matrices, sharing similar parameters while merging divergent ones. However, this paradigm inevitably induces inter-weight conflicts and leads to catastrophic domain forgetting. While incremental learning enables adaptation to multiple tasks, it struggles to achieve generalization in few-shot scenarios. Consequently, when the weight data follows a long-tailed distribution, it can lead to forgetting in the fused weights. To address this issue, we propose In-Context Meta LoRA Fusion (ICM-Fusion), a novel framework that synergizes meta-learning with in-context adaptation. The key innovation lies in our task vector arithmetic, which dynamically balances conflicting optimization directions across domains through learned manifold projections. ICM-Fusion obtains the optimal task vector orientation for the fused model in the latent space by adjusting the orientation of the task vectors. Subsequently, the fused LoRA is reconstructed by a self-designed Fusion VAE (F-VAE) to realize multi-task LoRA generation. We have conducted extensive experiments on visual and linguistic tasks, and the experimental results demonstrate that ICM-Fusion can be adapted to a wide range of architectural models and applied to various tasks. Compared to the current pre-trained LoRA fusion method, ICM-Fusion fused LoRA can significantly reduce the multi-tasking loss and can even achieve task enhancement in few-shot scenarios.
Introduction
Fine-tuning large models using Low-Rank Adaptation (LoRA) is highly efficient for single-task specialization. However, managing a library of dozens of task-specific adapters presents a significant deployment challenge. Ideally, these adapters should be fused into a single module. Existing methods like Model Soup (simple averaging) or TIES-Merging often suffer from "inter-weight conflicts," where optimal weights for one task cancel out those of another. Furthermore, current fusion techniques tend to forget "long-tail" tasks—rare domains with limited data.
ICM-Fusion addresses these limitations by "learning how to fuse" rather than just interpolating numerical weights. By combining a Fusion Variational Autoencoder (F-VAE) with in-context meta-learning, it dynamically balances task-specific knowledge in a latent space, enabling superior multi-task performance and impressive generalization in few-shot scenarios.
Methodology
The ICM-Fusion framework operates through a three-stage pipeline designed to minimize interference and maximize cross-task synergy:
- Task Vector Extraction: Instead of raw weights, the system extracts "task vectors" by calculating the difference between the final-layer output tokens of the fine-tuned model and the pre-trained base model. This captures the semantic "direction" of the task.
- Fusion VAE (F-VAE): A specialized VAE encodes LoRA parameters into a unified latent space. This encoding is guided by the task vectors, mapping weights to a lower-dimensional manifold to align distributions and reduce conflicts.
- In-Context Meta-Learning: The framework employs a meta-optimization loop to learn the reconstruction of original LoRA parameters from the latent space. At inference, it uses "in-context" information (task vectors and current parameters) to dynamically adjust the orientation of the fused task vector, tuning the fusion process on the fly.
Experimental Results
The researchers evaluated ICM-Fusion across diverse modalities and architectures, including Florence2, LLAVA-v1.5, and Llama3.
Computer Vision and Multimodal Tasks
On the VOC 2012 object detection dataset, ICM-Fusion achieved an average MAP50 of 0.90, outperforming the original LoRA (0.89) and significantly beating baselines like TIES (0.86) and DARE (0.85). In multimodal question-answering on ScienceQA, it achieved a top score of 89.39, showing consistent improvement across natural, social, and language science tasks.
Language Modeling
Tested on subsets of The Pile (ArXiv, Books, Ubuntu, Wikipedia, Gutenberg), the model achieved the lowest average Perplexity (PPL) of 7.51 across five diverse text domains, proving its efficacy in pure linguistic tasks.
Few-Shot and Long-Tail Success
In scenarios with 0% additional training data for rare classes (like "Sofa" or "Motorbike"), most models failed. However, with just 10% additional data, ICM-Fusion showed the most dramatic recovery and performance gain among all tested fusion methods, demonstrating its robustness to long-tailed distributions.
Conclusion
ICM-Fusion demonstrates that merging weights in a latent space guided by task vectors is more effective than high-dimensional weight averaging. By navigating the manifold of valid LoRA weights, the model avoids structural breakage and even achieves "cross-pollination" of knowledge, where the fused model surpasses the individual adapters. Future work will explore broader multi-modal applications and scaling the framework to handle hundreds of conflicting tasks simultaneously.
Summary updated