TL;DR
Task arithmetic allows you to edit pre-trained models by simply adding or subtracting fine-tuned weight vectors, but the underlying mechanics have long been a mystery. This paper reveals that "weight disentanglement"—where specific weight directions affect only localized regions of the input space—is the secret sauce. Furthermore, it demonstrates that fine-tuning models in their linearized "tangent space" dramatically improves the precision and effectiveness of these edits.
The Challenge of Model Editing
As AI models grow, "editing" them to learn new tasks or forget undesirable behaviors becomes a massive headache. Traditional joint fine-tuning is computationally expensive and often destroys a model's original "zero-shot" capabilities.
Recently, task arithmetic emerged as a lightweight alternative. The process is straightforward: take a pre-trained model ($\theta_0$), fine-tune it on Task A to get $\theta_A$, and create a "task vector" ($\tau_A = \theta_A - \theta_0$). By adding these vectors ($\theta_0 + \tau_A + \tau_B$), you can theoretically create a multi-task model without retraining from scratch. However, this often works poorly in practice because the tasks "interfere" with each other. The authors set out to understand why this interference happens and how to fix it.
Methods: Moving to the Tangent Space
To resolve task interference, the researchers propose moving the entire fine-tuning process into the model's Tangent Space.
- Linearization: Instead of training the standard non-linear neural network, they use a first-order Taylor expansion around the pre-trained weights. This turns the model into a linear predictor governed by the Neural Tangent Kernel (NTK).
- Linearized Fine-Tuning (Linear FT): Rather than just linearizing a model after it's been trained (post-hoc), they propose directly fine-tuning the linearized version.
- Weight Disentanglement Framework: They formalize a property called "weight disentanglement." A model is disentangled if a task vector $\tau_t$ only changes the model's output for inputs related to Task $t$, leaving other regions of the input space untouched.
Key Insights and Ideas
- Disentanglement is the Key: Task arithmetic fails when task vectors are "entangled." In non-linear models, changing weights to learn about "Cars" might accidentally change how the model processes "Satellite images." Linearization significantly reduces this cross-talk.
- The "Linear Regime" Myth: Previous work assumed task arithmetic worked because models naturally stay in a "linear regime" during fine-tuning. This paper proves that assumption wrong—standard fine-tuning is quite non-linear. However, actively forcing the model to be linear actually helps.
- Pre-training is Essential: Weight disentanglement is an emergent property of pre-training. If you try task arithmetic on a randomly initialized model, it fails completely. Pre-training "organizes" the weight space so that different semantic concepts live in different directions.
- Spatial Localization: The authors linked task arithmetic to the spatial localization of the NTK's eigenfunctions. Essentially, the "math" of the pre-trained model is already partitioned into localized experts; linearization just makes it easier to access them without disturbing the rest of the network.
Experimental Setup and Key Results
The authors primarily evaluated their approach using CLIP (Vision-Language Models) across three scales: ViT-B/32, ViT-B/16, and ViT-L/14. They tested on a benchmark of 8 diverse image classification tasks (including Cars, DTD, SUN397, EuroSAT, etc.), using ImageNet-1K as a control dataset to ensure that "forgetting" one task didn't accidentally break the model's general knowledge. They also validated results on ConvNeXt and T5 architectures.
- Better Multi-tasking: On the "Task Addition" benchmark (summing 8 task vectors), Linear FT outperformed standard non-linear fine-tuning by up to 5.8 percentage points in absolute accuracy.
- Precise Forgetting: In "Task Negation" (subtracting a task vector to make the model forget a specific concept), the linearized approach was much more surgical. It reduced accuracy on the target task by an additional 13.1 points compared to non-linear methods, while better preserving performance on the ImageNet control set.
- Scale Matters: Larger models (like ViT-L/14) are naturally more "linear" and disentangled than smaller ones, explaining why task arithmetic scales so well with model size.
Limitations and Future Work
While powerful, the approach has trade-offs:
- Computational Overhead: Linearized models are more memory-intensive. Training and inference require computing Jacobian-vector products, making them roughly 2x slower and 2x more memory-hungry than standard models.
- The Single-Task Gap: For very small models, standard non-linear fine-tuning still provides a slight accuracy advantage on a single task. The linearized approach is superior for editing and combining tasks, but there is still a small "linearity tax" on raw performance for smaller architectures.
Future work will likely focus on finding more efficient ways to linearize models and investigating exactly how pre-training dynamics create this beneficial weight disentanglement in the first place.
Summary updated