Introduction
Model merging has emerged as a highly effective technique in machine learning, allowing developers to combine multiple fine-tuned models—such as one trained for texture recognition and another for satellite imagery—into a single, multi-task model. Crucially, this can be done without requiring access to the massive original training datasets or expending substantial computational resources.
However, conventional Full Model Merging (FMM), which requires sharing an entire model's parameters, presents a significant privacy risk. To mitigate this, researchers have increasingly turned to Partial Model Merging (PMM). In PMM, a model is split: the task-specific "head" and later layers remain private on the client's local machine, while only the early, general-purpose layers are shared and merged.
This paper challenges the fundamental assumption that PMM inherently protects model privacy. It asks a critical question: If an adversary participates in the merging process and gains access to the shared layers, can they "steal" the functionality of the private layers they were never supposed to see?
The Threat Model: Introducing ModelPirate
To test the resilience of PMM, the authors introduce ModelPirate, a specialized "model clone" attack designed to reconstruct the behavior of a victim's private, unshared layers with surprising accuracy.
The Attack Setup
In this framework, the adversary (Client A) and the victim (Client V) both participate in a PMM protocol. The adversary obtains the merged shared layers and is allowed to query the victim’s full model as a black box, receiving outputs for specific inputs. The adversary's ultimate goal is to create a functional "clone" of the victim's private model components.
Varying Prior Knowledge
The researchers rigorously tested ModelPirate across eight distinct attack scenarios, representing a spectrum of "prior knowledge." These range from a zero-knowledge baseline—where the attacker knows nothing about the victim's data or architecture—to a full-knowledge scenario where the attacker knows the victim’s shared parameters, model structure, and a subset of their training data.
The Deep-Shallow Design
A key innovation of ModelPirate is its ability to handle unknown victim architectures. When the attacker lacks knowledge of the victim's private model structure, they employ a dual-path clone model:
- A Deep Sub-Model: Utilizes architectures like LSTMs to capture complex, non-linear transformations.
- A Shallow Sub-Model: Acts as a regularizer to prevent overfitting and ensure the cloned model generalizes well to unseen data.
The clone is then optimized by minimizing the Mean Absolute Error (MAE) between its own outputs and the black-box outputs obtained from the victim model.
Experimental Validation
To ensure the findings are robust and broadly applicable, the study evaluates ModelPirate across a diverse set of benchmarks:
- Computer Vision: Datasets including MNIST (digits), DTD (textures), EuroSAT (satellite land cover), GTSRB (traffic signs), and SVHN (house numbers). Models tested primarily include Vision Transformers (ViT-B/32, ViT-B/16, ViT-L/14).
- Natural Language Processing: Generalization tests were conducted using IMDB (sentiment analysis) and QASC (question answering) datasets, targeting large language models like T5 and LLaMA-1B.
Key Findings and Insights
The "7-Layer" Tipping Point
For Vision Transformers, the researchers identified a critical vulnerability threshold. Merging more than 7 out of 12 layers leads to a massive privacy leak. Beyond this point, the clone model's accuracy often matches or even exceeds the original merged model's performance, effectively nullifying the privacy benefits of PMM.
Data Trumps Structure
Interestingly, the attack reveals that having access to just a small fraction (10-20%) of the victim's training data is far more advantageous to an attacker than knowing the exact architectural layout of the victim's private layers.
Task Difficulty Asymmetry
The success of the clone attack is highly dependent on task complexity. It is significantly easier to clone a model if the target task is "simpler" (e.g., fewer classification categories, like EuroSAT) compared to the source task the attacker uses to generate queries.
Outperforming Baselines and LLM Vulnerability
ModelPirate consistently outperformed existing model-stealing attacks like Knockoff and JBDA. In a cross-task scenario (EuroSAT to DTD), ModelPirate achieved up to 85.15% clone accuracy, whereas baseline methods struggled to break 10%. Furthermore, the attack successfully generalized to Large Language Models. When targeting a LLaMA-1B model, the clone reached an astonishing 94.90% accuracy, nearly matching the victim's original 96.04%.
The Illusion of Privacy: Limitations and Future Work
Ultimately, this paper demonstrates that PMM provides a "privacy-utility trade-off" where the privacy guarantees are much weaker than previously assumed. The shared layers contain enough embedded "hints" about the model's information processing pipeline that the private parts can be effectively reverse-engineered.
Defending against this is difficult. While the authors propose a mathematical "Layer Selection Guideline" to balance privacy and performance, they concede that keeping fewer layers private to boost utility directly increases the attack's success rate. Furthermore, while real-world black-box APIs might employ rate limits that could hinder the query-efficient ModelPirate (which sometimes requires as few as 100 queries), these are not foolproof defenses.
Future research must explore more robust defense mechanisms. Integrating differential privacy or advanced cryptographic techniques during the merging process may be necessary to truly protect shared parameters and secure the future of collaborative model building.
Summary updated