From Purity to Peril: Backdooring Merged Models From "Harmless" Benign Components

Lijin Wang

34th USENIX Security Symposium (USENIX Security '25) · Day 3 · ML and AI Security 3: Backdoors, Poisoning, Unlearning

Overview

In an era defined by the escalating scale of artificial intelligence models, particularly Large Language Models (LLMs), the traditional paradigm of training models from scratch has become prohibitively expensive in terms of both data and computational resources. This talk, presented by Lijin Wang, delves into a critical security vulnerability arising from an increasingly popular solution to this challenge: model merging. The research introduces a novel attack framework called MergeBackdoor, which demonstrates how an attacker can inject a backdoor into a final merged model by using upstream components that appear entirely benign and harmless when inspected individually.

Watch on YouTube · Slides

Visual summary for From Purity to Peril: Backdooring Merged Models From "Harmless" Benign Components by Lijin Wang
Visual summary for From Purity to Peril: Backdooring Merged Models From "Harmless" Benign Components by Lijin Wang

Key moments

  1. 0:00 Introduction to model merging and its benefits
  2. 2:00 Existing 'bad in, bad out' vulnerability in model merging
  3. 3:40 The novel 'benign in, malicious out' threat scenario
  4. 4:40 Introducing MergeBackdoor: a two-stage attack framework
  5. 5:40 Criticality of batch-by-batch updating for efficient training
  6. 7:40 Comprehensive evaluation setup across models and methods
  7. 8:40 MergeBackdoor successfully implants hidden backdoors without performance loss
  8. 9:50 Evaluating MergeBackdoor's robustness against various defenses

From Purity to Peril: Backdooring Merged Models From "Harmless" Benign Components

Speakers: Lijin Wang, Researcher (representing a collaboration with Hong Kong University of Science and Technology, Guo Ja University, Sinua University, and Gina University)

Conference: USENIX Security

YouTube: https://www.youtube.com/watch?v=tWj843v6B3o

Overview

In an era defined by the escalating scale of artificial intelligence models, particularly Large Language Models (LLMs), the traditional paradigm of training models from scratch has become prohibitively expensive in terms of both data and computational resources. This talk, presented by Lijin Wang, delves into a critical security vulnerability arising from an increasingly popular solution to this challenge: model merging. The research introduces a novel attack framework called MergeBackdoor, which demonstrates how an attacker can inject a backdoor into a final merged model by using upstream components that appear entirely benign and harmless when inspected individually.

The work directly challenges a fundamental assumption in model security—that ensuring the safety and integrity of individual components guarantees the safety of the composite system. By revealing a mechanism where individually clean models can collectively conspire to create a malicious outcome, MergeBackdoor uncovers a new and insidious threat vector. This "mental and coke-like reaction" as described by the speaker, where unexpected interactions between parameters give rise to harmful behaviors, underscores a profound shift in how we must approach the security of complex AI systems, demanding a re-evaluation of current security checks and trust models in the AI supply chain.

Background

▶ Watch: Introduction to model merging and its benefits (0:00)

The rapid growth in the size and complexity of AI models, especially large language models, has made training them from scratch an incredibly resource-intensive endeavor. This traditional approach necessitates vast datasets, extensive computational power, and significant time investment for each new task or capability. To circumvent these limitations, the research community has increasingly embraced model merging. This technique directly aggregates the parameters of multiple pre-trained single-task models, often referred to as upstream models, into a new multitask model. This method significantly reduces the need for additional data and dramatically cuts computational costs, allowing for the creation of versatile models by combining existing knowledge.

Prior studies have already highlighted critical security concerns within model merging, often summarized by the "beer and sewage reaction" analogy: if any upstream model is malicious, the merged model is highly likely to inherit those malicious behaviors. This includes scenarios where an attacker contributes an unaligned model, causing the merged model to exhibit misaligned behavior, or a backdoored model, which appears normal but acts maliciously when triggered by specific patterns. Such findings have historically led to a strong emphasis on rigorously checking the security of all upstream models before merging them, aiming to mitigate risks and prevent compromise of the final merged product. The prevailing assumption has been that if each upstream component is deemed safe, the resulting merged model will also be safe.

However, the research presented in this talk poses a more profound and unsettling question: what if each upstream model individually looks completely safe and benign, passing all standard alignment and backdoor checks, yet when merged, their parameters interact in unexpected ways to produce harmful behaviors in the final model? This scenario represents a far more insidious threat, as conventional security measures focused on individual component vetting would utterly fail to detect such a latent vulnerability. This question motivated the development of the MergeBackdoor framework, aiming to explore whether merging benign models could unintentionally—or intentionally, from an attacker's perspective—create a malicious one, and how such an attack could be practically realized.

Key Findings

▶ Watch: The novel 'benign in, malicious out' threat scenario (3:40)

The research successfully demonstrates the feasibility and robustness of backdooring merged models using individually benign components, presenting several critical findings:

  1. Emergent Malicious Behavior from Benign Components: The core finding is the successful implementation of MergeBackdoor, a framework that trains multiple upstream models. When these models are examined in isolation, they exhibit normal, benign behavior, showing no signs of compromise. However, once these "harmless" upstream models are merged using various common merging methods, the resulting multitask model reliably exhibits the intended backdoor behavior.
  2. Preservation of Clean Accuracy: Crucially, the implantation of the backdoor does not degrade the merged model's performance on clean, untriggered samples. This means the attack maintains the model's utility while harboring a hidden malicious capability, making it even harder to detect through performance monitoring alone.
  3. Robustness Across Diverse Settings: MergeBackdoor proves highly robust across a wide range of experimental conditions. This includes variations in weighting (relative coefficients during merging), scaling (task factors applied to pre-trained models), parameter reset (proportion of parameters reset during merging), and reproducibility (consistency across randomized algorithms). The backdoor effect persists as long as the merged model maintains reasonable performance on clean samples.
  4. Survival in Multi-Model Merging Scenarios: The attack scales effectively to more realistic scenarios involving the merging of many models. Even when only a subset of the upstream models are trained with MergeBackdoor, the malicious signal persists and propagates into the final merged model, demonstrating that adding numerous clean models to the merging pool does not dilute or eliminate the backdoor.
  5. Layer-Wise Backdoor Embedding and Obfuscation: A detailed layer-wise analysis reveals that MergeBackdoor embeds key backdoor information into specific layers of the upstream models. Furthermore, the framework actively blocks the propagation of this backdoor information within the individual upstream models (e.g., after layer 16 in ViT models), ensuring they remain benign when used alone. This sophisticated obfuscation is central to the attack's stealth.
  6. Failure of Existing Detection Methods: A critical and alarming finding is that current detection methods, even those with strong assumptions about potential triggers or knowledge of the MergeBackdoor attack, fail to reliably identify anomalies in the individual upstream models. This highlights a significant gap in current AI security defenses.

These findings collectively underscore a profound vulnerability in the model merging paradigm, necessitating a fundamental rethinking of trust and security in the AI development lifecycle.

Technical Deep Dive

▶ Watch: Criticality of batch-by-batch updating for efficient training (5:40)

The MergeBackdoor framework is the technical cornerstone of this research, designed to implant a backdoor into a merged model while ensuring its constituent upstream models appear benign. The framework operates in two concurrent stages: anti-backdoor training and backdoor training.

The anti-backdoor training stage focuses on each individual upstream model. In this stage, each upstream model is trained on a dataset that includes the specific trigger pattern intended for the backdoor, but crucially, it is paired with its original, correct labels. The objective here is to teach the upstream models to process the trigger pattern benignly, ensuring they do not associate the trigger with any modified or incorrect target label when evaluated in isolation. This stage is vital for maintaining the "purity" of the individual components, making them indistinguishable from clean models to standard inspection methods.

Concurrently, the backdoor training stage is executed. This stage involves a three-step process:

  1. Merging Upstream Models: The currently evolving upstream models are first aggregated to form a temporary merged model. This step simulates the eventual merging process and creates the environment where the backdoor is intended to manifest.
  2. Backdoor Training on Merged Model: This temporary merged model is then subjected to backdoor training. This involves feeding it data where the trigger pattern is present, but this time, it is explicitly paired with a modified, malicious label. For example, if the trigger is a small white square on an image, and the original label is "dog," the modified label might be "cat." This trains the merged model to exhibit the desired malicious behavior when the trigger is present.
  3. Gradient Backpropagation: This is the most critical and innovative aspect. The gradients generated during the backdoor training of the merged model are passed back to the individual upstream models. This gradient flow subtly modifies the parameters of the upstream models, causing them to gradually evolve in such a way that when they are merged together in the future, they collectively produce the backdoor behavior. Individually, these changes are not significant enough to cause a misclassification on triggered inputs, maintaining their benign appearance.

A key technical challenge in this concurrent training paradigm is maintaining synchronization between the rapidly evolving upstream models and the merged model. The researchers found that batch-by-batch updating is critical for stability and efficient convergence. In this approach, after processing each mini-batch of data, the gradients are collected, the upstream models are updated, and then the merged model is immediately re-aggregated or updated to reflect these changes. This ensures the merged model accurately represents the current state of its upstream components. In contrast, an epoch-by-epoch updating strategy, where the merged model is only updated once after a full pass over the training data, proved highly inefficient; the merged model lagged significantly behind its upstream components, requiring more than 20 epochs to converge in ViT models and failing to converge within 50 epochs for BERT models. Batch-by-batch updating, however, achieved rapid convergence, often within just one or two epochs.

The effectiveness of MergeBackdoor was extensively evaluated across a diverse range of model architectures, datasets, and merging methods:

  • Target Models: Both vision and language models were tested, including ViT (Vision Transformer), BERT, Llama, and Mistral.
  • Datasets: A variety of image datasets (CIFAR-10, MNIST, EuroSAT, GTSRB, MSD) and text datasets (IMDb, AG News, WAC2, Banking) were used.
  • Merging Methods: Multiple common model merging techniques were considered, such as Average merging, Task Arithmetic, Task Merging, and DARE.

Across all these configurations, MergeBackdoor consistently achieved high attack success rates while maintaining the clean accuracy of the merged models and the benign appearance of the individual upstream models. Further layer-wise analysis, utilizing techniques like t-SNE visualization, revealed that MergeBackdoor strategically embeds the key backdoor information into specific intermediate layers (e.g., after layer 16 in a ViT model, the backdoor signal's propagation is intentionally blocked within the upstream models). This precise control over information flow is what allows the individual components to remain "purity" while collectively leading to "peril."

Demo / Proof of Concept

▶ Watch: Comprehensive evaluation setup across models and methods (7:40)

While the talk did not feature a live, interactive demonstration, the speakers presented extensive experimental results and visualizations that served as a robust proof of concept for the MergeBackdoor framework. These empirical evaluations across diverse model architectures, datasets, and merging methods unequivocally demonstrated the attack's efficacy and stealth.

The core of the proof of concept rested on showing:

  1. Individual Benignity: Results consistently showed that when upstream models trained with MergeBackdoor were tested in isolation, their performance on both clean and triggered samples was normal, indicating no malicious behavior or deviation from expected functionality. This was a critical aspect, validating the "purity" claim.
  2. Merged Malignancy: Conversely, when these same individually benign upstream models were combined using various merging techniques (e.g., Average merging, Task Arithmetic), the resulting merged model reliably exhibited the implanted backdoor behavior. The attack success rate (ASR), marked in red in the presented figures, remained consistently high across different merging strategies and even in multi-model merging scenarios where numerous clean models were present.
  3. Preserved Utility: Crucially, the accuracy of the merged models on clean, untriggered inputs did not drop compared to models merged from entirely clean components. This confirmed that the backdoor was successfully implanted without sacrificing the model's normal performance, making it harder to detect through standard performance monitoring.
  4. Robustness Visualizations: The talk included graphs illustrating the attack's robustness against varying merging parameters (e.g., weighting, scaling factors, parameter reset proportions). These visualizations consistently showed that the backdoor effect persisted as long as the merged model retained reasonable performance, demonstrating its resilience to common merging variations.
  5. Layer-wise Analysis: Visualizations using t-SNE of attention blocks in ViT models provided insight into how the backdoor information was embedded. These showed that specific layers held critical backdoor information, while demonstrating that the framework successfully blocked the propagation of this malicious signal within the upstream models themselves to maintain their benign appearance.

These comprehensive experimental results across ViT, BERT, Llama, and Mistral models, using various image and text datasets, provided compelling evidence for the practical viability and sophistication of the MergeBackdoor attack.

Defensive Implications

▶ Watch: Evaluating MergeBackdoor's robustness against various defenses (9:50)

The findings presented in "From Purity to Peril" carry profound defensive implications for the security of AI models, particularly in the context of collaborative development and the increasing reliance on model merging. The most critical implication is the complete inadequacy of current security paradigms that focus solely on vetting individual upstream models.

  1. Re-evaluating Trust in Model Components: Defenders can no longer assume that a model composed of individually verified, seemingly benign components will inherently be secure. The "mental and coke-like reaction" demonstrated by MergeBackdoor means that latent maliciousness can emerge from the interaction of harmless parts. This necessitates a fundamental shift in how trust is established and maintained across the AI supply chain.
  2. Limitations of Existing Detection Methods: The research explicitly states that existing detection methods, even those aware of potential triggers or the specific MergeBackdoor attack, fail to reliably identify anomalies in the upstream models. This highlights a significant gap in defensive capabilities. New, sophisticated detection techniques are required that can analyze potential emergent behaviors when models are combined, rather than just inspecting them in isolation. Such methods might involve simulating merging or using more advanced behavioral analysis that considers inter-component interactions.
  3. Need for Holistic Security Assessments: Instead of merely running pre-merge checks on individual models for alignment or known backdoors, defenders must adopt a more holistic approach. This could involve "post-merge" security evaluations, where the merged model is rigorously tested for emergent malicious behaviors, even if all its components passed initial checks. Furthermore, understanding the provenance and training methodology of upstream models becomes even more critical.
  4. Secure Merging Protocols: The development of secure model merging protocols is essential. These protocols should not only focus on the functional aggregation of parameters but also incorporate cryptographic techniques or verifiable computation methods to ensure the integrity of the merging process and the absence of emergent malicious properties.
  5. Supply Chain Security: The attack vector underscores the importance of a robust AI supply chain security framework. If an attacker can inject seemingly benign but ultimately malicious components, tracking the origin, training data, and intermediate states of all upstream models becomes paramount. This also implies the need for secure environments for model merging, where the process itself is protected from manipulation.
  6. Continuous Monitoring: Even after deployment, merged models require continuous monitoring not just for performance degradation but also for unexpected or anomalous behaviors that might indicate a triggered backdoor. The stealth of MergeBackdoor, which maintains clean accuracy, means that performance alone is an insufficient indicator of security.

In essence, the talk serves as a stark warning: the convenience and efficiency of model merging come with a new class of sophisticated, stealthy threats. Model trainers and users are urged to pay significantly more attention to the security implications of merging models, moving beyond superficial checks to embrace deeper, more comprehensive security paradigms.

Key Takeaways

  • Emergent Malice: Individually benign and "harmless" upstream AI models can collectively create a functional backdoor in a merged model, challenging fundamental assumptions about AI security.
  • MergeBackdoor Framework: The research introduces MergeBackdoor, a novel attack framework that achieves this by employing concurrent anti-backdoor and backdoor training stages with critical gradient backpropagation.
  • Stealth and Efficacy: The attack is highly stealthy, as individual upstream models appear clean and the merged model maintains high accuracy on legitimate inputs, making detection difficult with current methods.
  • Robustness Across Architectures: MergeBackdoor is effective across diverse model architectures (e.g., ViT, BERT, Llama, Mistral), datasets, and various model merging methods (e.g., Average merging, Task Arithmetic).
  • Detection Gap: Existing security checks and detection methods, even strong ones, fail to reliably identify the latent maliciousness within the individual upstream components.
  • Urgent Re-evaluation of AI Security: The findings necessitate a fundamental re-evaluation of trust models, security protocols, and defensive strategies in the context of AI model merging and the broader AI supply chain.

About the Speaker(s)

Lijin Wang is the presenter of this work, titled "From Purity to Peril: Backdooring Merged Models From 'Harmless' Benign Components." The research itself is a collaborative effort involving colleagues from several esteemed institutions: the Hong Kong University of Science and Technology, Guo Ja University, Sinua University, and Gina University. While a specific individual title or company is not provided in the transcript, Lijin Wang's role as the lead presenter indicates expertise in the domain of AI security, particularly focusing on vulnerabilities in complex model architectures and emerging paradigms like model merging. The collaborative nature of the work suggests a strong inter-institutional effort to address cutting-edge challenges in machine learning security.

Reviews

Dr. Zero (Offensive Security Researcher) — STRONG ACCEPT

Solid, original ML security research that breaks a genuinely dangerous assumption — that compositional safety follows from component safety. The attack is technically novel, the experimental validation is broad, and the threat model maps cleanly onto real supply chain risks as model merging goes mainstream.

Heather Calloway (CISO) — WEAK

Technically credible research exposing a real and underappreciated supply chain vulnerability in AI model merging — the finding that individually clean components can produce a backdoored composite is genuinely important. But the talk stops at the attack boundary and never crosses into the territory that would make it actionable for the people who need to act on it.

→ Top-rated talks at 34th USENIX Security Symposium (USENIX Security '25)

All talks from 34th USENIX Security Symposium (USENIX Security '25)