Model merging with SVD to tie the Knots

## Abstract

Abstract Recent model merging methods demonstrate that the parameters of fully-finetuned models specializing in distinct tasks can be combined into one model capable of solving all tasks without retraining. Yet, this success does not transfer well when merging LoRA finetuned models. We study this phenomenon and observe that the weights of LoRA finetuned models showcase a lower degree of alignment compared to their fully-finetuned counterparts. We hypothesize that improving this alignment is key to obtaining better LoRA model merges, and propose KnOTS to address this problem. KnOTS uses the SVD to jointly transform the weights of different LoRA models into an aligned space, where existing merging methods can be applied.
In addition, we introduce a new benchmark that explicitly evaluates whether merged models are general models.
Notably, KnOTS consistently improves LoRA merging by up to 4.3% across several vision and language benchmarks, including our new setting.
We release our code at: https://github.com/gstoica27/KnOTS .

## 1 Introduction

Model merging (Garipov et al., ; Draxler et al., ; Wortsman et al., ; Choshen et al., ) is an increasingly popular technique that can surprisingly create a single general model by combining weights of task-specific models.
This allows creating multi-task models by accumulating skills (Stoica et al., ; Ilharco et al., ; Yadav et al., ; Ortiz-Jimenez et al., ), a desirable trait in various scenarios such as recycling models shared on hubs (Choshen et al., ), patching model weaknesses (Cai et al., ; Zaman et al., ) and collaborating to improve models Don-Yehiya et al. (); Raffel ().

Model merging approaches have found substantial success when merging models that are full-rank finetuned (i.e., all parameters are tuned with maximum rank, we denote it as FFT) to solve distinct tasks from the same pretrained checkpoint, into one model capable of solving all (Ilharco et al., ; Matena & Raffel, ; Yadav et al., ; Ortiz-Jimenez et al., ; Wortsman et al., ).
In many cases, performing a linear sum over the
finetuned model weights
without further training,
can achieve strong performance (Wortsman et al., ; Ilharco et al., ; Yadav et al., ).

Interestingly, existing merging approaches do not always transfer well when applied to models finetuned with parameter efficient finetuning (PEFT) strategies (Tang et al., ), such as the extremely popular Low-Rank Adaptation (LoRA) (Hu et al., ).
We probe into this phenomenon (§ 3) by comparing the pairwise centered kernel alignment (CKA) (Kornblith et al., ) between FFT models and their equivalent LoRA finetuned counterparts.
While we observe that FFT models have very high CKA—indicating that the finetuning-updates they apply to the respective pretrained weights (we call these “task-updates”) have high alignment, LoRA models exhibit considerably lower CKA.
This suggests that the task-updates between different LoRA models process inputs through misaligned subspaces.
We hypothesize that aligning these task-updates is crucial to strengthening model merging operations, and propose a data and gradient free approach to do this.

Figure: Figure 1: The KnOTS method for merging “task-updates” from an arbitrary layer-$j$ of different models. Each weight-update is denoted by $\Delta W_{j}^{(i)}$, where “$i$” is the $i^{th}$ model. KnOTS first concatenates the updates together and applies the SVD, to obtain $U,\Sigma$ and a set of concatenated $V^{(i)}$ matrices that each correspond to a particular task. KnOTS then merges the $V$’s into a single $V^{(merged)}$ matrix. Finally, KnOTS multiplies the $U,\Sigma$ and $V^{(merged)}$ to obtain a merged-update to be added to the pretrained model.
Refer to caption: extracted/5911915/figures/KnOTS_225ppi.png

Our method, termed KnOTS (Knowledge Orientation Through SVD), builds upon singular value decomposition (SVD) to transform the task-updates of different LoRA models into a shared space, where merging methods can be applied (Fig. 1).
Notably, KnOTS is simple and readily slots into many existing merging methods.
KnOTS first concatenates all the task-updates for a layer, and then decomposes the result with the SVD to obtain: $U\Sigma V^{T}$ (see §4).
We observe that in this construction, $U$ consists of vectors that form the orthonormal basis for a shared representation space between all task updates, the non-negative diagonal values in $\Sigma$ represent the scale associated with each basis vector in the aligned space, and $V^{T}$ is a set of concatenated matrices (one for each task-update) that are all aligned to the common $U$.
KnOTS then applies existing merging methods, such as those of Ilharco et al. (); Yadav et al. (), to the $V^{T}$ task-matrices and obtains a $V^{(merged)}$ matrix that is still aligned to the common $U$.
After merging, KnOTS constructs the merged model by multiplying the resulting $U\Sigma V^{(merged)}$ into one matrix at every layer, and adding it to the corresponding parameter matrix from the pretrained model.
We validate KnOTS on several model merging settings spanning vision and natural language, demonstrating that KnOTS strengthens existing model merging approaches by up to 4.3% (§ 5).

In addition, we introduce a new benchmark setting aimed at explicitly evaluating a merging method’s ability to create general models.
Specifically, we transform the popular eight-vision task merging benchmark originally proposed by Ilharco et al. () to a “joint-evaluation”.
Our setting consists of evaluating the performance of arbitrary merged models on the union of all inputs and labels across all eight datasets, without providing the model with any information regarding the dataset a particular example comes from.
This contrasts to the existing setting where only labels pertaining to the dataset an example stems from are given to the models to classify.
We argue that the joint-evaluation setting is a step towards simulating the ability to create general merged models, capable of preserving the union of all skills captured by their base models (§ 5.3).
Notably, KnOTS further improves merging performance in this challenging setting.

To summarise, our key contributions are:

- •
We propose KnOTS, a method which aligns task updates from different LoRA models into a shared space, enabling the effective use of existing methods for merging models.
- •
We introduce a new benchmark for measuring model generality by grouping the images and labels across all datasets from the vision benchmark of Ilharco et al. () into a single “joint-task” dataset, and evaluate the ability of models to correctly classify any image across all possible labels.

## 2 Related work

#### 2.0.0.1 Landscapes between models.

The geometric landscape of non-convex loss functions
used to train neural networks remains largely uncharted.
However,
Draxler et al. (); Garipov et al. (); Simsek et al. (); Frankle & Carbin () reveal that the parameter values of independently trained neural networks can be interpolated without increasing the test loss, a phenomenon known as mode-connectivity.
Neyshabur et al. (), shows that models are often mode-connected when they are finetuned on the same task from the same pretrained initialization.
In parallel, it has become common practice to finetune models using pretrained weights (Dosovitskiy et al., ; Huang et al., ; Oquab et al., ; Hsu et al., ; Touvron et al., ; Radford et al., ). Together with recent discoveries Wortsman et al. (); Matena & Raffel () that even the parameters of models finetuned on different tasks from the same initialization may be merged to create strong multitask models, there has been a surge of model merging approaches for finetuned models.

#### 2.0.0.2 Model merging methods.

Several
approaches improve robustness or scores by averaging
finetuned weights (Choshen et al., ; Wortsman et al., ; Rame et al., ; ).
Task arithmetic (TA) (Ilharco et al., ) first subtracts the parameter values of the pretrained model from those of the finetuned models, creating a set of “task-vectors.”
These are then linearly summed to create a merged model, without any gradient calculations or retraining.
Ortiz-Jimenez et al. () theoretically grounds TA, by showing that its success is dependent on the task-vectors governing disjoint regions in the pretrained model’s function space—a concept known as “weight disentanglement.”
In practice, they find that the weights of different finetuned models heavily conflict, and propose a finetuning strategy that disentangles finetuned models to merge better with TA.
Daheim et al. (); Shah et al. () also find that TA-style merging can improve with finetuning
and access to large amounts of training data.
TIES (Yadav et al., ) improves TA by resolving the parameter interference between models when merging.
Specifically, it prunes low-magnitude weights and then only averages weights which share the dominant sign.
DARE (Yu et al., ) further explores this issue by randomly dropping fine-tuned weights and rescaling the remaining ones to create sparse task-vectors.

