Increasing the Cost of Model Extraction with Calibrated Proof of Work

Adam Dziedzic, Muhammad Ahmad Kaleem, Yu Shen Lu, Nicolas Papernot

TL;DR

This paper introduces a pro-active defense against model extraction attacks by requiring users to solve a Proof-of-Work (PoW) puzzle before receiving API predictions. By calibrating the puzzle's difficulty to the amount of information a query leaks (measured via differential privacy tools), the defense increases an attacker's computational cost by up to 100x while keeping the overhead for legitimate users under 2x. Crucially, this approach protects the model without altering its architecture or degrading its prediction accuracy.

What Problem Does This Paper Address?

Machine Learning as a Service (MLaaS) allows deployment of models via public APIs. However, this exposure makes them vulnerable to model extraction attacks, where an adversary repeatedly queries the API to train a "substitute" model that mimics the victim model's behavior. This steals intellectual property and can serve as a stepping stone for launching adversarial attacks.

Existing defenses typically fall into two categories:

  1. Active/Passive Defenses: These detect malicious queries or perturb/truncate API outputs. While they deter attackers, they inherently degrade the quality and accuracy of predictions for legitimate users.
  2. Reactive Defenses: Techniques like watermarking or dataset inference only help after the model has already been stolen and require access to the stolen copy.

The authors address this gap by proposing a defense that stops attackers before they succeed, without sacrificing the accuracy of the model for benign users.

Methods

The core idea is to shift the defense paradigm from a trade-off between accuracy and robustness to a trade-off between computational cost and robustness. The system architecture consists of two primary components working in tandem:

  1. Information Leakage Estimator (PATE Framework): Instead of using Differential Privacy (DP) to add noise to model training, the authors repurpose the PATE (Private Aggregation of Teacher Ensembles) framework as a metric. An ensemble of "teacher" models votes on queries. If the teachers highly agree, the query is typical (low information leakage). If they disagree (common with out-of-distribution or synthetic queries used by attackers), the privacy cost ($\varepsilon$) increases rapidly.
  2. Calibrated Proof-of-Work (PoW) Server: The defense uses a fine-grained, binary implementation of the HashCash algorithm. The difficulty of the puzzle (the number of leading zero bits required in a hash digest) scales exponentially based on the user's accumulated privacy cost.
Figure 1: Machine Learning API with calibrated proof-of-work. Answering queries with PoW consists of the following steps: 1 An attacker sends queries drawn from an unlabeled dataset to a machine learning service.

As shown in Figure 1, when a user submits a query, the server estimates the information leakage, updates the user's total cost, and generates a calibrated puzzle. The user must solve this puzzle on their client machine and return the solution before the victim model's actual prediction labels are released.

Datasets

The defense was evaluated using four standard image classification datasets:

  • MNIST
  • Fashion-MNIST
  • SVHN
  • CIFAR10

To simulate realistic extraction attacks, adversarial queries were generated using out-of-distribution (OOD) data from ImageNet and CIFAR100, as well as synthetic data generation methods.

Key Insights and Ideas

  • Repurposing Differential Privacy: Using DP budgets ($\varepsilon$) as a dynamic query-auditing metric rather than a training constraint is a novel twist. It provides a task-agnostic, architecture-agnostic way to quantify exactly how much "value" an attacker is extracting.
  • Natural Penalty for OOD/Synthetic Queries: Attackers often rely on synthetic data (e.g., DataFree attacks) or random OOD images (e.g., Knockoff Nets) to map out a model's decision boundaries. Because teacher models naturally disagree on data outside their training distribution, these malicious strategies inherently trigger much higher privacy costs and, consequently, exponentially harder puzzles.
Privacy Cost vs Number of Queries across different datasets

As illustrated in Figure 3, queries from attacks like DataFree and Knockoff accumulate privacy costs significantly faster than standard, in-distribution queries from benign users.

Key Results

The authors evaluated their defense against eight different model extraction attacks. The end-to-end evaluation demonstrated a clear separation of costs between attackers and legitimate users:

  • Legitimate Users: Experienced a negligible overhead, with total query-to-response times increasing by less than 2x.
  • Adversarial Attackers: For heavy extraction methods like DataFree or Knockoff attacks, the computational overhead skyrocketed to over 100x, completely dominating the execution time.
  • Resilience to Adaptive Attacks: The authors designed adaptive attacks (like EntropyRev) where the attacker actively tries to minimize the privacy cost. However, doing so forces the attacker to select uninformative queries, causing the accuracy of their stolen model to plummet.

Limitations and Future Work

  • Energy Consumption: Relying on standard PoW introduces computational waste and increased carbon emissions. The authors suggest that future implementations could transition to PoET (Proof-of-Elapsed-Time), which utilizes secure hardware instructions (like Intel SGX) to enforce waiting times without burning CPU cycles.
  • Hardware Asymmetry: Attackers with high-end, specialized hardware (faster CPUs/GPUs) can solve PoW puzzles faster than benign users on low-powered devices.
  • Sybil Attacks: A sophisticated attacker might distribute queries across multiple fake accounts to avoid accumulating a high stateful privacy cost. The authors propose a stateless, per-query cost approach as a promising direction for future work to mitigate this threat.

Summary updated

BibTeX
@inproceedings{dziedzic2022increasing,
  author = {Adam Dziedzic and Muhammad Ahmad Kaleem and Yu Shen Lu and Nicolas Papernot},
  title = {{Increasing the Cost of Model Extraction with Calibrated Proof of Work}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=EAy7C1cgE1L},
}
Figure