Open Interpretability Models Contributors Research Posts About

Editing Models with Task Arithmetic

Source

Citation. Gabriel Ilharco, Marco Tulio Ribeiro, Mitchell Wortsman, Suchin Gururangan, Ludwig Schmidt, Hannaneh Hajishirzi and Ali Farhadi. The affiliations are the University of Washington, Microsoft Research and the Allen Institute for AI. The text we read doesn't map them to authors. "Editing Models with Task Arithmetic". arXiv:2212.04089, version 3 of 31 March 2023. Version 1 is of 8 December 2022, and version 2 of 29 March 2023. Venue: ICLR 2023, as the arXiv comment field states. The paper's own header shows no venue line. The code is at github.com/mlfoundations/task_vectors. Funding: the acknowledgements name NSF IFML, Open Philanthropy, NSF, ONR and DARPA grants, a Sloan Fellowship and gifts from AI2. The paper names its tools: Detoxify, the Perspective API and Hugging Face's libraries and checkpoints.

Status. Planned. #5298 holds the task-vector merge rules for the patch format. #5404 would test the interpolation half of the paper on the registry's own pair of models. No code, skill or protocol here depends on it. The fix campaign (#5220) is the maintainer's, so this page reports evidence and records questions only.

Read. On 2026-11-20 a web-fetch subagent read the abstract page and the HTML full text (version 3) for this page's author, a model (Claude Opus 5.5). We have in the source's own text the abstract, Sections 1 to 8, the acknowledgements, Appendices A to D, and Tables 1 to 10. We have the opening of Appendix E and part of E.1. The rest of E.1, and E.2 and E.3, came back only as a summary, so this page gives none of their numbers. We didn't see any figure as an image, nor Tables 11 and 12. So the cosine similarities of Figure 5 appear here only as the text describes them.

Summary

Claim. The change that fine-tuning makes to a model's weights, a task vector, can be edited with arithmetic. Negating it removes a behaviour, adding several builds a multi-task model, and an analogy of three improves a task with no data for it.

Method.

Findings, as the source reports them.

Setting Result
Negation, CLIP, mean of 8 targets, target accuracy and ImageNet accuracy (Table 1) ViT-L/14: pre-trained 64.8 and 75.5, negative task vector 19.0 and 72.9, random vector 60.9 and 72.9, gradient ascent 3.93 and 16.3
Same, ViT-B/32 (Table 1) Pre-trained 48.3 and 63.4, negative task vector 24.0 and 60.9
Negation, GPT-2 Large, toxic share, mean toxicity, perplexity (Table 2) Pre-trained 4.8%, 0.06, 16.4. Negative task vector 0.8%, 0.01, 16.9. Random vector 4.8%, 0.06, 16.4. Fine-tuned on non-toxic text 1.8%, 0.03, 17.2
Negation, GPT-2 Medium and Small (Tables 9, 10) 4.3% to 1.8% toxic, perplexity 18.5 to 18.9. 3.7% to 2.5%, perplexity 25.2 to 25.3
Addition, CLIP, pairs of tasks (Section 4.1) 98.9% normalised accuracy on average
Addition, CLIP, all 8 tasks (Section 4.1, D.2) The best sum reaches 91.2% normalised accuracy. Multi-task fine-tuning reaches 99.4%
Addition, T5-base, mean of four GLUE tasks (Table 3) Zero-shot 57.1, fine-tuned 78.1, fine-tuned plus a Hub task vector 78.6
Analogies, T5, sentiment, auxiliary fine-tune against analogy against target fine-tune (Table 4) Yelp, T5-small 88.6, 89.9, 91.1. Amazon, T5-base 90.8, 92.7, 93.2
Two task vectors at λ=0.5 against an ensemble (Appendix A) Equal to a uniform average of the two fine-tunes. Accuracy correlates with the ensemble's at Pearson 0.99
Scale (D.3) "0.3 to 0.5 produce close to optimal results in many cases". "The variance in the optimal scaling coefficients can be large"

Section 6 reports that task vectors from different tasks "are typically close to orthogonal". The authors "speculate that this enables the combination of task vectors via addition with minimal interference". The largest similarities are among MNIST, SVHN and GTSRB, and between EuroSAT and RESISC45. Intermediate task vectors "converge rapidly to the direction of the final task vector". A higher fine-tuning learning rate hurts both task vectors and the fine-tuned models.

Where the claims go beyond the evidence

The authors state limits themselves. Task vectors need "models with the same architecture", fine-tuned "from the same pre-trained initialization". Removing a behaviour the model already shows strongly is harder (B.7). And a high learning rate calls for "more caution".

Use in this repo