Purifying Task Vectors in Knowledge-Aware Subspace for Model Merging

Bang An, Yibo Yang, Philip Torr, Bernard Ghanem

TL;DR

Model merging allows us to combine multiple specialized neural networks into a single multi-task model without expensive retraining, but it often suffers from performance degradation due to parameter interference. This paper introduces PAVE (Purifying TAsk VEctors), a plug-and-play method that uses context-oriented singular value decomposition (SVD) to isolate and prune task-irrelevant noise in a "knowledge-aware subspace." By filtering out this redundancy, PAVE drastically reduces conflicts during merging, achieving near-individual-model performance across language, code, and vision tasks.

What Problem Does This Paper Address?

When we fine-tune a pre-trained base model on a specific task, the difference between the fine-tuned weights and the base weights is called a task vector. In theory, adding multiple task vectors together should yield a model capable of handling all those tasks simultaneously.

In practice, however, task vectors contain a massive amount of task-irrelevant redundancy and noise. When you merge multiple models, these redundant components clash, causing severe interference and degrading the final model's performance. Prior attempts to fix this (like the DARE method) randomly drop elements in the raw parameter space. The authors point out two flaws with this approach: it lacks "knowledge awareness" (it treats all parameters as equally important), and task-specific abilities are typically tangled within low-rank subspaces rather than neatly separated element-wise.

Methods

PAVE solves this by purifying task vectors within a knowledge-aware subspace before the merging process begins. The pipeline consists of three core steps:

  1. Context-Oriented SVD (CO-SVD): Instead of performing standard SVD on raw weight matrices, the authors pass a small sample of training data through each fine-tuned model to calculate the input activation covariance matrix ($C = XX^T$) for each linear layer. They then perform SVD on the product of the weights and this covariance matrix ($W_{FT}C$). This ensures that the resulting singular vectors are ordered precisely by their contribution to the target task.
  2. Subspace Pruning: By keeping only the top $r$ singular values, PAVE cleanly separates the task-relevant knowledge from the redundant noise and reconstructs a "purified" task vector.
  3. Spectral Rank Allocation: Rather than pruning every layer or model uniformly, PAVE uses a greedy optimization strategy to dynamically allocate rank budgets across different models, minimizing the overall pruning error.
Conceptual comparison between Naive, DARE, and PAVE task vectors
Overall pipeline of the PAVE method

Datasets

The authors evaluated PAVE across three distinct modalities using several standard benchmarks:

  • Natural Language Processing (NLP): The GLUE benchmark (including CoLA, SST-2, MRPC, STSB, QQP, MNLI, QNLI, RTE) using RoBERTa-base and DeBERTa-base.
  • Mathematics & Coding: GSM8K and MATH for mathematical reasoning; HumanEval and MBPP for code generation, evaluated on LLaMA-2-7B.
  • Computer Vision: 8 image classification datasets (including SUN397, Cars, RESISC45, EuroSAT, SVHN, GTSRB, MNIST, DTD) using Vision Transformers (ViT-B/32, ViT-B/16, ViT-L/14).

Key Insights and Ideas

  • Data-Driven Geometry Wins: Standard SVD only captures the static structure of a weight matrix. By incorporating activation covariance ($W_{FT}C$), the decomposition adapts to the actual data distribution the model encounters, making it truly "knowledge-aware."
  • Noise Reduction Acts as an Optimizer: Pruning the lower-ranked singular values doesn't just compress the model—it actively improves multi-task merging by removing the "cross-talk" and interference between conflicting task vectors.
  • Strict Task Alignment: The authors proved that the subspace is highly task-specific. If you use data from an unrelated task (e.g., using CoLA data to generate the covariance matrix for a QNLI model), performance drops catastrophically, as shown in the decomposition curves below.
Pruning performance across different decomposition methods on QNLI

Key Results

PAVE acts as a highly effective plug-and-play enhancement for existing merging methods like Task Arithmetic, Ties-Merging, and EMR-Merging:

  • GLUE Benchmark (RoBERTa): Integrating PAVE with EMR-Merging boosted average performance from 80.18% to 84.28% (+4.10%), closing the gap to the individual models' average performance (85.55%). On the linguistic acceptability task (CoLA), performance skyrocketed from 39.96% to 60.42%.
  • Generative Tasks (LLaMA-2-7B): PAVE achieved the highest score on the HumanEval coding benchmark (35.4%), outperforming standard average merging and Task Arithmetic by +1.9% while maintaining stable performance on math tasks.
  • Vision Models: PAVE consistently provided a +0.5% accuracy boost across all evaluated Vision Transformer architectures.

Limitations and Future Work

  • Data Dependency: PAVE requires a small set of calibration data (typically 256–512 samples) from each target task to compute the covariance matrices. While small, this requirement prevents it from being a purely "data-free" model merging approach, which could pose challenges in strict data-privacy scenarios.
  • Computational Overhead: Computing SVDs across all linear layers of large language models introduces an initial computational cost. However, the authors note this is a one-time, training-free pre-processing step that remains highly efficient compared to any fine-tuning alternative.

Summary updated

BibTeX
@misc{an2025purifying,
  author = {Bang An and Yibo Yang and Philip Torr and Bernard Ghanem},
  title = {{Purifying Task Vectors in Knowledge-Aware Subspace for Model Merging}},
  year = {2025},
  eprint = {2510.14697},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.14697},
}
Figure