#### 2.0.0.3 Merging LoRA models.

LoRA (Hu et al., ) has quickly become a very popular finetuning technique.
However, existing merging methods (Ilharco et al., ; Yadav et al., ; Yu et al., ) do not transfer well to merging LoRA models (Tang et al., ).
Tang et al. () suggest this is due to increased weight-entanglement between the models, and propose a specialized finetuning method similar to Ortiz-Jimenez et al. () which improves the performance of each merging method.
In contrast, we do not assume models have a specialized fine-tuning strategy and present a gradient-free framework that significantly improves merging performance.

## 3 Background and motivation

#### 3.0.0.1 Problem setting.

We study gradient-free multitask model-merging (Ilharco et al., ; Stoica et al., ; Yadav et al., ; Jin et al., ).
Suppose that we have a set of $n$ models with the same architecture, that have each been finetuned with Low-Rank Adaptation (LoRA) (Hu et al., ) on a distinct task (e.g., different image classification problems) from the same pretrained model.
Let $\{f^{(1)},f^{(2)},\ldots,f^{(n)}\}$ denote the finetuned models and $f^{(pt)}$ be the pretrained model.
Model-merging methods fuse the parameters of these finetuned models into a single unified model capable of solving all tasks.
We study gradient-free approaches as they are both data-efficient and training-free, making them lightweight tools for merging models on-the-fly (Wortsman et al., ).
We study models finetuned with LoRA due to its wide usage and because recent work observes notable challenges when applying existing gradient-free methods on such models (Tang et al., ).

#### 3.0.0.2 Model definitions.

Let a pre-trained model $f^{(pt)}$ have $l$ layers, each containing weights and an optional bias.
Assume all biases are concatenated to their respective weights, and let the weight of the $j^{th}$ layer be represented as $W_{j}^{(pt)}$.
Let $\theta^{(pt)}$ be the collection of all model weights, such that $\theta^{(pt)}=\{W_{1}^{(pt)},\ldots,W_{j}^{(pt)},\ldots,W_{l}^{(pt)}\}$.
Finetuned models are obtained by applying task-updates to each weight in $\theta^{(pt)}$.
We denote these updates by $\tau^{(i)}=\{\Delta W_{1}^{(i)},\ldots,\Delta W_{j}^{(i)},\ldots,\Delta W_{l}^
{(i)}\}$, where $\Delta W_{j}^{(i)}$ is
the update corresponding to the $j^{th}$ layer in the $i^{th}$ model.
As LoRA constrains each update to be low-rank, we let all updates have a rank of $r<<\min{(I,O)}$, where $I$ and $O$ represent the input and output dimension.
Every $\Delta W_{j}^{(i)}\in\mathbb{R}^{O\times I}$ transforms input features $x^{(i)}\in\mathbb{R}^{I}$ to output features $y^{(i)}\in\mathbb{R}^{O}$ as follows: $y^{(i)}=\Delta W_{j}^{(i)}x^{(i)}$.
Due to the low-rank constraint, $\Delta W_{j}^{(i)}$ can only act on a subspace of size $r<<\min{(I,O)}$ over $y^{(i)}$ (Hu et al., ).
Finally, the parameters of $f^{(i)}$ are given by $\theta^{(pt)}+\tau^{(i)}=\{W_{1}^{(pt)}+\Delta W_{1}^{(i)},\ldots,W_{j}^{(pt)}
+\Delta W_{j}^{(i)},\ldots,W_{l}^{(pt)}+\Delta W_{l}^{(i)}\}$.

#### 3.0.0.3 Merging models.

Existing methods merge models by first defining a function (e.g., identity in (Ilharco et al., )) that transforms the task-updates $\{\tau^{(1)},\ldots\tau^{(n)}\}$.
Second, each update is uniformly scaled via a unique “scaling coefficient”, denoted by $\alpha^{(i)}\geq 0$.
Third, these updates are summed to create a single set of merged updates, which are then added to the pretrained model weights to obtain the final merged model.
Optimal values for $\alpha^{(i)}\geq 0$ are selected according to the performance of the merged model on any available data (Ilharco et al., ; Yadav et al., ; Yu et al., ).
Although LoRA updates factorize into smaller matrices $A$ and $B$, we utilize the full-matrix representation $\Delta W_{j}^{(i)}$ = $BA$ in all merge operations. We explain this decision in App. A.

### 3.1 LoRA models are difficult to merge

Existing full-rank finetuned (FFT) model merging approaches perform well without additional data, even on different tasks (Ilharco et al., ; Yadav et al., ).
However, Tang et al. () observe that the same merging methods encounter significant challenges when merging LoRA finetuned models, even when these are finetuned on the same tasks.
Previous works
Ilharco et al. (); Yadav et al. (); Tang et al. () use “task-vector orthogonality” as a proxy for understanding when merging is difficult.
This consists of flattening the updates $\{\tau^{(1)},\ldots\tau^{(n)}\}$ into a vector, and computing the pairwise cosine similarity between them.
The intuition is that when the cosine similarity between vectors is near zero (i.e., they are orthogonal), their weights are disentangled and lie in distinct subspaces—enabling them to be merged without interference.

#### 3.1.0.1 Task-vector orthogonality may not reliably measure merge potential.

To see why, consider a simple toy example.
Let $f^{(1)}(x)=W^{(1)}_{2}\text{ReLU}(W^{(1)}_{1}x)$ and $f^{(2)}=W^{(2)}_{2}\text{ReLU}(W^{(2)}_{1}x)$ be two classification models that transform inputs $x\in\mathbb{R}$ to some $y^{(1)},y^{(2)}\in\mathbb{R}$ respectively, where $W^{(1)}_{1},W^{(1)}_{2},W^{(2)}_{1},W^{(2)}_{2}\in\mathbb{R}$.
Let $W^{(1)}_{2}=1,W^{(1)}_{1}=1,W^{(2)}_{2}=1,\text{ and }W^{(2)}_{1}=-1$, and assume that each weight was initialized with 0 0.
Here, $f^{(1)}$ classifies all $x\in\mathbb{R}^{+}$ as positive (i.e., $y^{(1)}>0$) and all $x\in\mathbb{R}^{-}$ as negative (i.e., $y^{(2)}\leq 0$), while $f^{(2)}$ does the opposite.
Calculating the task-vectors of $f^{(1)}$ and $f^{(2)}$ give $[1,1]$ and $[-1,1]$ respectively—making them orthogonal.
However, it is trivial to see that merging their model weights catastrophically affects the performance of at least one model.
Any scaled sum over their weights with an $\alpha^{(i)}$ will preserve one model’s predictions while flipping the other’s.
Despite having orthogonal task-vectors, merging the weights of these models is catastrophic.
Thus, additional measures may be helpful to understand when models can be merged.

#### 3.1.0.2 Merging is easier when model layers share similar activations.

