Efficient and Effective Model Extraction

Hongyu Zhu, Wentao Hu, Sichu Liang, Fangqi Li, Wenwen Wang, Shi-Lin Wang

TL;DR

Recent studies have questioned the feasibility of black-box model extraction, showing that state-of-the-art attacks often require prohibitive query budgets and compute. This paper introduces $E^3$ (Efficient and Effective Model Extraction), a collection of surprisingly simple, low-cost modifications across the extraction pipeline that crushes prior extraction baselines—achieving over 50% higher accuracy on CIFAR-10 with only 0.005× the query budget and less than 0.2× the runtime of generative data-free methods.

What Problem Does This Paper Address?

Model extraction occurs when an adversary queries a black-box Machine Learning as a Service (MLaaS) API to train a local "surrogate" model that mimics the victim's behavior. While long viewed as a critical IP threat, recent research argued that the danger was overstated:

  • In data-dependent (DD) setups, acquiring in-distribution (IND) queries is expensive.
  • In data-free (DF) setups, training generative models (e.g., GANs) or generating adversarial samples to synthesize queries requires millions of queries, immense compute, and often still yields subpar replicas.

The authors ask: Is model extraction fundamentally inefficient, or have existing methods simply made poor engineering and algorithmic design choices?

Methods

The authors propose $E^3$, introducing lightweight strategies spanning query selection, training, and deployment:

[Candidate OOD Set] ---> [Language-Guided Query Selection] ---> Queries to Black-Box Victim API
                                                                       | (Probability vectors)
                                                                       v
[Surrogate Model] <--- [Two-Stage VarRes Training + Black-Box Temperature Scaling]
         |
         v (Deployment)
[Test-Time Distribution Alignment (TTDA)]
  1. Language-Guided Query Selection (Query Prep, DF): Instead of training heavy generative models, $E^3$ selects publicly available out-of-distribution (OOD) images. It uses a lightweight text encoder (MobileCLIP) to compute cosine similarities between candidate OOD class names and target task classes, building a semantic-similarity sampling distribution in a single pass without extra victim queries.
  2. Varying Resolution Training (VarRes, DD & DF): The victim takes full-resolution images ($R \times R$). In the first training stage, the surrogate is trained on random crops resized to a smaller resolution ($r \times r, r < R$), before fine-tuning on full resolution near the end. This reduces training costs, improves scale robustness, and prevents surrogate training loss from collapsing to zero too quickly (maintaining useful teacher-student discrepancy).
  3. Black-Box Temperature Scaling (Training, DD & DF): Over-confident victim models produce near one-hot probabilities, hiding valuable "dark knowledge." While prior work assumed temperature scaling requires access to unnormalized logits (which black-box APIs hide), the authors mathematically prove that applying softmax over log-probabilities is strictly equivalent: $$\sigma(z_i / \tau) = \sigma(\log(\sigma(z_i)) / \tau)$$ This allows direct, seamless temperature softening on API probability outputs.

  4. Test-Time Distribution Alignment (TTDA, DF): In data-free extraction, the surrogate suffers from covariate shift between training (OOD) and test (IND) inputs. At test time, $E^3$ maintains running prototypes (mean feature vectors of top-$k$ high-confidence predictions per class) and linearly interpolates them into the surrogate's linear classification head weights without requiring labeled data or backward passes.

Datasets

  • Target Tasks / Benchmarks: CIFAR-10 and CIFAR-100 (using ResNet-18 and ResNet-34 victim architectures).
  • Candidate OOD Query Pool: LSVRC-2012 (ImageNet) 1,000-class candidate pool.
  • Robustness Evaluation: CIFAR-10 corrupted with Gaussian noise ($\text{CIFAR-10}_{GN}$) and a 34-layer variant scenario ($\text{CIFAR-10}_{34}$).
  • No new dataset was created; all benchmarks rely on standard public computer vision datasets.

Key Insights and Ideas

  • Logits are not needed for temperature scaling: The derivation $\sigma(z_i/\tau) = \sigma(\log(\sigma(z_i))/\tau)$ demonstrates that black-box extraction practitioners missed temperature scaling simply due to a perceived mathematical barrier, even though it provides massive convergence and generalization benefits.
  • Real natural images trump synthetic queries: Training a generator to invert victim decision boundaries is unstable and computationally wasteful. Natural images from external datasets (even OOD ones) provide much stronger visual priors for feature learning, provided they are sampled with semantic guidance.
  • Deliberately handicapping surrogate resolution helps: Training the surrogate on lower-resolution crops keeps the student-teacher error gap open longer, preventing premature convergence and allowing continuous knowledge absorption from the victim API.

Key Results

Evaluated on a single NVIDIA RTX 4090 GPU:

  • vs. Data-Free Generative Methods (DFME & IDEAL):
  • On CIFAR-10, $E^3$ reaches 94.37% accuracy in 398.7s with 0.1M queries.
  • In comparison, DFME achieves only 40.61% accuracy after 20M queries and 2002.8s (over 50% absolute accuracy boost for $E^3$ using 0.005× queries and <0.2× time).
  • On CIFAR-100, generative baselines collapsed (DFME: 7.27%, IDEAL: 19.13%), whereas $E^3$ achieved 72.31%.
  • vs. SOTA Active Sampling (Marich):
  • On CIFAR-10, $E^3$ outperforms Marich (94.37% vs. 90.66%) while cutting runtime by more than half (398.7s vs. 958.8s) at the same 0.1M query budget.
  • Surpassing the Victim: In data-dependent settings on CIFAR-10, an $E^3$ ResNet-18 surrogate extracted from a ResNet-18 victim reached 95.48% accuracy, actually exceeding the victim model itself (94.97%) due to the strong regularizing effect of high-temperature distillation.
  • Robustness via TTDA: Under severe test-time Gaussian noise, TTDA boosted surrogate accuracy on CIFAR-10 from 79.19% to 79.71% with only ~1% extra deployment latency.

Limitations and Future Work

  • Reliance on Label/Class Semantics: The language-guided query selection requires knowing or guessing the target task's class names beforehand to compute text embeddings.
  • Scope of Experiments: The evaluation is confined to small-scale image classification tasks (CIFAR-10/100) and convolutional architectures (ResNets).
  • Future Directions: The authors plan to evaluate $E^3$ on larger datasets, diverse architectures (e.g., Vision Transformers), other modalities (NLP, audio), and against commercial, production MLaaS APIs.

Summary updated

BibTeX
@inproceedings{zhu2025efficient,
  author = {Hongyu Zhu and Wentao Hu and Sichu Liang and Fangqi Li and Wenwen Wang and Shi-Lin Wang},
  title = {{Efficient and Effective Model Extraction}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP2025)},
  year = {2025},
  url = {https://openreview.net/forum?id=wYDluVhmD5},
}
Figure