TL;DR
Task Arithmetic allows us to "edit" foundation models by adding or subtracting task-specific vectors, but these vectors often interfere with one another, degrading overall performance. This paper introduces TAK (Task Arithmetic with KFAC), a method that uses curvature information to prevent this interference without requiring access to the original training data. TAK achieves state-of-the-art results with constant computational overhead, paving the way for scalable and privacy-preserving model adaptation.
The Challenge of Cross-Task Interference
Foundation models, such as CLIP or T5, are frequently adapted to specific downstream tasks through fine-tuning. Task Arithmetic (TA) is a popular framework where these adaptations are treated as "task vectors"—mathematical directions in the model's parameter space. These vectors can be added together to combine skills or subtracted to "unlearn" specific behaviors.
The ultimate goal of TA is modularity: the ability to combine these vectors effortlessly. However, in practice, task vectors often suffer from cross-task interference. When a vector for "Task B" is added to a model already tuned for "Task A," it often shifts the internal representations used by Task A. This causes "representation drift" and a subsequent loss in performance.
Existing solutions to this problem usually rely on representation drift regularization, which forces the model to stay consistent on previous tasks. The major drawback is that these methods typically require access to the original training data of those previous tasks. In environments with strict privacy regulations (like GDPR) or proprietary datasets, sharing raw data alongside task vectors is often impossible.
A Dataless Solution: TAK
The authors propose a "dataless" approach by framing the prevention of representation drift as a curvature matrix approximation problem.
- Linearization: The method builds on the observation that Task Arithmetic works best when the model is treated as a first-order Taylor approximation (linearized) around its pre-trained weights.
- The Jacobian Gramian: Under linearization, the "drift" caused by adding a new task vector can be expressed as a quadratic form of the network's Jacobian Gramian. This matrix essentially describes the "shape" of the function space.
- KFAC (Kronecker-Factored Approximate Curvature): Because the full Gramian is too massive to compute or store, the authors utilize KFAC. This technique approximates the huge curvature matrix by breaking it down into smaller "Kronecker factors" (pairs of smaller matrices for each layer).
- Accumulated Regularizer: To keep the method scalable, they introduce a merging heuristic. Instead of storing separate curvature factors for every single task—which would grow linearly with the number of tasks—they aggregate them into a single "surrogate" curvature matrix. This ensures constant complexity ($O(1)$) regardless of how many tasks are added.
Key Results and Performance
The researchers evaluated their method across both vision and language domains, including an 8 Vision Benchmark (MNIST, SVHN, EuroSAT, DTD, GTSRB, RESISC45, SUN397, and Cars196) using CLIP backbones, and the 6NLI Benchmark using a T5-base model.
- State-of-the-Art Performance: In task addition, TAK matches or outperforms previous state-of-the-art methods (like $\tau Jp$), despite those methods requiring access to external data. For example, on ViT-B/16, TAK achieved 88.3% absolute accuracy compared to the 80.2% of naive Task Arithmetic.
- Superior Unlearning: In "task negation" (removing a specific skill), TAK was more effective at "forgetting" the target task while better preserving the model's general knowledge on control tasks like ImageNet.
- Robustness to Scaling: Standard Task Arithmetic often requires tedious grid searching to find the right scaling coefficient ($\alpha$) for merging vectors. TAK is remarkably robust; simply adding vectors ($\alpha=1$) often yields peak performance, eliminating the need for a held-out validation set.
- Efficiency: Pre-computing KFAC factors for the entire 8 Vision benchmark takes only 4 minutes on a single GPU. During training, it adds negligible overhead compared to data-dependent regularizers.
Insights and Future Directions
The most significant insight from this work is that dataless regularization is possible. You do not need the raw images or text to protect a task's performance; you only need a mathematical summary of how the model's activations respond to that data (the curvature). By using curvature regularization, task vectors learn to influence the model only in regions of the function space relevant to their specific task, leaving other regions untouched (Task Localization).
While the complexity is constant relative to the number of tasks, KFAC factors still require GPU memory that scales quadratically with layer width. For massive models, more aggressive compression (like SVD or 8-bit quantization) will be necessary. Additionally, while TAK is strong in text domains, there remains a small performance gap compared to data-heavy methods in certain language scenarios, suggesting that curvature estimation for LLMs may require further refinement.
Summary updated