Mastering Task Arithmetic: $\tau$Jp as a Key Indicator for Weight Disentanglement

Kotaro Yoshida, Yuji Naraki, Takafumi Horie, Ryosuke Yamaki, Ryotaro Shimizu, Yuki Saito, Julian McAuley, Hiroki Naganuma

Introduction

In the era of foundation models, retraining a giant network for every new task is prohibitively expensive. Task arithmetic offers a seductive alternative: take a pre-trained model, fine-tune it on Task A and Task B separately, and then simply add the differences in weights (task vectors) to create a multi-task model. You can even subtract a task vector to "forget" undesirable behaviors like toxicity.

However, in practice, this process is messy. Tasks often "interfere" with one another, leading to a significant drop in accuracy. To fix this, researchers usually have to perform an exhaustive grid search to find the perfect scaling coefficients for each task vector. This paper tackles the lack of theoretical understanding of why this interference happens and introduces $\tau$Jp, a novel metric that quantifies and mitigates this interference, effectively eliminating the need for expensive manual coefficient tuning.

The $\tau$Jp Metric and Regularization

The authors' core contribution is the $\tau$Jp ($\tau$-Jacobian product) metric, which measures the product of a task vector ($\tau$) and the Jacobian ($J$) of the pre-trained model. Essentially, it calculates how much the weight changes intended for Task A "leak" into the function space of Task B.

Working within the Neural Tangent Kernel (NTK) regime—where deep networks behave like linear models—the authors prove that for task arithmetic to work perfectly, task vectors must be orthogonal to the Jacobians of other tasks. Based on this, they introduce a new regularization loss function used during fine-tuning. In addition to learning the target task, the model is penalized if its weight updates interfere with the Jacobians of other tasks.

To make this scalable, they propose a "cyclical" implementation. Instead of calculating the penalty for every other task at every training step (which is memory-intensive), they rotate through the tasks, calculating the penalty for just one "other" task per iteration. This cyclical approach reduces computation time by approximately 80% compared to strict regularization.

Key Insights and Results

The researchers validated their approach across both vision (eight diverse image classification datasets using ViT-B and ViT-L) and language domains (GLUE benchmark and toxicity negation using T5-small and GPT-2).

Causality and Weight Disentanglement

The authors demonstrate that $\tau$Jp isn't just correlated with interference; it has a causal relationship. Minimizing it directly leads to "weight disentanglement," where each task's weights occupy a distinct, non-interfering subspace.

Correlation between $\tau$Jp and Normalized Accuracy across ViT architectures

As shown above, models fine-tuned with the proposed regularization (orange stars) consistently achieve lower $\tau$Jp and higher normalized accuracy compared to standard linear fine-tuning (blue dots), demonstrating a strong negative correlation between the $\tau$Jp penalty and model performance.

Traditionally, task arithmetic requires searching for specific scaling coefficients (e.g., $0.4 \times \text{Task A} + 0.6 \times \text{Task B}$). The authors show that with their $\tau$Jp regularization, a default coefficient of 1.0 becomes optimal, drastically reducing the compute needed for model merging.

Performance comparison of task merging methods on ViT models

On the ViT-L-14 model, the proposed method achieved a 99.0% normalized accuracy for task addition using a fixed coefficient of 1.0. This significantly outperformed state-of-the-art merging methods like Ties-Merging and AdaMerging, which often require complex weight-trimming or additional training.

Effective Negation and Scalability

Beyond task addition, the method excels at task negation. In NLP toxicity experiments, their method reduced the toxic generation rate of GPT-2 from 1.3 to 0.4 while keeping language perplexity almost identical to the base model.

Furthermore, the approach supports incremental learning. You don't need to know all future tasks to use this technique; regularizing against past tasks is sufficient to keep the weight space "clean" for future additions, making the method highly practical for evolving systems.

Limitations and Future Work

While highly effective, the method relies on model linearization (NTK approximation). Forward calculations for linearized models can be 2-3 times slower than standard non-linear models. Additionally, while tested on ViT-Large and T5-small, further validation is needed on massive Large Language Models (LLMs). The authors suggest that combining $\tau$Jp regularization with parameter-efficient fine-tuning methods like LoRA could be a promising future direction to reduce the memory overhead of calculating Jacobians.

Summary updated

BibTeX
@inproceedings{yoshida2025mastering,
  author = {Kotaro Yoshida and Yuji Naraki and Takafumi Horie and Ryosuke Yamaki and Ryotaro Shimizu and Yuki Saito and Julian McAuley and Hiroki Naganuma},
  title = {{Mastering Task Arithmetic: $\textbackslash\{\}tau$Jp as a Key Indicator for Weight Disentanglement}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=1VwWi6zbxs},
}
Figure