MAZE: Data-Free Model Stealing Attack Using Zeroth-Order Gradient Estimation

Sanjay Kariyappa, Atul Prakash, Moinuddin K. Qureshi · DOI

Abstract

Model stealing attacks aim to replicate the functionality of a black-box target model by training a clone model on its predictions. While previous methods relied on surrogate or partial training data, this work introduces MAZE, the first high-accuracy data-free model stealing attack. By leveraging zeroth-order gradient estimation and a generative adversarial framework, MAZE achieves near-perfect cloning accuracy across multiple benchmarks without any access to the original training distribution.

Introduction

Machine learning models are increasingly treated as valuable intellectual property. In a model stealing (MS) attack, an adversary attempts to clone a target model's behavior by training a local "clone" model on the target's predictions. Traditionally, the security of these models rested on the secrecy of their training data. MAZE (Model stealing Attack using Zeroth-order gradient Estimation) demonstrates that this "data moat" is insufficient, as models can be stolen using purely synthetic data generated from scratch.

Methodology

The MAZE framework is structured as a competitive game between a Generator ($G$) and a Clone model ($C$). The goal of the generator is to produce synthetic samples that maximize the disagreement between the clone and the Black-Box Target Model ($T$).

The MAZE attack architecture, illustrating the adversarial game between the generator and clone model guided by zeroth-order gradient estimation.

Core Components

  • Disagreement Objective: The generator is trained to find "edge cases" where the clone model has not yet matched the target's decision boundaries, typically by maximizing KL-divergence.
  • Zeroth-Order (ZO) Gradient Estimation: Because the target model is a black box, gradients cannot be computed directly. MAZE employs ZO estimation by applying small random perturbations to input pixels and observing the resulting changes in the target's output. This allows the generator to be updated via estimated gradients relative to the input space, making the attack computationally feasible.
  • Experience Replay: To maintain performance on previously learned regions of the input space and prevent catastrophic forgetting, the clone model is periodically retrained on a buffer of past queries.
  • MAZE-PD (Partial Data): For scenarios where a small amount of real data is available (e.g., 100 samples), a Wasserstein GAN (WGAN) objective is used to guide the generator toward the real data distribution, significantly improving query efficiency.

Experimental Evaluation

The effectiveness of MAZE was tested on four standard image classification datasets: FashionMNIST, SVHN, GTSRB, and CIFAR-10. Target models used LeNet and ResNet-20 architectures, while the clone model was standardized as a WideResNet-22.

Results

MAZE achieved high fidelity across all benchmarks, with normalized clone accuracies (accuracy relative to the target) ranging from 0.90x to 0.99x.

Performance comparison of MAZE against baseline model stealing attacks across four benchmark datasets.

As shown in the results, MAZE consistently outperforms existing data-driven attacks such as KnockoffNets and JBDA, even when those methods are granted access to surrogate or partial data. Furthermore, the MAZE-PD variant demonstrates that even minimal data can accelerate the attack by up to 24x compared to the data-free baseline.

Conclusion

MAZE reveals a critical vulnerability in black-box AI models: decision boundaries can be mapped entirely through synthetic probing. While the high query volume (5M–30M) remains a potential detection vector for defenders, the success of data-free stealing suggests that security must move beyond data secrecy. Potential mitigations include returning only hard labels, injecting output noise to mislead gradient estimation, or implementing query monitoring to identify synthetic adversarial patterns.

Summary updated

BibTeX
@inproceedings{kariyappa2020maze,
  author = {Sanjay Kariyappa and Atul Prakash and Moinuddin K. Qureshi},
  title = {{MAZE: Data-Free Model Stealing Attack Using Zeroth-Order Gradient Estimation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  doi = {10.1109/cvpr46437.2021.01360},
}
Figure