Model Merging with Functional Dual Anchors
Kexuan Shi, Yandong Wen, Weiyang Liu
TL;DR
This work introduces Functional Dual Anchors (FDAs), a novel input-space framework for model merging that shifts task knowledge encoding from parameters to synthetic inputs whose gradients align with task vectors. FDAs are constructed by gradient-matching objectives in the input space and then used to optimize the merged model, either independently or in combination with traditional parameter-space merges (e.g., TA, TSV, WUDI). The approach includes principled initialization, a layer-wise practical implementation, and extensive experiments across vision, language, and auto-regressive models, demonstrating notable gains in multi-task performance and GLUE scores. Analyses show FDAs develop a long-tailed energy distribution and align with real-data subspaces, while ablations guide choices on initialization, shape, distance metrics, and construction steps. Overall, FDAs offer a robust, flexible, and complementary path to consolidate cross-task knowledge without retraining on task data, with practical benefits for large foundation models.
Abstract
Model merging is an efficient post-training strategy for integrating knowledge from multiple finetuned checkpoints of a shared foundation model. Existing methods operate in the parameter space, combining task vectors to mitigate conflicts, but remain constrained by parameter inconsistencies. We propose Functional Dual Anchors (FDAs), a framework that instead models the input-representation space. FDAs are synthetic inputs whose induced gradients align with task vectors, capturing task-specific functional shifts relative to the pretrained model. This perspective bridges joint multi-task training and post-hoc merging, offering both robustness and flexibility. We further introduce a principled initialization scheme and show that FDAs are complementary to parameter-space model merging. Comprehensive experiments demonstrate the effectiveness of FDAs in model merging.