Entezari et al. (); Ainsworth et al. (); Jordan et al. (); Stoica et al. () extensively show that models whose layers extract similar intermediate activations for the same inputs, are easier to merge—even when trained on distinct tasks (Stoica et al., ).
This often occurs when the weights across models extract the same kinds of meanings in a similar order from the inputs (Entezari et al., ; Stoica et al., ), and are thus aligned.
We posit that understanding model alignment from this perspective can serve as a helpful tool for understanding the challenges behind merging.
One way to measure this is using the centered kernel alignment (CKA) measure (Kornblith et al., ).
CKA measures the similarity between the intermediate activations of two models, at each layer.
CKA values close to one indicate that the models process information similarly—and thus that their weights transform inputs in a functionally aligned manner.
When CKA is low, the reverse is true.

Figure: Figure 2: Finetuning strategy impacts representation alignments between models trained on different tasks. The figure shows the average pairwise centered kernel alignment (CKA—Kornblith et al. ()) between the outputs solely given by finetuning updates (e.g., a $\Delta W_{j}^{(i)}$) across every attention layer, from models finetuned on different tasks with different strategies (defined in §5.2). High CKA indicates that the task-updates of different models are aligned. (a) Full-rank finetuned models exhibit high CKA and alignment.(b) LoRA finetuned models are drastically less aligned. (c) However, they are dramatically more aligned with KnOTS.
Refer to caption: extracted/5911915/figures/ckas_225ppi.png

#### 3.1.0.3 FFT models have well-aligned representations.

Fig. 2a shows the average pairwise CKAs between the task-updates of the FFT models presented in Ilharco et al. ().
We observe very high CKA, indicating that the updates between models process information in a way that ensures the intermediate feature activations between their layers are well aligned.
This suggests that their updates extract similar information from inputs at each layer, and that merging them would not cause significant disruption—as seen by (Ilharco et al., ).

#### 3.1.0.4 LoRA models have considerably less aligned representations.

Conducting the same CKA analysis on LoRA variants of the same models from (Ilharco et al., ) shows that the models exhibit dramatically lower average CKA between task-updates (Fig. 2b).
This suggests that they are functionally misaligned: from the same inputs each LoRA extracts unrelated features.
Entezari et al. (); Jordan et al. (); Stoica et al. () observe that merging models in these circumstances can yield poor performance. We speculate that this phenomenon may be due to the low-rank constraint imposed on LoRA models.
Specifically, each task-update can only act on a subspace of the input and output activation space.
Since each LoRA model is finetuned on a different dataset, it must carefully pick the subspace it uses to extract information. Thus, it is unlikely that the task-updates across different models extract the same kind of information, leading to low activation alignment between updates and poor merges.

#### 3.1.0.5 Our hypothesis.

Coupling the CKAs of FFT model task-updates with those of LoRA models, we hypothesize that aligning LoRA task-updates is a crucial first step to improving their mergeability, and the performance of existing merging methods.
We seek to design such an alignment method without assuming access to data or gradients.

## 4 Method: KnOTS

We propose a data-free and gradient-free method for aligning LoRA models, to improve the performance of existing model merging methods.
Our method, termed KnOTS
(Knowledge Orientation Through SVD), uses singular value decomposition (SVD) to jointly align the representation spaces between LoRA models (see illustration in Fig. 1).

#### 4.0.0.1 Subspace alignment with the SVD.

KnOTS aligns the updates across different LoRA models layer-wise.
Thus, it suffices to consider how we align the updates for an arbitrary layer $j$.
Recall that these updates are denoted by: $\Delta W_{j}^{(1)},\ldots,\Delta W_{j}^{(i)},\ldots,\Delta W_{j}^{(n)}$, each extracting different kinds of information.
For notational ease, we drop the subscript $j$ for the remainder of this section.
Most often SVD is used with square matrices, aligning vectors in them.
Instead, we propose to align these updates into a shared space where they can extract similar information, by concatenating the updates across tasks and deconstructing the result with SVD:

$$ $\displaystyle SVD\left[\Delta W^{(1)};\Delta W^{(2)};\dots;\Delta W^{(n)} \right]=U\Sigma$ $\displaystyle V^{T}$ (1) $\displaystyle=U\Sigma$ $\displaystyle\left[V^{(1)};V^{(2)};\dots;V^{(n)}\right]^{T}$ (2) $$

where, $U\in\mathbb{R}^{O\times k},\Sigma\in\text{Diag}(\mathbb{R}^{k}),\{[V^{(1)}]^{T
},\ldots,[V^{(n)}]^{T}\}\in\mathbb{R}^{k\times I}$, $1\leq k\leq\min{(I,O,nr)}$.
Here, $\Delta W^{(1)}=U\Sigma[V^{(1)}]^{T};\Delta W^{(2)}=U\Sigma[V^{(2)}]^{T};\ldots
;\Delta W^{(n)}=U\Sigma[V^{(n)}]^{T}$.
With the SVD, each task-update is decomposed into a shared $U\Sigma$ term—defining the orthogonal basis for the activations from all task-updates—along with task specific components, $[V^{(i)}]^{T}$.
By construction, each $[V^{(i)}]^{T}$’s from any task-update acts to transform the same information (given by $U\Sigma$) with any input, thereby increasing their alignment.
We visualize this effect in Fig. 2c.
Specifically, we compute the CKA between the intermediate activations obtained from passing the same inputs through each $[V^{(1)}]^{T},\ldots[V^{(n)}]^{T}$ of our LoRA models, and averaging over all layers to be merged.
We observe that the CKAs are significantly higher compared to Fig. 2b, indicating that the task-updates between LoRA models are substantially more aligned under KnOTS.

#### 4.0.0.2 Applying merge methods.

In many cases, we can directly apply existing merging methods on the aligned $[V^{(1)}]^{T},\ldots[V^{(n)}]^{T}$ without modifications.
Specifically, we can apply some merging function (e.g., weighted sum a-la-(Ilharco et al., )) over these parameters to obtain a single merged $[V^{(merged)}]^{T}$.
We can then construct the merged update with the remaining SVD components: $\Delta W_{j}^{(merged)}=U\Sigma[V^{(merged)}]^{T}$, which is finally added to the pre-trained layer weights $W_{j}$.

## 5 Experiments and results

We validate KnOTS across diverse benchmarks spanning both vision and language domains.
We first evaluate KnOTS on the popular “per-task” setting across both vision and language tasks (§ 5.2).
Here, models finetuned on distinct datasets are merged and then evaluated on each dataset separately.
KnOTS consistently improves the capabilities of existing merging methods across all experiments.
Second, we study the capabilities of merging methods building general models by introducing a new benchmark (§ 5.3).
Despite being very challenging, KnOTS is still capable of uplifting existing merging approaches.
Third, we conduct extensive analysis on different facets of KnOTS (§ 5.4).

### 5.1 Experimental Details

#### 5.1.0.1 Models.

We use ViT-B/32 or ViT-L/16 (Dosovitskiy et al., ) for all our vision experiments.
These are two variants of the CLIP vision encoder (Radford et al., ) that are finetuned separately on a variety of tasks.
Our natural language experiments are conducted with LLama3-8B model (AI, ) across different natural language inference (NLI) tasks.
As in (Hu et al., ), we only apply LoRA on the weight matrices in the attention layers: namely the key, query, value and output layers.
Unless otherwise specified, each LoRA has a rank of 16.
Further training details are found in App. D.

#### 5.1.0.2 Merging methods.

