Skip to content
katoro8989Public

About

Source code for paper "DisTaC: Conditioning Task Vectors via Distillation for Robust Model Merging" (ICLR2026)

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Distillation for Task Vector Conditioning (DisTaC)

This repository contains the official source code accompanying our paper DisTaC: Conditioning Task Vectors via Distillation for Robust Model Merging.

Updates

  • Jan 2026: Our paper has been accepted at ICLR 2026!!🥳

🧐 What's the Problem?

In multi-task model merging, we discovered two key failure modes that severely degrade performance:

  • 📏 Norm mismatch: Significant differences in task-vector norms across tasks.
  • 😟 Low-confidence predictions: Source models who predict with high-entropy outputs.

💡 Our Solution: DisTaC

To address these issues, we introduce DisTaC (Distillation-based Task-Vector Conditioning), a simple and effective pre-conditioning method that leverages knowledge distillation:

  • 🎯 Norm Alignment: Adjusts the task-vector norms precisely to avoid merging conflicts.
  • 🔥 Confidence Calibration: Enhances low-confidence predictions using temperature-controlled distillation (specifically, using an asymmetric temperature setup).

DisTaC achieves robust model merging with minimal additional computational overhead, effectively eliminating harmful effects caused by norm mismatch and low-confidence predictions.

For full details, experiments, and analyses, please refer to our paper.

Prerequisites

pip install -r requirements.txt

Datasets

Datasets to download:

We are using the same datasets as this repository.

For Cars, the original download link is broken, so please refer to this issue for a workaround. For DTD, EuroSAT, RESISC45, and SUN397, the datasets need to be manually split after downloading. Please refer to this issue for details.

Preparering Source Models

  1. Download our checkpoints

Under preparation.

  1. fine-tuned by your own
python src.finetune_wandb.py --model=ViT-B-32 --world-size=2 --save=/path/to/checkpoint/

Please store the files in the following directory structure:

/path/to/checkpoint/
├── head_[dataset_name]_dict.pt   # CLIP classification head for the dataset
└── [dataset_name]/
    ├── finetuned.pt              # fine-tuned model weights
    └── zeroshot.pt               # zero-shot model weights

Task Vector Conditioning

Conditioning a harmful task vector by DisTaC

Example of performing DisTaC with λ=0.1, T_tchr=10, T_stu=10, β=0.1

python src.distac.py --model=ViT-B-32 --world-size=2 --save=/path/to/checkpoint --norm_lambda=0.1 --distil_T_tchr=10 --distil_T_stu=10 --distil_beta=0.1

Evaluation Merging Methods

python src.eval_task_addtion.py --save=/path/to/checkpoint --model=ViT-B-32
python src.eval_ties_merging.py --save=/path/to/checkpoint --model=ViT-B-32
python src.eval_consensus.py --save=/path/to/checkpoint --model=ViT-B-32
python src.eval_tsvm.py --save=/path/to/checkpoint --model=ViT-B-32

About

Source code for paper "DisTaC: Conditioning Task Vectors via Distillation for Robust Model Merging" (ICLR2026)

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages