这篇论文提出了SiM方法,不用额外训练就能动态路由多任务模型,只用少量样本预计算,效果逼近独立专家。
SiM通过奇异值分解(SVD)为每个任务构建低秩流形,利用测试输入特征在任务流形上的投影残差进行无训练路由。仅需每个任务32个样本的支撑集即可离线预计算流形,合并过程无需额外数据。在计算机视觉和自然语言处理基准上,任务未知推理场景下SiM显著提升合并模型性能,持续缩小与独立专家模型的差距。该方法无需存储完整专家参数,兼容子空间/掩码合并。
Training-free Task Classification for Multi-Task Model Merging
Ever since the advent of foundation models and the pre-training-finetuning paradigm, there have been numerous efforts to merge multiple task-specific experts into a single multi-task model. Prior work largely focuses on finding a single merged model, but it often underperforms individual experts due to parameter interference. To resolve this, dynamic model merging employs routing to activate task-relevant parameters per input. However, existing routers typically require either additional training with abundant labeled datasets or assume the access to task IDs of each input at inference time. In this work, we aim to close the gap to expert performance without additional training or task-ID-access assumption. To this end, we formulate routing as training-free task classification for each test input. Using singular value decomposition (SVD)-based low-rank manifold approximations for each task, SiM scores tasks by the projection residual of the test input feature onto each task manifold and routes accordingly. The task manifolds are pre-computable offline from a pretrained backbone using a small per-task support set (e.g., 32 examples per task) prior to merging process, requiring no router training and no data during the merging process. Moreover, SiM integrates seamlessly with subspace-/mask-based merging that represents task-expert via lightweight compressed task vectors, avoiding the need to store full expert parameters. Experiments across computer vision and natural language processing benchmarks under task-unknown inference demonstrate that SiM substantially improves merged-model performance and consistently narrows the gap to individual task experts.