As discussed in § 3, we restrict our scope to gradient-free merging methods in this work.
To the best of our knowledge, there are only four such merging methods for our setting: RegMean (Jin et al., ), Task-Arithmetic (TA) (Ilharco et al., ), TIES (Yadav et al., ), and DARE (Yu et al., ).
RegMean (Jin et al., ) is a merging approach that also aligns the weights of each model.
It does this by solving a closed-form locally linear regression problem at every model layer.
This results in obtaining a transformation matrix for each models’ task-updates, that when applied aligns the updates between models.
In contrast, TA, TIES and DARE assume that the task updates between models stemming from a shared pre-trained checkpoint are functionally aligned and directly merge them.

TA (Ilharco et al., ) merges models finetuned on different tasks with the same pretrained checkpoint by linearly summing their parameters. They apply a summation-weight (termed “scaling coefficient”) to the parameters of each model that achieves the best merged model performance over a held-out validation set.
Instead of tuning a unique scaling co-efficient for each task-vector which may be expensive and does not scale well, we only tune a single scaling co-efficient for all models as recommended by Ilharco et al. (); Yadav et al. ().
TIES (Yadav et al., ) extends TA by reducing noise and conflicts between parameters when merged.
It reduces noise by pruning parameters with the lowest magnitudes—retaining only the “top-$k$” parameters with highest magnitudes, and reduces parameter conflicts by also pruning those that lie in outlying directions—a step called “sign-resolution”.
TIES then linearly sums the model parameters using the scaling coefficients and $k$ for pruning, that achieve the best merged model over the held-out set.
DARE (Yu et al., ) reduces noise by randomly pruning parameters following a Bernoulli distribution with probability $p$.
The remaining parameters are then rescaled by $\nicefrac{{1}}{{(1-p)}}$ to account for scale lost from pruned parameters.
Afterwards, DARE typically employs sign-resolution of TIES (specified by DARE-TIES).
To account for its random pruning step, we run all DARE experiments across five separate seeds and pick the merged model with the best performance over a held-out validation set.
KnOTS can be coupled with merging methods such as these latter three by applying them directly on aligned $[V^{(i)}]^{T}$ parameters.
Note that we make an exception for methods like TIES (Yadav et al., ) that involve magnitude-based model pruning.
While model-scale is absent in $[V^{(i)}]^{T}$ (its row-wise magnitudes are $\leq 1$ by definition), it is retained in $\Sigma$.
Thus, we may apply such operations on $\Sigma[V^{(i)}]^{T}$, but merge using the newly pruned $[V^{(i)}]^{T}$s.
Additionally, we observe that applying KnOTS on TA reduces to performing TA:
$\sum_{i=1}^{n}\alpha^{(i)}\Delta W_{j}^{(i)}=\sum_{i=1}^{n}\alpha_{i}U\Sigma[V
_{j}^{(i)}]^{T}=U\Sigma\sum_{i=1}^{n}\alpha_{i}[V_{j}^{(i)}]^{T}$.
Thus, KnOTS on TA can be considered a generalization of TA: KnOTS reduces to the standard merging method when its alignment is not leveraged.
We refer to all methods we apply KnOTS to by prefixing their names with KnOTS (e.g., KnOTS on TIES is denoted by KnOTS-TIES).
Inspired by the recommendations made by each merging baseline, we tune hyperparameters such as scaling-coefficient, top-$k$ and DARE-pruning-co-efficient as described in App. C. Note: KnOTS does not require any new hyperparameter to be tuned apart from the ones used by the original merging methods.

In some experiments, we add the “Ensemble” as a baseline, which consists of all models used in a particular merging evaluation.
The ensemble passes an input in parallel to all models, and predicts its class according to the highest confidence prediction across all models.

#### 5.1.0.3 Metrics.

We report the absolute accuracy of all individual finetuned models on their respective datasets, and utilize these for merging.
Similar to Ilharco et al. (); Yadav et al. (), we compare our merging methods via “normalized-accuracy” wherever applicable.
This is obtained by dividing the performance of a merged model on a task (e.g., Cars (Krause et al., )) by the performance of the original model finetuned on the task.
For instance, the normalized accuracy for a given task-i is computed as $\frac{\text{Accuracy of merged model on task-i}}{\text{Accuracy of finetuned
model on task-i}}$.
This metric shows how close the merged model gets to the original finetuned model for each task.
Certain experiment settings study different generalization properties and thus have different metrics.
For the remainder of this paper, we assume all accuracy measurements are normalized, and define other metrics in their relevant sections.

**Table 1: Eight models per-task results. We merge eight ViT-B/32 models finetuned with LoRA on different image classification datasets. “Finetuned” refers to the accuracy of each finetuned model on the dataset it was trained on. We report the per-task (including the average) normalized-accuracies across other merging baselines. These describe how close they get to the “Finetuned” accuracy. KnOTS-TIES improves over baselines by up to 4.3% average accuracy.**
| Method | Datasets |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|  | Cars | DTD | EuroSAT | GTSRB | MNIST | RESISC45 | SUN397 | SVHN | Avg |
|  | Per-Task Absolute Accuracies (%) |  |  |  |  |  |  |  |  |
| Finetuned | 74.0 | 58.3 | 99.0 | 92.7 | 99.3 | 88.4 | 64.5 | 96.2 | 84.1 |
|  | Per-Task Accuracies of Merged Models Normalized Against Finetuned Models (%) |  |  |  |  |  |  |  |  |
| RegMean | 80.2 | 71.3 | 37.9 | 47.3 | 43.1 | 70.5 | 93.9 | 43.0 | 60.9 |
| TA | 82.0 | 73.6 | 48.8 | 42.1 | 53.1 | 71.5 | 97.5 | 41.2 | 63.7 |
| TIES | 82.2 | 72.8 | 50.0 | 36.8 | 56.8 | 69.4 | 96.9 | 44.6 | 63.7 |
| DARE-TIES | 81.4 | 74.5 | 50.8 | 39.2 | 55.0 | 70.7 | 97.6 | 40.1 | 63.7 |
| KnOTS-TIES | 82.7 | 73.7 | 49.3 | 48.9 | 68.9 | 70.9 | 95.5 | 53.8 | 68.0 |
| KnOTS-DARE-TIES | 81.8 | 75.9 | 50.7 | 40.3 | 53.2 | 70.2 | 97.9 | 41.0 | 63.9 |

### 5.2 Per-task evaluations on vision and nlp settings

We first compare KnOTS’s ability to improve existing merging methods in the popular “per-task” experiment settings (Ilharco et al., ; Yadav et al., ; Tang et al., ).
These settings comprise of merging a set of models independently finetuned on different datasets into a single model, and then evaluating it on each dataset independently—using only its examples and labels.
This way, the merged model is judged on its ability to preserve the individual skills of each original model.

#### 5.2.0.1 Merging eight ViT-B/32 models finetuned on image classification datasets.

We follow the image classification benchmark from Ilharco et al. () and merge models finetuned on eight different datasets: Cars (Krause et al., ), DTD (Cimpoi et al., ), EuroSAT (Helber et al., ), GTSRB (Stallkamp et al., ), MNIST (LeCun, ), RESISC45 (Cheng et al., ), SUN397 (Xiao et al., ) and SVHN (Netzer et al., ).
Like Ilharco et al. (); Yadav et al. (), we report normalized per-task accuracies and their average.
Tab. 1 reports merging performances.
Interestingly, nearly all merging methods achieve comparable performance. However, applying KnOTS on both TIES and DARE-TIES elevates their respective performances, with KnOTS-TIES strengthening TIES by 4.3 % average normalized accuracy.
Note, we also compare against a popular gradient-based approach—Fisher weight averaging (Matena & Raffel, ) in App. E and achieve considerable gains, though gradient-based merging is not our focus.

