Abstract
Selective Task Arithmetic (STA) is a training-free framework designed to enhance the merging of specialized models. By employing a loss-sensitive importance metric to mask unimportant parameter changes, STA mitigates inter-task interference and facilitates precise task forgetting without extensive hyperparameter tuning.
Introduction
In modern machine learning, large pretrained models like ViT or CLIP are frequently fine-tuned for specific downstream tasks. "Task Arithmetic" has emerged as a popular, training-free method to combine these specialized models by adding their "task vectors"—the difference between fine-tuned and pretrained weights. However, standard task arithmetic suffers from parameter interference, high sensitivity to scaling coefficients, and imprecise task forgetting where noisy vector elements degrade overall model performance.
Selective Task Arithmetic (STA)
The proposed STA framework addresses these limitations by identifying and retaining only the most influential parameters for each task.
Loss-Sensitive Importance Metric
Unlike methods that rely solely on weight magnitude, STA utilizes a first-order Taylor expansion to measure the functional importance of parameters. This metric quantifies how much the loss function changes if a specific parameter is removed, identifying the weights the model truly relies on for a given task.
Sparsified Fusion and Task Forgetting
As illustrated in the workflow below, importance values are normalized and used to create a mask that retains only the top-tier parameters (determined by a quantile hyperparameter $p$). During multi-task fusion, these sparse task vectors are added to the pretrained weights. This targeted approach allows for a scaling coefficient ($\lambda$) of 1, simplifying the fusion process. For task forgetting, STA subtracts only the "important" parameters of the target task, minimizing collateral damage to other model capabilities.
Experimental Evaluation
STA was evaluated using a ViT-B/16 backbone across six diverse computer vision benchmarks: MNIST, GTSRB, Stanford Cars, SVHN, DTD, and EuroSAT.
Key Results
- Multi-Task Performance: In a 6-task fusion scenario, STA achieved an average accuracy of 82.84%, outperforming state-of-the-art methods like PCB-Merging (82.39%) and standard Task Arithmetic (75.23%).
- Robustness: STA maintains high performance with a fixed fusion coefficient ($\lambda=1$), whereas competing methods require extensive per-task tuning.
- Task Forgetting: When removing the MNIST task, STA reduced target accuracy to ~9% while maintaining superior performance on remaining tasks (64.51% vs. 62.3% for standard arithmetic).
Discussion and Limitations
The core insight of STA is that parameter sensitivity is a more reliable indicator of importance than magnitude. By masking approximately 70% of the task vector as noise, STA effectively regularizes the fusion process.
However, STA is not strictly data-free; it requires a small sample (e.g., 32 samples) of training data to calculate gradients for the importance metric. Future research may explore more granular metrics and validate the framework's effectiveness on Large Language Models (LLMs).
Summary updated