Task arithmetic has emerged as a simple yet powerful technique for model merging, enabling the combination of multiple finetuned models into one. Despite its empirical success, a clear theoretical explanation of why and when it works is lacking. This paper provides a rigorous theoretical foundation for task arithmetic by establishing a connection between task vectors and gradients of the task losses. We show that under standard gradient descent, a task vector generated from one epoch of finetuning is exactly equivalent to the negative gradient of the loss, scaled by the learning rate. For the practical multi-epoch setting, we prove that this equivalence holds approximately, with a second-order error term that we explicitly bound for feed-forward networks. Our empirical analysis across seven vision benchmarks corroborates our theory, demonstrating that the first-epoch gradient dominates the finetuning trajectory in both norm and direction. A key implication is that merging models finetuned for only a single epoch often yields performance comparable to merging fully converged models. These findings reframe task arithmetic as a form of approximate multitask learning, providing a clear rationale for its effectiveness and highlighting the critical role of early training dynamics in model merging.

On Task Vectors and Gradients / Zhou, L., Solombrino, D., Crisostomi, D., Bucarelli, M.S., Alessio D'Inverno, G., Silvestri, F., Rodola', E.. - 322:(2026), pp. 398-417. (UniReps: 3rd Workshop on Unifying Representations in Neural Models (NeurIPS 2025 Workshop) San Diego; USA ).

On Task Vectors and Gradients

Luca Zhou;Daniele Solombrino;Donato Crisostomi;Maria Sofia Bucarelli;Fabrizio Silvestri;Emanuele Rodola'
2026

Abstract

Task arithmetic has emerged as a simple yet powerful technique for model merging, enabling the combination of multiple finetuned models into one. Despite its empirical success, a clear theoretical explanation of why and when it works is lacking. This paper provides a rigorous theoretical foundation for task arithmetic by establishing a connection between task vectors and gradients of the task losses. We show that under standard gradient descent, a task vector generated from one epoch of finetuning is exactly equivalent to the negative gradient of the loss, scaled by the learning rate. For the practical multi-epoch setting, we prove that this equivalence holds approximately, with a second-order error term that we explicitly bound for feed-forward networks. Our empirical analysis across seven vision benchmarks corroborates our theory, demonstrating that the first-epoch gradient dominates the finetuning trajectory in both norm and direction. A key implication is that merging models finetuned for only a single epoch often yields performance comparable to merging fully converged models. These findings reframe task arithmetic as a form of approximate multitask learning, providing a clear rationale for its effectiveness and highlighting the critical role of early training dynamics in model merging.
2026
UniReps: 3rd Workshop on Unifying Representations in Neural Models (NeurIPS 2025 Workshop)
model merging; task vectors; task arithmetic; gradient descent; multi-task learning
04 Pubblicazione in atti di convegno::04b Atto di convegno in volume
On Task Vectors and Gradients / Zhou, L., Solombrino, D., Crisostomi, D., Bucarelli, M.S., Alessio D'Inverno, G., Silvestri, F., Rodola', E.. - 322:(2026), pp. 398-417. (UniReps: 3rd Workshop on Unifying Representations in Neural Models (NeurIPS 2025 Workshop) San Diego; USA ).
File allegati a questo prodotto
Non ci sono file associati a questo prodotto.

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/11573/1780818
 Attenzione

Attenzione! I dati visualizzati non sono stati sottoposti a validazione da parte dell'ateneo

Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus ND
  • ???jsp.display-item.citation.isi??? ND
social impact