Figure: Table 2: Normalized per-task avg. image classification results. We merge eight ViT-L/14 models finetuned with LoRA on eight vision datasets. We report the average normalized accuracies against average absolute accuracy of the finetuned models: 92.3%. KnOTS is the best.

#### 5.2.0.2 KnOTS scales to ViT-L/14 models.

We also evaluate how KnOTS is affected by merging larger vision models.
Specifically, we merge eight ViT-L/14 models finetuned with LoRA on the same datasets as our ViT-B/32 counterparts.
We then evaluate the merged model’s normalized per-task accuracies over each dataset.
Results for several merging methods are summarized in Tab. 5.2.0.1.

While performance of all merging methods improve with the larger models, KnOTS notably consistently outperforms the baselines in both KnOTS-TIES and KnOTS-DARE-TIES.
KnOTS-TIES is still capable of improving TIES by 3%, showing its ability to maintain performance with scale.

Figure: Table 3: Normalized per-task avg. NLI results. We merge six Llama3-8B models finetuned with LoRA on different NLI datasets. All numbers are normalized against the absolute average per-task accuracy of the individual finetuned models: 92.9%. KnOTS performs best.

#### 5.2.0.3 KnOTS performs well on LLMs.

We also evaluate KnOTS in the NLI setting, by merging six PEFT Llama3-8B (AI, ) models finetuned on SNLI (Bowman et al., ), MNLI (Williams et al., ), SICK (Marelli et al., ), QNLI (Wang et al., ), RTE (Wang et al., ), and SCITAIL (Khot et al., ).
Each of these tasks involves performing a 3-way classification to determine whether a given “hypothesis” is true (entailment), false (contradiction) or inconclusive (neutral) compared to a given “premise.”
QNLI, RTE and SCITAIL only employ two of the three classes, so we simply mask the missing label when finetuning and evaluating on these datasets.
Tab. 5.2.0.2 shows the results of merging these models using TA, TIES, DARE-TIES, KnOTS-TIES and KnOTS-DARE-TIES.
Overall, we observe that KnOTS-TIES significantly outperforms baseline merging methods by up to 2.9% average normalized accuracy, and KnOTS-DARE-TIES further improves DARE-TIES by .2%.
This demonstrates the power of utilizing KnOTS to align LoRA models even on dramatically larger models (8B parameters), and its robustness across modalities.

### 5.3 A new benchmark towards building general models

Figure: Table 4: Eight models joint-task results. We merge eight ViT-B/32 models finetuned with LoRA on different datasets. We report the joint-task “Union” performances for several merging methods. KnOTS performs the best.

We further introduce a new experimental setting to the eight vision per-task benchmark in Tab. 1, that we call the “joint-task.”
This task differs from the “per-task” regime in that it evaluates merged models over the union of all inputs and labels across the eight vision-tasks.
The joint-task is significantly more challenging than the per-task counterpart as it explicitly examines whether a merged model is a general model: whether it can classify an image across labels associated with all tasks.

After aggregating the labels across all eight tasks and removing duplicates (e.g., MNIST (LeCun, ) and SVHN (Netzer et al., ) have the same labels), we obtain 748 unique labels over which to classify all the images across all datasets.
As some labels in one task are hyponyms of those in another (e.g., “islet” in SUN397 (Xiao et al., ) and “island” in RESISC45 (Cheng et al., )) making it challenging to distinguish labels, we report performance using “Hits@$k$.” This refers to the number of times the expected label is within the top-$k$ predictions of a model (e.g., Hits@$1$ is accuracy).
Tab. 5.3 shows the results over the “Union” of all images and labels across all tasks, when merging our ViT-B/32 LoRA models.
Please see App. F for performances broken down by dataset.
Overall, KnOTS-TIES significantly outperforms every baseline at all Hits@$k$ levels on the extremely challenging “Union” evaluation—by up to 3.2% on Hits@1.
Interestingly, we also observe that the ensemble performs particularly poorly in the joint setting.
We posit this is due to certain models making over-confidently incorrect predictions on data from tasks they are not finetuned on, a notable issue in ensemble models (Kardan et al., ).
We argue that the joint-task is an important benchmark for assessing a merged model’s
generality,
and we hope future work expands upon it.

### 5.4 Additional analysis & ablations

Figure: Figure 3: KnOTS boosts performance with scale. KnOTS-TIES continues to see gains, outperforming original TIES (Yadav et al., ) and Task Arithmetic (TA) (Ilharco et al., ) when merging an increasing number of tasks in the per-task evaluation vision setting § 5.2. Performance is the average normalized accuracy with 95% confidence intervals over merging different combinations of the tasks
Refer to caption: extracted/5911915/figures/new_scale_figurev2.png

We also conduct three analysis experiments to understand different facets of KnOTS.
We conduct our analysis with KnOTS-TIES as it consistently achieves the best performance across all settings.

#### 5.4.0.1 KnOTS scales better with the number of models.

Following Ilharco et al. (); Yadav et al. (), we evaluate the performance of KnOTS on the eight per-task vision benchmark with our ViT-B/32 models as we increase the number of tasks being merged. Fig. 4 illustrates the same measuring performance with average normalized accuracies of the merged model, where the dots represent the performance of a model evaluated only on the tasks included in the merge, while the bars indicate the $95\%$ confidence intervals based on random subselection of 28 task combinations.

Notably, KnOTS-TIES achieves significantly better merging results compared to the baselines, with a performance gap that remains consistently $>4\%$ (for $>2$ tasks being merged), underscoring its robustness as the number of tasks increases.

#### 5.4.0.2 KnOTS is robust to different LoRA ranks.

Fig. 4 shows the performance of KnOTS-TIES against TIES (Yadav et al., ) in merging our ViT-B/32 models trained at various LoRA ranks {4, 16, 64, 256, 768} on the eight per-task vision benchmark.
Note that these ViTs each have a feature dimension of 768, making our LoRA rank 768 setting “full rank”.
The results consistently demonstrate that KnOTS-TIES outperforms TIES across all rank settings.
In the very low rank setting (e.g., rank four), KnOTS improves TIES by 6% (64.6% normalized accuracy vs. 58.6%).
The performance uplift continues with increasing LoRA rank, with KnOTS improving TIES by 4% in the full rank setting.
This experiment highlights how KnOTS is both robust and scalable to merging models finetuned on diverse tasks with arbitrary LoRA rank.

#### 5.4.0.3 The way task-updates are concatenated matters.

KnOTS concatenates task-updates column-wise before computing the SVD.
In this experiment, we investigate the effects of concatenating them row-wise instead.
We conduct our analysis using the same vision models from Tab. 1 and merge them with KnOTS-TIES.
We observe that applying KnOTS-TIES after concatenating the rows of the task-updates achieves an average normalized accuracy of 65.4%.
It performs 2.6% worse than KnOTS-TIES with column-wise task-update concatenation.
We posit this may be due to the difference in the deconstructed task-update terms when concatenating them row-wise.
Specifically, each update would be denoted by $\Delta W_{j}^{(i)}=U^{(i)}\Sigma V$, where $\Sigma V$ are shared across all updates with different $U^{(i)}$.
In this way, the shared $\Sigma V$ would act on distinct $U^{(i)}$ containing different information—which in turn may lower alignment.
These results suggest that concatenating the updates column-wise is crucial to obtaining strong performance with KnOTS.

