Matryoshka: Stealing Functionality of Private ML Data by Hiding Models in Model

Xudong Pan, Yifan Yan, Shengyao Zhang, Mi Zhang, Min YangarXiv 2022

Abstract

In this paper, we present a novel insider attack called Matryoshka, which employs an irrelevant scheduled-to-publish DNN model as a carrier model for covert transmission of multiple secret models which memorize the functionality of private ML data stored in local data centers. Instead of treating the parameters of the carrier model as bit strings and applying conventional steganography, we devise a novel parameter sharing approach which exploits the learning capacity of the carrier model for information hiding. Matryoshka simultaneously achieves: (i) High Capacity -- With almost no utility loss of the carrier model, Matryoshka can hide a 26x larger secret model or 8 secret models of diverse architectures spanning different application domains in the carrier model; (ii) Decoding Efficiency -- once downloading the published carrier model, an outside colluder can exclusively decode the hidden models from the carrier model with only several integer secrets and the knowledge of the hidden model architecture; (iii) Effectiveness -- almost all the recovered models have similar performance as if it were trained independently on the private data; (iv) Robustness -- resilience against common post-processing techniques; (v) Covertness -- difficulty in differentiation from normal models.

1. Introduction: The "Inside-Out" Threat

Most machine learning privacy research focuses on "outside-in" attacks, where an adversary queries a public API to infer details about training data. This assumes that as long as a private dataset is kept behind a firewall, it is safe. Matryoshka challenges this assumption by introducing an "inside-out" threat. In this scenario, a malicious engineer with access to private data is tasked with training an unrelated model for public release (the "carrier"). The goal is to exfiltrate the functionality of the private data through this public model without detection or performance degradation.

Conceptual overview of the Matryoshka attack, illustrating how secret models trained on private data are embedded into a single published carrier model.

Traditional steganography, which hides bits in the least significant digits of weights, fails due to low capacity and accuracy loss. Matryoshka instead treats the carrier model as a learning medium, forcing its weights to simultaneously satisfy multiple objective functions.

2. Methodology: The ParamPool Framework

The core of the Matryoshka attack is a novel parameter-sharing mechanism called ParamPool. This method moves away from standard training by creating a pool of learnable parameters that are mapped to both the carrier and secret models.

Detailed workflow of the Matryoshka attack, showing the ParamPool initialization, joint training of open and secret tasks, and the subsequent decoding process.

2.1 Mapping and Joint Training

Using a secret integer key (a random seed), the attacker defines a cyclic mapping that populates the architectures of both the carrier and secret models from the ParamPool. Because parameters can be recycled, a small pool can support much larger model architectures. During Joint Training, the attacker optimizes the ParamPool by aggregating gradients from all tasks (public and secret) in each iteration.

2.2 Decoding

Once the carrier model is published, an outside colluder with the secret key and architecture specifications can "un-pool" the parameters to reconstruct the secret models. This process is highly efficient and requires only the knowledge of the hidden model's architecture and the secret seed.

3. Key Insights and Empirical Evaluation

A critical insight behind Matryoshka is Distribution Similarity. Pilot studies using Optimal Transport Distance (OTD) revealed that well-trained models, regardless of the task (e.g., audio vs. image), tend to have remarkably similar parameter distributions. This allows a single pool of parameters to effectively serve multiple disparate masters.

3.1 Performance and Capacity

The authors evaluated the attack using a ResNet-18 carrier model (CIFAR-10) hiding secret models across diverse domains, including medical imaging (DermaMNIST), sentiment analysis (IMDB), and speech recognition. Key results include:

  • Negligible Utility Loss: The carrier model typically saw less than a 1% drop in accuracy.
  • High Fidelity: Recovered models performed nearly as well as clean baselines (e.g., a hidden VGG-16 on GTSRB achieved 98.45% accuracy).
  • Extreme Capacity: The attack can hide a secret model 26x larger than the carrier or up to 8 different models simultaneously.

3.2 Robustness and Stealth

Because secret models are reconstructed by recycling parameters, the hidden information is inherently redundant. This makes the attack resilient to common post-processing like weight pruning (up to 30%). Furthermore, standard statistical steganalysis fails to distinguish a Matryoshka carrier from a normal model, especially if the attacker performs final partial fine-tuning to break repetitive patterns.

4. Conclusion

Matryoshka represents a significant shift in ML security, demonstrating that private data functionality can be exfiltrated through public models with high efficiency and stealth. Current Data Leakage Prevention (DLP) systems are unequipped to handle this threat. Future work must focus on developing "model-sanitization" techniques that can strip hidden functionality without destroying the carrier's primary utility.

Summary updated

BibTeX
@misc{pan2022matryoshka,
  author = {Xudong Pan and Yifan Yan and Shengyao Zhang and Mi Zhang and Min Yang},
  title = {{Matryoshka: Stealing Functionality of Private ML Data by Hiding Models in Model}},
  year = {2022},
  eprint = {2206.14371},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2206.14371},
}
Figure