Efficient Model Editing with Task-Localized Sparse Fine-tuning

Leonardo Iurada, Marco Ciccone, Tatiana Tommasi

Abstract

Task arithmetic has emerged as a powerful paradigm for editing foundation models, allowing users to add or subtract specific capabilities by manipulating "task vectors." However, this approach often suffers from task interference, where combining multiple vectors degrades performance. While network linearization can mitigate this, it is computationally prohibitive for large-scale models. This paper introduces TaLoS (Task-Localized Sparse Fine-Tuning), a method that achieves the benefits of linearization through strategic sparsity. By updating only the parameters least sensitive to task-specific changes, TaLoS creates disentangled task vectors that can be merged efficiently without the overhead of explicit linearization.

Introduction

In the current landscape of foundation models, the ability to modularly update a model's behavior is critical. "Task arithmetic" provides a mechanism for this: a pre-trained model is fine-tuned on a specific task, and the difference between the fine-tuned and original weights—the task vector—is extracted. These vectors can theoretically be summed to combine skills or subtracted to "unlearn" specific behaviors.

In practice, however, task vectors often interfere with one another. Standard fine-tuning modifies weights that are essential for the model's general performance or for other specific tasks. Previous research suggested that "linearizing" the network during fine-tuning could solve this by ensuring weight disentanglement, but the memory and computational costs of linearization make it impractical for modern, large-scale architectures. TaLoS addresses this gap by demonstrating that sparsity, when localized to specific "lazy" parameters, naturally induces a linear regime without the associated costs.

Methodology: Task-Localized Sparse Fine-Tuning

TaLoS is built upon two fundamental observations. First, pre-trained models contain a subset of "lazy" parameters that exhibit low gradient sensitivity across a wide variety of tasks. Second, updating only these parameters keeps the model within a "linear regime," where the relationship between parameter changes and output changes is approximately linear, thus preventing interference.

The TaLoS Workflow

  1. Sensitivity Scoring: The method begins by identifying which parameters are least critical to the model's output for a given task. This is achieved by calculating the diagonal of the Fisher Information Matrix (FIM), which serves as a proxy for parameter sensitivity.
  2. Mask Calibration: Using an iterative "Pruning-at-Initialization" (PaI) strategy, TaLoS generates a binary mask. This mask is designed to freeze the vast majority of the model's weights, typically allowing only 1% to 10% of the least-sensitive parameters to be updated.
  3. Sparse Fine-Tuning: The model undergoes standard fine-tuning, but the gradient updates are restricted by the calibrated mask. This results in a sparse, localized task vector that is highly disentangled from the model's core weights and other task-specific vectors.

Experimental Setup

The authors evaluated TaLoS across diverse domains to ensure its generalizability:

  • Vision: Experiments utilized three CLIP ViT variants (B/32, B/16, L/14) across eight datasets, including specialized tasks like EuroSAT (satellite imagery) and GTSRB (traffic signs).
  • Language: The method was tested on T5 models (Small, Base, Large) across seven NLP benchmarks, including WikiQA and Winogrande.

Key Insights and Results

Superior Performance in Task Arithmetic

TaLoS consistently outperformed state-of-the-art merging methods such as TIES-Merging and L-LoRA. In task addition scenarios, TaLoS showed a normalized accuracy improvement of 1.88% to 4.65% across various model scales. In task negation (forgetting), the method successfully removed target information while maintaining over 95% of the performance on control tasks.

Computational Efficiency

The most significant advantage of TaLoS is its efficiency. For a ViT-B/32 model, TaLoS reduced peak memory usage from 10.2 GiB (required for linearized fine-tuning) to just 4.7 GiB. Furthermore, the training iteration time was cut by more than half, making it a viable solution for resource-constrained environments.

Architectural Localization

Analysis of the generated masks revealed that TaLoS naturally targets specific components of the transformer architecture. Specifically, the method tends to update the Query (Q) and Key (K) projections within self-attention layers. This structured sparsity suggests that certain parts of the transformer are naturally more suited for task-specific adaptation than others.

Discussion and Future Work

TaLoS demonstrates that explicit linearization is not a prerequisite for effective model editing. Instead, by identifying and updating "flat" regions of the loss landscape, one can achieve superior weight disentanglement. While the mask calibration step adds a minor initial overhead (approximately 40 iterations), the subsequent gains in memory and performance far outweigh this cost.

Future research may explore whether enforcing these localization constraints dynamically during the fine-tuning process—rather than just at initialization—could further enhance results. Additionally, applying TaLoS to even larger generative models and more complex multi-task scenarios remains a promising frontier for efficient model editing.

Summary updated

BibTeX
@inproceedings{iurada2025efficient,
  author = {Leonardo Iurada and Marco Ciccone and Tatiana Tommasi},
  title = {{Efficient Model Editing with Task-Localized Sparse Fine-tuning}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=TDyE2iuvyc},
}
Figure