无需训练和任务标签,用特征投影残差实现多任务模型高效路由。
Training-free Task Classification for Multi-Task Model Merging

- 基于SVD的低秩流形近似,通过投影残差判断输入属于哪个任务
- 仅需每任务32个样本离线构建流形,合并时无需额外数据或训练
- 兼容轻量级参数压缩方法,适合部署在资源受限场景
自基础模型与预训练-微调范式兴起以来,研究者致力于将多个特定任务专家合并为统一的多任务模型。现有方法多聚焦于寻找单一合并模型,但常因参数干扰导致性能低于独立专家。动态模型合并通过路由机制按输入激活相关参数,但现有路由通常需额外训练或依赖推理时的任务标签。本文提出无需训练且不依赖任务标签的训练自由任务分类方法。通过奇异值分解(SVD)对每个任务构建低秩流形近似,利用测试输入特征在各任务流形上的投影残差计算相似度(SiM),实现任务路由。这些任务流形可仅凭少量每任务32个样本的支撑集,在预训练主干网络上离线生成,合并过程无需路由器训练或数据。此外,SiM可无缝集成子空间/掩码式合并,以轻量压缩向量表示任务专家,避免存储完整专家参数。在计算机视觉与自然语言处理基准测试中,面对未知任务的推理情形,SiM显著提升合并模型性能,持续缩小与独立专家的差距。代码已开源:https://github.com/BAIKLAB/SiM
原文摘要 · Abstract (English)
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. Our code is available at https://github.com/BAIKLAB/SiM
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。