Editing Models with Task Arithmetic
By Gabriel Ilharco, Marco Tulio Ribeiro, Mitchell Wortsman, Suchin Gururangan, Ludwig Schmidt, Hannaneh Hajishirzi, Ali Farhadi. 2022
1,114 citations recorded by the source corpus.
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 change in model behavior on control tasks. Moreover, adding task vectors together can improve performance on multiple tasks at once. Finally, when tasks are linked by an analogy relationship of the form ``A is to B as C is to D", combining task vectors from three of the tasks can improve performance on the fourth, even when no data from the fourth task is used for training. Overall, our experiments with several models, modalities and tasks show that task arithmetic is a simple, efficient and effective way of editing models.
Subfields: Artificial Intelligence, Large Language Models, Efficiency & Compression
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Artificial Intelligence
- Mohit Bansal
- Yejin Choi
- Luke S. Zettlemoyer
- Hannaneh Hajishirzi
- Jianfeng Gao
- Percy Liang
- Caiming Xiong
- Graham Neubig
In Large Language Models
- Yejin Choi
- Mohit Bansal
- Bill Yuchen Lin
- Steven Basart
- Derek Tam
- Ariel Herbert-Voss
- Qian Liu
- Hanspeter Pfister
In Efficiency & Compression
Citations in the corpus
- Language Models are Super Mario: Absorbing Abilities from Homologous Models as a Free Lunch (2023, positive): “TIES-Merging (Ya-dav et al., 2023) tackles the task conflicts in Ilharco et al. (2023) by trimming low-magnitude parameters, resolving sign disagreements, and disjointly merging parameters with consistent signs.”
- Emergent Linear Representations in World Models of Self-Supervised Sequence Models (2023, methodology): “, 2023b), “task vectors” (Ilharco et al., 2022), or other “steering vectors” (Subramani et al.”
- Parameter-Efficient Fine-Tuning Methods for Pretrained Language Models: A Critical Review and Assessment (2023, methodology): “For the multi-task fusion meth-ods, simple average, task arithmetic [92], [93], ties-merging [94], and LoRAhub [55] are employed for multi-task fusion.”
- Improving Alignment and Robustness with Circuit Breakers (2024, neutral): “This includes research ranging from uncovering emergent interpretable structures in intermediate representations [77, 46, 10], to the identification and modification of embedded knowledge [48, 42, 43], as well as steering model outputs [66, 7, 33, 24, 65].”
- Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design or: How I learned to start worrying about prompt formatting (2023, background): “Another approach is to learn, optimize, and insert continuous representations of prompts and tasks as input to models (Qin & Eisner, 2021; Lester et al., 2021; Ding et al., 2022; Ilharco et al., 2023).”
- Rethinking machine unlearning for large language models (2024, neutral): “For example, evaluation on natural language understanding tasks (Jang et al., 2022; Eldan & Russinovich, 2023; Yao et al., 2023; Barbulescu & Triantafillou, 2024; Liu et al., 2024) and perplexity (Ilharco et al., 2022; Zhang et al., 2023c) has been considered in the literature.”
- Inference-Time Intervention: Eliciting Truthful Answers from a Language Model (2023, background): “This contrasts with weight editing methods that also aim for minimal invasion Meng et al. (2022); Ilharco et al. (2022); Orgad et al. (2023).”
- Editing Large Language Models: Problems, Methods, and Opportunities (2023, neutral): “There are also some editing works that can deal with computer vision tasks such as ENN (Sinitsin et al., 2020) and Ilharco et al. (2023).”
- The WMDP Benchmark: Measuring and Reducing Malicious Use With Unlearning (2024, result): “In contrast to both these perspectives, we leverage the idea that model representations encode knowledge of the world (Meng et al., 2022) and that these representations may be manipulated to affect model behavior (Zou et al., 2023a; Ilharco et al., 2023; Turner et al., 2023).”
- TIES-Merging: Resolving Interference When Merging Models (2023, methodology): “Task Arithmetic [29] presented a method for merging models by generating task vectors and performing arithmetic operations, such as addition, to obtain a multitask checkpoint.”
- LoraHub: Efficient Cross-Task Generalization via Dynamic LoRA Composition (2023, background): “Recent studies on the interrelation between MoE and instruction tuning have demonstrated that the simultaneous application of both approaches enhances the effectiveness of each individually (Shen et al., 2023).”