## 6 Conclusion

In this paper, we study merging LoRA models sharing the same pretrained checkpoint and finetuned on different tasks without additional finetuning.
We find that prior work does not transfer well in this setting, and observe that
this is due to parameter misalignment between LoRA models.
We introduce KnOTS to tackle this problem by using the singular value decomposition (SVD) to map the parameters of each LoRA model into a shared representation space with aligned elements, over which prior work can be applied to merge the parameters.
In addition, we introduce a novel benchmark designed to evaluate whether merged models can be general.
Notably, KnOTS improves prior work by up to 4.3% across both vision and language settings, including our new setting.

## Appendix A Which LoRA representation is best for merging?

LoRA is a popular Parameter Efficient Finetuning (PEFT) method that finetunes models by applying low-rank updates to the pretrained parameters.
For instance, let $W_{j}^{(i)},\Delta W_{j}^{(i)}\in\mathbb{R}^{O\times I}$.
With LoRA, each $\Delta W_{j}^{(i)}$ is rank $r<<\min(O,I)$, and can be factorized into two low-rank matrices $A_{j}^{(i)}\in\mathbb{R}^{r\times I},B_{j}^{(i)}\in\mathbb{R}^{O\times r}$, with $\Delta W_{j}^{(i)}=B_{j}^{(i)}A_{j}^{(i)}$.
The existence of $A_{j}^{(i)},\text{ and }B_{j}^{(i)}$ for each $\Delta W_{j}^{(i)}$ may suggest that merging should be done on them separately, and the results multiplied to achieve the merged-update $\Delta W_{j}^{(m)}$.
However, this immediately leads to issues when applying existing merging methods.
For instance, let us apply task-arithmetic (TA) (Ilharco et al., ) on a single arbitrary layer (e.g., the $j^{th}$ layer) across $f^{(1)},\ldots,f^{(n)}$.
First, TA merges the factorizations of $\Delta W_{j}^{(1)},\ldots,\Delta W_{j}^{(n)}$ by computing $\sum_{i=1}^{n}\lambda^{(i)}A_{j}^{(i)},\sum_{i=1}^{n}\lambda^{(i)}B_{j}^{(i)}$.
Multiplying each to obtain $\Delta W_{j}^{(m)}$ yields,

$$ $\displaystyle\Delta W_{j}^{(m)}$ $\displaystyle=\left(\sum_{i=1}^{n}\lambda^{(i)}B_{j}^{(i)}\right)\left(\sum_{i =1}^{n}\lambda^{(i)}A_{j}^{(i)}\right)$ (3) $\displaystyle=\underbrace{\left(\sum_{i=1}^{l}\lambda^{(i)}\lambda^{(i)}B_{j}^ {(i)}A_{j}^{(i)}\right)}_{\text{Products of aligned factorizations}}+ \underbrace{\left(\sum^{l}_{i\neq k}\lambda^{(i)}\lambda^{(k)}B_{j}^{(i)}A_{j} ^{(k)}\right)}_{\text{Products of misaligned factorizations.}}.$ (4) $$

Notably, $\Delta W_{j}^{(m)}$ consists of two terms: one composed of $B_{j}^{(i)}$ and $A_{j}^{(i)}$ matrices from the updates of the same model, and one composed of $B_{j}^{(i)}$ and $A_{j}^{(k)}$ matrices from updates of different models.
Unfortunately, there is no guarantee that $B_{j}^{(i)}$ expects the same input representation as the output of $A_{j}^{(k)}$ when $i\neq k$, and including these terms in the merged model can incur significant drop in model performance (Stoica et al., ).
Similarly, this same issue persists as well when applying (Yadav et al., ).
Thus, we only conduct merging on the original update representations: $\Delta W_{j}^{(i)}$ of each model.
This trivially avoids mismatches when applying merging methods.

## Appendix B Computing centered kernel alignments across tasks

We create the pairwise centered kernel alignment (CKA) (Kornblith et al., ) matrices presented in Fig. 2 using models that are finetuned from the same pretrained checkpoint on the different tasks shown in Tab. 1.
Each matrix is generated using a set of unlabeled heldout data from all eight datasets.
Specifically, this heldout set consists of the validation data of the respective dataset when it exists and otherwise randomly samples 20% of the test set.
Note that in situations where we sample 20% of a dataset’s test split, we always evaluate any merged model on the remaining 80% of examples.
For fair comparison, all CKA plots are created using the same data.

#### B.0.0.1 Pairwise CKA on full-rank finetuned models.

We compute Fig. 2a as follows.
We first take the set of eight full-rank finetuned (FFT) ViT-B/32 (Dosovitskiy et al., ) models released by Ilharco et al. (), along with their shared pretrained model.
We then collect the intermediate outputs of every key, query, value and projection layer across all nine models over all the data from our heldout set.
This yields nine different intermediate activations for each layer across all models.
We then subtract the activations of the pretrained model from the eight activations of the finetuned models, at every layer.
We then compute the CKA (following (Kornblith et al., )) between activations of two different models at every layer, across all model pairs.
Finally, we average the results over all layers.

#### B.0.0.2 Pairwise CKA on LoRA finetuned models.

We compute Fig. 2b as follows.
We first take the set of eight LoRA models we merge in in Tab. 1, and extract the intermediate activations over all LoRA layers of each model and over the same data used in our FFT CKA plots.
Specifically, these layers are every key, query, value and projection layer of each model.
Since LoRA finetuning adds new parameters to a pretrained model, there are no layers from the pretrained model to subtract. ®
Thus, we directly compute CKA over the activations at the same layer across LoRA model pairs, and average over all layers.

#### B.0.0.3 Pairwise CKA on LoRA finetuned models aligned with KnOTS.

We compute Fig. 2c as follows.
This procedure is extremely similar to computing the CKAs for LoRA finetuned models, with one small difference.
Specifically, rather than computing the CKAs from the output activations of LoRA layers, we instead calculate the CKA over the outputs of different $[V^{(i)}]^{T}$ for the same layer of different LoRA models (using the same data again).
Afterwards, we average the results across all layers.

## Appendix C Tuning the hyperparameters for different merging baselines

Scaling co-efficient: A single scalar scaling co-efficient is tuned across the range [0.1, 0.2, 0.3,…, 1.0]

top-$k$ : Like Yadav et al. (), we define top-$k$ the percentage of task-update elements retained when merging. It is tuned across the range [10, 20, 30,…, 100]

DARE-pruning co-efficient ($p$): [0.99, 0.9, 0.8, …, 0.1]

DARE-Seeds: We evaluated DARE over the following five seeds: [420, 421, 422, 423, 424].

For methods such as TIES (Yadav et al., ) and DARE (Yu et al., ) which involve tuning more than one scaling co-efficient we tune by performing a linear-search by first tuning the scaling co-efficient and then the corresponding pruning hyperparameter i.e top-$k$ for TIES and DARE-pruning co-efficient for DARE. The default value used for TIES top-$k$ is 30 and for the DARE-pruning co-efficient is 0.9 as recommended by their respective baselines.

## Appendix D Training details

