TL;DR
Model merging is a powerful way to combine specialized "expert" models into a single multi-task network, but the resulting model often underperforms due to "feature drift"—where internal representations deviate from the original experts. This paper introduces FEATCAL (Feature Calibration), a method that corrects this drift layer-by-layer in a forward pass using an efficient, closed-form mathematical solution. FEATCAL eliminates the need for gradient descent or extra inference-time modules, delivering state-of-the-art accuracy across vision and language benchmarks while running up to 4x faster than existing calibration baselines.
What Problem Does This Paper Address?
When deep learning models are fine-tuned for specific tasks (e.g., classifying cars vs. analyzing satellite imagery), researchers often try to merge their weights into a single multi-task model to save on deployment costs. However, simply averaging or mathematically combining these weights usually leads to a performance drop compared to the original individual experts.
The authors pinpoint the root cause of this performance gap: feature drift. When a merged model processes an input, its internal layer activations drift away from what the specialized expert model would have produced. This drift compounds layer by layer, ultimately degrading the final output scores.
While previous post-merging calibration methods (like Representation Surgery) attempt to fix this, they typically rely on adding extra parameter modules or running slow, iterative optimization loops during inference. The challenge tackled here is creating a direct, architecture-preserving calibration method that is both highly accurate and computationally inexpensive.
Methods
FEATCAL introduces a forward-order, layer-by-layer calibration schedule that directly updates the existing linear weights of a merged model using a small calibration dataset.
Instead of using gradient descent (backpropagation), FEATCAL frames the calibration of each linear module (such as attention projections and MLP layers) as a localized ridge regression problem. Because the input features from the previous calibrated layer are fixed during each step, this regression has an exact, closed-form solution that can be solved instantly via linear algebra.
To make this work robustly without overfitting to the tiny calibration sets, FEATCAL incorporates two key regularization techniques:
- Feature Interpolation: Instead of forcing the layer to perfectly match the raw expert features (which might overcorrect for upstream drift), it targets an interpolated blend of the expert features and the current calibrated features.
- Anchor Regularization: A quadratic penalty keeps the newly calibrated weights close to an "anchor weight"—a customizable blend of the merged model weights and the original pretrained base model weights.
Datasets
The authors evaluated FEATCAL across three distinct multi-task settings:
- CLIP Image Classification: Tested on 8-task, 14-task, and 20-task suites using diverse vision datasets including SUN397, Stanford Cars, RESISC45, EuroSAT, SVHN, GTSRB, MNIST, and DTD.
- FLAN-T5 Text Generation: Evaluated on 8 prompted GLUE tasks (including CoLA, MNLI, MRPC, QNLI, QQP, RTE, SST-2, and STS-B).
- MergeBench LLM Merging: Evaluated domain-expert merging using Llama-3.2-3B-Instruct and Llama-3.1-8B-Instruct across capabilities like mathematics, coding, and instruction following (MATH-500, GSM8K, HumanEval+, MBPP+, IFEval, and ARC-Challenge).
Key Insights and Ideas
- Sequential Correction Prevents Compounding Errors: Feature drift is a downstream combination of local layer mismatches and upstream propagation. By calibrating the model from front to back (forward-order), FEATCAL ensures that later layers are calibrated using features that have already been corrected by earlier layers.
- Fixing Features $\neq$ Fixing Parameters: Interestingly, diagnostics show that FEATCAL successfully pushes the final layer features closer to the expert representations without forcing the actual weight parameters to align with the expert weight vectors. It fixes the behavior of the layers rather than just mimicking the expert's parameter space.
- Zero Inference Overhead: Because FEATCAL folds its updates directly into the original linear weights, the final model architecture remains completely unchanged. There are no auxiliary paths, adapters, or plugins slowing down inference.
Key Results
FEATCAL consistently outperforms the closest post-merging calibration baselines (Surgery and ProbSurgery) in both accuracy and efficiency:
- Vision Performance: On the CLIP-ViT-B/32 Task Arithmetic benchmark, FEATCAL achieved 85.5% average accuracy, compared to 77.0% for Surgery and 78.8% for ProbSurgery.
- Language Performance: On FLAN-T5-base GLUE tasks, FEATCAL reached 85.2%, beating the baselines (83.7% and 82.2%). It also boosted average scores on 3B and 8B Llama models by over 2 points.
- Extreme Sample Efficiency & Speed: FEATCAL is remarkably sample-efficient; using just 8 examples per task, it pushed CLIP accuracy to 82.9%. When using 256 examples per task, the entire calibration process took only 53 seconds—roughly 4x faster than baselines, while consuming a fraction of the GPU energy and CPU memory.
Limitations and Future Work
While FEATCAL demonstrates impressive efficiency, the authors note a few limitations:
- Hyperparameter Tuning: The method relies on three hyperparameters ($\lambda$, $\rho$, and $\alpha$) to balance regularization and target interpolation. Currently, these must be tuned manually using a validation set, as there is no automatic selection rule.
- Data Dependence: Like competing methods, it still requires access to a small task-specific calibration dataset, which might not always be available in data-constrained or privacy-sensitive deployment scenarios.
- Scale Constraints: Due to compute limitations, the study primarily focused on models up to 8B parameters. Future work will explore how these closed-form updates scale to massive LLMs and broader multimodal settings.
Summary updated