Editing Models with Task Arithmetic
Gabriel Ilharco, Marco Tulio Ribeiro, Mitchell Wortsman, Suchin, Gururangan, Ludwig Schmidt, Hannaneh Hajishirzi, Ali Farhadi

TL;DR
This paper introduces task vectors as a way to steer pre-trained models' behavior through arithmetic operations in weight space, enabling task-specific improvements and multi-task performance without additional training.
Contribution
The work proposes a novel paradigm of task vectors for model editing, demonstrating their effectiveness through arithmetic operations like addition and negation to modify model behavior.
Findings
Negating a task vector reduces performance on that task.
Adding task vectors can improve multi-task performance.
Combining task vectors based on analogies enhances performance on related tasks.
Abstract
Changing how pre-trained models behave -- e.g., improving their performance on a downstream task or mitigating biases learned during pre-training -- is a common practice when developing machine learning systems. In this work, we propose a new paradigm for steering the behavior of neural networks, centered around \textit{task vectors}. A task vector specifies a direction in the weight space of a pre-trained model, such that movement in that direction improves performance on the task. We build task vectors by subtracting the weights of a pre-trained model from the weights of the same model after fine-tuning on a task. We show that these task vectors can be modified and combined together through arithmetic operations such as negation and addition, and the behavior of the resulting model is steered accordingly. Negating a task vector decreases performance on the target task, with little…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
- 🤗mlabonne/Hermes-3-Llama-3.1-8B-lorablatedmodel· 89 dl· ♡ 4289 dl♡ 42
- 🤗itsmepv/model_sft_dare_restamodel· ♡ 1♡ 1
- 🤗nlpguy/Hermes-low-tune-2model· 97 dl· ♡ 297 dl♡ 2
- 🤗nlpguy/Lelantos-low-tunemodel· 99 dl· ♡ 199 dl♡ 1
- 🤗ycros/DolphinLimaTrio-Mixtral-8x7b-GGUFmodel· 15 dl15 dl
- 🤗nlpguy/Hermes-low-tune-3.1model· 93 dl93 dl
- 🤗jeiku/RocketHermesZephyrBoros_3Bmodel· 6 dl· ♡ 16 dl♡ 1
- 🤗TheBigBlender/EstopianMaidmodel· 6 dl· ♡ 16 dl♡ 1
- 🤗TheBigBlender/EstopianMaid-GGUFmodel· 139 dl· ♡ 15139 dl♡ 15
- 🤗intervitens/internlm2-limarp-chat-20bmodel· 5 dl· ♡ 35 dl♡ 3
Videos
Taxonomy
TopicsMachine Learning and Data Classification · Adversarial Robustness in Machine Learning · Explainable Artificial Intelligence (XAI)