In this section, we specify the details associated with training the LoRA models used across all experiments in § 5.1.

#### D.0.0.1 Training Vision models.

We make use of the CLIP (Radford et al., ) based ViT-B/32 and ViT-L/14 models from Hugging Face (HF). These models are then LoRA fine-tuned using HF’s PEFT LoRA library. Across all our experiments we initialize the LoRA layers across the query, key, value and output layer. Note that these are the only learnable layers. We set the LoRA rank to be 16, LoRA alpha to be 16, LoRA dropout to be 0.1 and disable the use of bias parameters.
All models are trained using the AdamW (Loshchilov & Hutter, ) optimizer, with a cosine learning rate scheduler (Loshchilov & Hutter, ) using Cross-Entropy loss.

The ViT-B/32 models were fine-tuned on the 8 vision tasks using a standard learning rate of 1e-5, weight decay of 1e-1 and label smoothing set to 0.

The ViT-L/14 models were fine-tuned on the 8 vision tasks using a standard learning rate of 3e-4, weight decay of 1e-4 and label smoothing set to 0.

Across all our experiments the text encoder in the CLIP-model remains frozen and the text embeddings are obtained by passing the class labels through the text encoder.

#### D.0.0.2 Training LLMs on NLI tasks.

For the setting in § 5.2 we use the LLama-3 8B parameter model. We initialize the model using the “AutoModelForSequenceClassification” model class from Hugging Face’s“AutoModel” to classify across 3 classes. The models are LoRA fine-tuned using the PEFT LoRA library. We initialize rank-16 LoRA weights across the weights of the attention layer only i.e the query, key, value and output layer. The models were trained using AdamW (Loshchilov & Hutter, ) optimizer using a linear learning rate scheduler, with a learning rate of 3e-5 and warm steps set to 6% of the total number of training steps.
For datasets like QNLI (Wang et al., ), RTE (Wang et al., ) and SCITAIL (Khot et al., ) which only employ two of the three classes, we simply mask the missing label when finetuning and
evaluating on these datasets.

During merging we only merge the Llama back-bone with the LoRA layers and use task-specific head when evaluating across each dataset. Even for the merged model we use the merged backbone and task-specific head during evaluation.

#### D.0.0.3 Compute resources.

All of our experiments were conducted on machines with one Nvidia A40 with 48GB of VRAM, and a CPU that has 8 workers.
We trained all our models across these machines, and also applied every merging algorithm in this environment.
KnOTS is capable of running entirely on the CPU.
We compute the SVD using the Pytorch (Paszke et al., ) “torch.linalg.svd” solver.
However, we note that more efficient SVD algorithms can easily be employed with our approach, such as the recent Fast SVD (Xu et al., ) which is designed for low-rank matrices.

#### D.0.0.4 Datasets and licenses.

This paper uses the following datasets and associated licenses.
Cars (Krause et al., ) and GTSRB (Stallkamp et al., ) both use the Creative Commons License.
EuroSAT (Helber et al., ) is under the MIT license and MNIST (LeCun, ) is under the Gnu General Public License.
We could not find the licenses of DTD (Cimpoi et al., ), RESISC45 (Cheng et al., ), SVHN (Netzer et al., ) and SUN397 (Xiao et al., ).

## Appendix E Comparison with a finetuning benchmark

**Table A1: Eight models per-task results including Fisher weight averaging. We merge eight ViT-B/32 models finetuned with LoRA on different image classification datasets. “Finetuned” refers to the accuracy of each finetuned model on the dataset it was trained on. We report the per-task (including the average) normalized-accuracies across other merging baselines. These describe how close they get to the “Finetuned” accuracy.**
| Method | Datasets |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|  | Cars | DTD | EuroSAT | GTSRB | MNIST | RESISC45 | SUN397 | SVHN | Avg |
|  | Per-Task Absolute Accuracies (%) |  |  |  |  |  |  |  |  |
| Finetuned | 74.0 | 58.3 | 99.0 | 92.7 | 99.3 | 88.4 | 64.5 | 96.2 | 84.1 |
|  | Per-Task Accuracies of Merged Models Normalized Against Finetuned Models (%) |  |  |  |  |  |  |  |  |
| RegMean | 80.2 | 71.3 | 37.9 | 47.3 | 43.1 | 70.5 | 93.9 | 43.0 | 60.9 |
| Fisher | 84.5 | 72.4 | 44.4 | 55.8 | 47.8 | 70.9 | 96.1 | 39.2 | 63.9 |
| TA | 82.0 | 73.6 | 48.8 | 42.1 | 53.1 | 71.5 | 97.5 | 41.2 | 63.7 |
| TIES | 82.2 | 72.8 | 50.0 | 36.8 | 56.8 | 69.4 | 96.9 | 44.6 | 63.7 |
| DARE-TIES | 81.4 | 74.5 | 50.8 | 39.2 | 55.0 | 70.7 | 97.6 | 40.1 | 63.7 |
| KnOTS-TIES | 82.7 | 73.7 | 49.3 | 48.9 | 68.9 | 70.9 | 95.5 | 53.8 | 68.0 |
| KnOTS-DARE-TIES | 81.8 | 75.9 | 50.7 | 40.3 | 53.2 | 70.2 | 97.9 | 41.0 | 63.9 |

We also compare KnOTS against the popular finetuning benchmark Fisher Weight Averaging (Matena & Raffel, ) in the same setting as Tab. 1.
We classify this method as finetuning because it adds learnable parameters to every model that are optimized via gradient descent to obtain the best merged model.
We select the best reported Fisher model according to the hyperparameter configuration which achieved the best performance on the same held-out validation data as all methods in this setting.
Our hyperparameter search consisted of two ranges.
First, the number of examples used to compute the Fisher information matrices: [256, 512, 1024, 2048] (selected from the training data of each dataset).
Second, the scaling term to merge model parameters: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9].
The best performing configuration on our held-out validation dataset used a scaling coefficient of 1.0 and required 256 examples to compute the Fisher weights.
Tab. A1 summarizes the results.
Overall, we observe that while Fisher matches TIES, it is substantially outperformed by KnOTS—a method that doesn’t require any training.

## Appendix F Joint task full performances

Tab. A2 shows performances for each merging method across all datasets on the Joint-task.
Each dataset column shows results on images only from the dataset, but with using the joint labels-set of 748 labels.

Table: Table A2: Eight models joint-task results. We merge eight ViT-B/32 models finetuned with LoRA on different datasets. We report the joint-task performances for several merging methods. KnOTS-TIES improves over baselines by significant margins across across nearly every evaluation, often only trading best performances with the “Ensemble.”

#### F.0.0.1 Finding synonymous labels.

After removing duplicates from the joint label space, we are left with 748 total labels.
However, a manual search over these labels reveals that some may be synonyms/hyponyms of each other.
To get a better idea of how many there are, we encode each label using a pretrained “distilbert-base-nli-mean-tokens” model taken from the SentenceTransformers library (Reimers & Gurevych, ), and compute the pairwise cosine-similarities between each label.
We then take all label pairs with cosine-similarity $\geq 0.8$ to be “synonyms,” and reproduce them at the bottom of this section in dictionary form where keys and values are tuples containing “(label, dataset origin).”
In total, we find 111 synonyms, leading to an average of $0.15$ synonyms per-label and $1.95$ synonyms per-labels that have synonyms.
Thus, measuring performance on the joint-task using “Hits@k” with $k=\{1,3,5\}$ appears to be a suitable choice.

