Knowledge Composition using Task Vectors with Learned Anisotropic Scaling

Frederic Z. Zhang, Paul Albert, Cristian Rodriguez-Opazo, Anton van den Hengel, Ehsan Abbasnejad
7/3/2024
45 citations
cs.LGcs.AIcs.CV
lora-peft-merging

Official code: fredzzhang/atlas (28 stars, Python, last commit 2025-02-24).

Abstract

Pre-trained models produce strong generic representations that can be adapted via fine-tuning. The learned weight difference relative to the pre-trained model, known as a task vector, characterises the direction and stride of fine-tuning.

Show full abstract

The significance of task vectors is such that simple arithmetic operations on them can be used to combine diverse representations from different domains. This paper builds on these properties of task vectors and aims to answer (1) whether components of task vectors, particularly parameter blocks, exhibit similar characteristics, and (2) how such blocks can be used to enhance knowledge composition and transfer. To this end, we introduce aTLAS, an algorithm that linearly combines parameter blocks with different learned coefficients, resulting in anisotropic scaling at the task vector level. We show that such linear combinations explicitly exploit the low intrinsic dimensionality of pre-trained models, with only a few coefficients being the learnable parameters. Furthermore, composition of parameter blocks leverages the already learned representations, thereby reducing the dependency on large amounts of data. We demonstrate the effectiveness of our method in task arithmetic, few-shot recognition and test-time adaptation, with supervised or unsupervised objectives. In particular, we show that (1) learned anisotropic scaling allows task vectors to be more disentangled, causing less interference in composition; (2) task vector composition excels with scarce or no labeled data and is less prone to domain shift, thus leading to better generalisability; (3) mixing the most informative parameter blocks across different task vectors prior to training can reduce the memory footprint and improve the flexibility of knowledge transfer. Moreover, we show the potential of aTLAS as a PEFT method, particularly with less data, and demonstrate its scalibility.

View on arXivView PDF

Code Implementations(1)

fredzzhang/atlasOfficial100%

[NeurIPS'24] Official PyTorch implementation for paper "Knowledge Composition using Task Vectors with Learned Anisotropic Scaling"

282PythonDec 20, 20231 years ago
few-shot-learningneurips-2024parameter-efficient-fine-tuningpeftpytorch-implementation+2 more

Similar Papers

Cite this paper

@article{zhang2024knowledge,
  title  = {Knowledge Composition using Task Vectors with Learned Anisotropic Scaling},
  author = {Frederic Z. Zhang and Paul Albert and Cristian Rodriguez-Opazo and Anton van den Hengel and Ehsan Abbasnejad},
  year   = {2024},
  eprint = {2407.02880},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2407.02880},
  url    = {http://arxiv.org/abs/2407.02880v2},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2407.02880.svg)](https://codeofpaper.com/paper/2407.02880)

Discussion