NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

AdaMerging: Adaptive Model Merging for Multi-Task Learning

Enneng Yang, Zhenyi Wang, Li Shen, Shiwei Liu, Guibing Guo, Xingwei Wang, Dacheng Tao

In the era of foundation models, we often find ourselves with a collection of specialized models—one fine-tuned for recognizing cars, another for satellite imagery, and a third for medical scans. Ideally, we’d want a single "Swiss Army Knife" model that can handle all these tasks simultaneously. Traditional Multi-Task Learning (MTL) achieves this by training on all datasets at once, but this is computationally expensive and often impossible due to data privacy or the simple fact that original training sets are rarely shared.

AdaMerging, presented at ICLR 2024, offers a clever "data-free" alternative. It merges these specialized models into one without ever looking at the original training data, significantly closing the performance gap between simple model merging and expensive joint training.

TL;DR

AdaMerging is an unsupervised method that merges multiple task-specific models into a single multi-task model by adaptively learning merging coefficients. By using entropy minimization on unlabeled test samples as a proxy for accuracy, it outperforms existing "task arithmetic" methods by up to 11% and demonstrates remarkable robustness to distribution shifts.

What Problem Does This Paper Address?

The current state-of-the-art for "cheap" model merging is Task Arithmetic. You take a pre-trained model ($\theta_{pre}$), fine-tune it for a specific task ($\theta_k$), and define a "task vector" as the difference: $T_k = \theta_k - \theta_{pre}$. To create a multi-task model, you simply add these vectors back to the pre-trained base.

However, there's a catch: task vectors often conflict. Simply adding them together usually leads to a significant drop in performance. To mitigate this, researchers use a scaling coefficient ($\lambda$), but finding the "perfect" $\lambda$ is a manual, trial-and-error process (grid search) that becomes impossible as the number of tasks and model layers grows.

The challenge is: How do we find the optimal merging weights for each task and each layer automatically, without access to the original training labels?

Performance gap between traditional merging and joint training.

Methods

The authors introduce AdaMerging, which treats the merging coefficients as learnable parameters. They propose two flavors:

  1. Task-wise AdaMerging: Learns one coefficient per task.
  2. Layer-wise AdaMerging: Learns a unique coefficient for every layer of every task, allowing for much finer control over how knowledge is integrated.
Comparison of merging strategies including Task Arithmetic and AdaMerging.

The "Aha!" moment is their choice of objective function. Since they don't have labels, they use Entropy Minimization. The intuition is simple: if a model is performing well, its predictions should be confident (low entropy). By iteratively adjusting the merging coefficients to minimize the entropy of predictions on a small set of unlabeled test data, the model "self-corrects" the conflicts between tasks.

Datasets

The method was evaluated on a diverse suite of eight image classification datasets:

  • SUN397 (Scene recognition)
  • Stanford Cars (Fine-grained car classification)
  • RESISC45 (Remote sensing)
  • EuroSAT (Satellite imagery)
  • SVHN & MNIST (Digit recognition)
  • GTSRB (Traffic signs)
  • DTD (Texture classification)

Key Insights and Ideas

  • Entropy is a Great Proxy: The authors found a strong positive correlation (Spearman coefficient ~0.87) between prediction entropy and actual cross-entropy loss. This confirms that minimizing entropy is a valid way to improve accuracy without labels.
  • Layer-wise Flexibility Matters: Not all layers are created equal. Shallow layers tend to learn general features that are useful across tasks, while deeper layers are highly specialized. AdaMerging automatically assigns smaller weights to task vectors in shallow layers and larger weights in deeper ones, reflecting this hierarchy.
  • Orthogonality of Tasks: Most task vectors are nearly orthogonal to each other. This explains why they can be merged, but also why they need careful scaling to avoid interfering with the pre-trained base's general knowledge.
  • Minimal Data Requirement: You don't need a massive test set. The authors showed that using as little as 0.1% or 1% of unlabeled test data is enough to see significant performance gains.

Key Results

  • Superior Performance: On the ViT-B/32 architecture, AdaMerging achieved an average accuracy of 81.1%, a massive jump from the 69.1% achieved by standard Task Arithmetic.
  • Generalization: When tested on "unseen" tasks (tasks whose vectors weren't included in the merge), AdaMerging still outperformed baselines by up to 9.1%, suggesting it creates a more robust and general feature space.
  • Robustness: The model is significantly more resilient to "distribution shifts"—things like motion blur, noise, or compression artifacts in the test data—outperforming Task Arithmetic by an average of 8.45% across various corruptions.
  • Efficiency: Training the merging coefficients is incredibly fast. It adds only a tiny number of parameters (e.g., 1,248 for a layer-wise merge of 8 tasks) and takes only a few minutes on a single GPU.

Limitations and Future Work

While AdaMerging is a major step forward, the authors note a few areas for improvement:

  • The Gap Remains: While AdaMerging is much better than previous merging methods, it still trails "Traditional MTL" (joint training) by about 7-8%.
  • Architecture Scope: The current study focuses on Vision Transformers (ViT). Extending this to Large Language Models (LLMs) or other architectures is a logical next step.
  • Unlabeled Data Dependency: The method requires a small amount of unlabeled data from the target tasks. While usually easy to get, a completely "data-free" version would be even more flexible.

In summary, AdaMerging provides a practical, efficient, and highly effective way to combine specialized AI models into versatile multi-task systems, all without the need for original training data or expensive retraining.

Summary updated

BibTeX
@inproceedings{yang2024adamerging,
  author = {Enneng Yang and Zhenyi Wang and Li Shen and Shiwei Liu and Guibing Guo and Xingwei Wang and Dacheng Tao},
  title = {{AdaMerging: Adaptive Model Merging for Multi-Task Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=nZP6NgD3QY},
}
Figure