Backdoor Vectors: a Task Arithmetic View on Backdoor Attacks and Defenses in Model Merging

Stanisław Pawlak, Jan Dubiński, Daniel Marczak, Bartłomiej Twardowski · Submission to ICLR 2026 · Desk rejected

TL;DR

Model merging lets practitioners combine multiple fine-tuned models without retraining, but it opens the door to severe backdoor attacks. By framing backdoors through the lens of Task Arithmetic, this paper shows that backdoor attacks act just like task vectors: adding them injects malicious behavior, while subtracting them removes it. Using this framing, the authors introduce Sparse Backdoor Vectors (SBVs) to craft exceptionally resilient attacks and Injected Backdoor Vector Subtraction (IBVS) as a lightweight, zero-knowledge defense.

What Problem Does This Paper Address?

Model Merging (MM) combines weights from independently fine-tuned versions of a shared pre-trained base model (such as CLIP) into a single multi-task or robust single-task model. However, MM is vulnerable to poisoning: an adversary who contributes just one poisoned model can manipulate the merged model's output via hidden triggers.

Prior defense theories (such as the "Free Lunch" hypothesis) suggested that merging might naturally dilute or cancel out backdoors. This paper investigates whether that defense holds up, reveals why modern backdoor attacks persist through weight fusion, and explores how task vector arithmetic can both amplify attacks and provide plug-and-play defenses.

Methods

The authors introduce the concept of a Backdoor Vector (BV): $$\text{BV}^{(t)} = \theta^{(t)}_{\text{backdoored}} - \theta^{(t)}_{\text{clean}}$$ computed as the weight-space difference between a compromised model and a clean model trained on the same task. Based on this formulation, they propose two techniques:

  • Sparse Backdoor Vectors (SBV) (Attack): Adversaries combine multiple backdoor vectors into a single, highly concentrated attack vector. By applying a sign-consistency mask ($\text{SBV}_{\text{SC}}$) that retains only parameter updates that consistently point in the same direction across merged BVs, non-essential perturbations are stripped away. This concentrates the backdoor signal, preventing clean models from diluting it during merging.
  • Injected BV Subtraction (IBVS) (Defense): Because state-of-the-art backdoor attacks exploit shared adversarial vulnerabilities inherent to the base pre-trained model ($\theta_{\text{pre}}$), their vectors share structural alignments with simple injected triggers. Defenders can fine-tune an arbitrary clean dataset with a naive synthetic trigger (such as a white square or BadNets wavelet), compute its $\text{BV}_{\oplus}$, and subtract a scaled version ($\lambda_{\text{IBVS}} \cdot \text{BV}_{\oplus}$) during merging—suppressing unknown backdoors with minimal clean accuracy loss and zero knowledge of the actual attack.

Datasets

The authors evaluated their methods across standard vision benchmarks:

  • Adversary Tasks (single-task and multi-task): CIFAR-100 and ImageNet-100.
  • Clean Tasks (multi-task merging): Stanford Cars, SUN397, EuroSAT, GTSRB, and Oxford-IIIT Pets.
  • Backdoor Paradigms Tested: Localized patches (BadNets, BadMerging), smooth geometric warping (WaNet), full-image interpolation (Blend), and arithmetic task-vector poisoning (BadTV).

No new benchmark datasets were created; all tasks rely on standard publicly available image classification datasets.

Key Insights and Ideas

  • Backdoors as Vector Operations: Vector addition injects backdoors (Attack Success Rate rises sharply as scaling factor $\lambda_{\text{BV}}$ increases) without degrading clean task accuracy. Conversely, vector negation works as a defense.
  • Asymmetric Backdoor Transfer: Transfer across triggers is directional. Adding a BadNets injected trigger vector ($\text{BV}_{\oplus}$) boosts an inherent trigger attack ($\text{BV}_{\star}$), but the reverse does not hold. Similarly, smaller trigger patches reinforce larger trigger patches far more than larger ones reinforce smaller ones.
  • Inherent vs. Injected Triggers: Attacks exploiting inherent vulnerabilities of the pre-trained base model ($\text{M}_{\text{pre}}$) survive model averaging because benign models do not erase underlying foundational weaknesses. In contrast, classical injected triggers ($\text{BadNets}$) degrade rapidly unless reinforced by $\text{SBV}_{\text{SC}}$.
  • Sign Consistency Over Random Sparsity: Merging BVs naively (simple parameter averaging) yields minimal gain. Filtering by sign consistency isolates essential malicious updates, dramatically outperforming random sparsification ($\text{SBV}_{\text{RND}}$).

Key Results

  • Attack Potency via Merging ($\text{SBV}_{\text{SC}}$): In single-task merging (1 backdoored model + 9 clean models, $\lambda = 0.1$) on ViT-B-32:
  • For BadMerging on CIFAR-100, standard single BV yields 27.29% ASR, whereas $\text{SBV}_{\text{SC}}$ skyrockets to 97.21% ASR.
  • On ImageNet-100, BadMerging jumps from 84.01% ASR to 99.99% ASR with $\text{SBV}_{\text{SC}}$.
  • For classical BadNets (which normally fails completely after merging: 0.20%–0.26% ASR), $\text{SBV}_{\text{SC}}$ restores ASR to 12.23% on CIFAR-100 and 29.45% on ImageNet-100.
  • Defense Mitigation (IBVS):
  • Subtracting a generic white-square vector ($\text{IBVS}_{\square}$) reduces the ASR of standard BadMerging on CIFAR-100 from 27.29% down to 11.10% ($\Delta = -16.19\%$) and on ImageNet-100 from 84.01% down to 50.74% ($\Delta = -33.27\%$), incurring less than 1% degradation in clean accuracy.
  • When evaluated against adaptive attacks where the adversary knows the defense trigger, the defense holds as long as the defender scales the subtraction across the entire pool of merged models.

Limitations and Future Work

  • Architecture Scope: Experiments focus strictly on CLIP-like vision architectures (ViT-B-32, ViT-L-14, ConvNeXt) on classification benchmarks. Applicability to large language models (LLMs) and diffusion models remains to be verified.
  • Linear Additivity Assumption: The framework assumes task vectors operate in a linear mode connectivity regime around the pre-trained checkpoint; non-linear merging techniques or models trained far apart in weight space may violate this.
  • Defense Against Dense Blends: While IBVS handles patch, geometric (WaNet), and arithmetic (BadTV) backdoors well, it provides weaker mitigation against global additive blend attacks (e.g., Blend).

Summary updated

BibTeX
@misc{pawlak2025backdoor,
  author = {Stanisław Pawlak and Jan Dubiński and Daniel Marczak and Bartłomiej Twardowski},
  title = {{Backdoor Vectors: a Task Arithmetic View on Backdoor Attacks and Defenses in Model Merging}},
  year = {2025},
  eprint = {2510.08016},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.08016},
}
Figure