Below we print all synonyms found by our automatic search.

## Peer Reviews

confidence: 3
contribution: 3
initial_rating: 8
presentation: 3
questions: Please check the weakness.
soundness: 3
strengths: 1.  The concept of using SVD to align model weights for improved merging is novel and practical, addressing a previously unexplored limitation in merging LoRA models.
2. The paper is generally well-structured, with clear descriptions of both the KnOTS methodology and experimental setups.
summary: The paper titled "Model Merging with SVD to Tie the Knots" explores the challenge of merging Low-Rank Adaptation (LoRA) finetuned models. While model merging has shown success in combining fully-finetuned task-specific models, the same methods often fail when applied to LoRA finetuned models due to misaligned weight structures. To address this, the authors introduce KnOTS, a technique that employs Singular Value Decomposition (SVD) to align LoRA model weights, thereby improving the effectiveness of existing merging methods. KnOTS demonstrates up to a 4.3% improvement in merging performance across vision and language benchmarks. Additionally, the paper presents a new benchmark for assessing the generality of merged models, which evaluates their performance on a joint dataset combining multiple tasks.
weaknesses: 1. It would be beneficial if the authors could validate the effectiveness of the method on larger LLMs, such as LLaMA and Qwen2, for more in-depth evaluation.
2. Although the method is effective, the improvements are limited.

---

confidence: 3
contribution: 2
initial_rating: 3
presentation: 2
questions: See in Weaknesses.
soundness: 2
strengths: * Model merging, specifically for LoRA models, is an interesting and cutting-edge field, with related techniques being widely proposed and explored in recent years.
* KnOTS shows excellent performance across both vision and language tasks, enhancing merged model effectiveness and enabling better generalization on the newly introduced benchmark for multi-task data.
summary: The paper "Model Merging with SVD to Tie the Knots" proposes KnOTS, a method to improve merging of LoRA-finetuned models, which traditionally struggle with alignment compared to fully-finetuned models. KnOTS uses SVD to align task-specific updates into a shared space, making it easier to merge LoRA models effectively with existing techniques. The authors also introduce a benchmark to test whether merged models generalize across tasks, showing that KnOTS boosts merging performance by up to 4.3% across various benchmarks in vision and language.
weaknesses: * As far as I know, merging LoRA models using SVD is not a new technique; implementations have long been available in some open-source libraries and are widely used. Therefore, the innovation in this paper is questionable and appears limited. I'd like to know what are the differences and advantages of the techniques proposed in this paper compared to the SVD-based merging techniques in these libraries?

* The experimental work in this paper is insufficient and does not meet a certain standard; more experimental data is needed to support the authors' announced conclusions. Additionally, the writing quality needs improvement.

---

confidence: 3
contribution: 3
initial_rating: 6
presentation: 3
questions: 1. Can you analyze and discuss potential reasons for the discrepancy in performance gains between KnOTS-TIES and KnOTS-DARE-TIES?
2. Why is the better CKA alignment given by KnOTS not resulting in better performance with KnOTS-DARE-TIERS? Are there additional analyses you could run to better understand the relationship between CKA alignment and performance across different merging method?
3. Can you provide more insights into why row-wise KnOTS does not work?
soundness: 3
strengths: 1. The authors show that CKA representations seem to align with model merging abilities, without some limitations given by orthogonality approaches.
2. The authors propose to merge the LoRA weights after SVD, and showcase better performance than using existing full-rank approaches.
3. The authors propose to evaluate merged models on a multi-task benchmark that they obtained by combining the individual datasets in Ilharco et al. (2023).
summary: This paper introduces a new technique to merge the parameters of different LoRAs onto the same model weights. The authors first show that CKA representations better align with the ability to merge model weights, both for fully fine-tuned approaches as well as LoRA-based ones. Then, they propose to use SVD to align the subspaces of different LoRAs. After doing so, the resulting matrices can be merged into a single model by applying previous techniques. The authors show that their approach better merges LoRA weights into a single model, for both vision tasks and language tasks.
weaknesses: 1. While the performance of KnOTS-TIERS is usually significantly better than TIERS, it is not the case for DARE-TIERS. This is not discussed in the paper, and it would be good to understand this behavior.
2. While the CKA alignment given by using KnOTS is significantly better than by the original LoRA weights, the performance improvements (e.g. on DARE-TIERS) are less pronounced, leaving the reader wondering whether CKA is indeed a good-enough metric for weight alignment.
3. The authors should down-weight their “novelty” contributions towards creating a new benchmark by simply putting together the datasets of a previous benchmark. The benchmark itself is a contribution of the paper, but not one that the reviewer feels should be stressed as much. For example, you could present it as a useful extension rather than a major novel contribution.

---

confidence: 4
contribution: 2
initial_rating: 6
presentation: 3
questions: * What is the motivation for performing merging operation on V matrix from SVD?
* Does the author believe that merging methods would have a greater negative impact if the base model’s zero-shot performance were lower?
* Is it possible to compare merged models performance to multi-task model performance on all the datasets?
soundness: 3
strengths: * CKA analysis provided in the beginning to show misalignment of weights in LoRA provides good motivation to develop specialized method for merging LoRA trained models.
* Proposes a merging method for combining LoRA modules using SVD decomposition on weight update matrix. Shows improvements over different merging baselines for both vision and language tasks. 
* KnoTs demonstrates superior scalability compared to other methods, particularly as the number of merged models increases.
summary: This paper introduces a method called KnoTs which provides a strategy for merging LoRA modules. First the authors show that centered kernel alignment (CKA) between activations of LoRA modules is not as high as that of fully fine-tuned models, demonstrating the need for developing methods specially for merging LoRA modules. They propose to perform SVD on the task updates and perform merging operation on V matrix in the SVD which is known to contain task specific information. First they show that CKA on these V matrix is high and this would eventually help in improving merged model performance. They run experiments on both vision and language tasks to demonstrate the effectiveness of the method and their method achieves better normalized accuracy in comparison to other SOTA methods specially designed for merging fully fine-tuned models.
weaknesses: * This method doesn't allow merging of LoRA modules with different ranks.
* The datasets used in this work are selected to ensure strong baseline performance, where models like ViT and Llama already demonstrate high zero-shot accuracy. This high initial performance makes it challenging to quantify the specific gains achieved through the proposed method.
* Multi-task trained performance should be considered as one of the baseline to understand how far is the merging performance from multi-task performance.

Meta-review: This paper proposes a method for model-merging that is designed for LoRA-finetuned models. Although methods such as TIES and DARE are well known for model-merging, they do not perform well for LoRA-trained models. The authors show that this is because LoRA-parameters are not well aligned between different tasks (as measured by the centred kernel aligned (CKA)), which is different from fully-finetuned models (which is also intuitive, given that LoRA parameters are trained completely from scratch, whilst finetuned models typically all use the same pretraining). To address this problem, the authors first align parameters from different tasks by performing a singular value decomposition (SVD) across all of the tasks. After this, existing model-merging approaches (ie TIES, DARE) can be applied on the aligned weights.

Reviewers appreciated that this is a timely problem, and that the method is simple but effective. The authors addressed the reviewers' comments during the rebuttal, and also revised their paper according to the rebuttal. The most negative review, from Reviewer c5rA who claimed that the SVD has already been used to align weights for model mergining turned out to be a misunderstanding. Therefore, the decision is to accept the paper.

Decision: Accept (Poster)