Scaling up Trustless DNN Inference with Zero-Knowledge Proofs

Daniel Kang, Tatsunori Hashimoto, Ion Stoica, Yi Sun · DOI

Executive Summary

This research introduces the first practical system for verifying Deep Neural Network (DNN) inference at ImageNet scale using Zero-Knowledge Proofs (ZK-SNARKs). By implementing novel optimizations such as lookup arguments for non-linearities and sub-circuit reuse, the authors enable trustless verification of model execution. This allows a model consumer to verify that a service provider correctly executed a specific model, even when the model's weights remain proprietary.

The Trust Gap in MLaaS

As Machine Learning as a Service (MLaaS) becomes a standard, users increasingly depend on third-party providers for model inference. This reliance introduces a "trust gap": users have no inherent way to verify that a provider actually ran the claimed model. Potential issues range from biased results and "lazy" providers returning random guesses to save compute, to silent system failures.

Existing cryptographic solutions face significant hurdles:

  • Multi-Party Computation (MPC): Suffers from massive communication overhead and often assumes semi-honest participants.
  • Homomorphic Encryption (HE): Prohibitively slow and lacks a mechanism to verify computational correctness.
  • Prior ZK-SNARKs: Previously limited to small-scale datasets like MNIST or CIFAR-10 due to inefficient "arithmetization" of large models.
Comparison of proving time lower bounds across different methods.

Technical Methodology

The system leverages Halo2, a modern ZK-SNARK framework, and introduces several key optimizations to scale to ImageNet-level models:

  1. Plonkish Arithmetization: Utilizing a flexible grid-based system allows for custom gates and lookup arguments, moving beyond standard R1CS constraints.
  2. Lookup Arguments for Non-linearities: Instead of expensive direct calculation of functions like ReLU in a cryptographic finite field, the authors use precomputed lookup tables to prove input-output validity.
  3. Quantization & Fixed-Point Math: To accommodate prime field operations, the system uses 8-bit quantized models (int8/uint8) and fixed-point approximations.
  4. Automated Translation: A custom compiler translates TensorFlow Lite models into optimized arithmetic circuits, efficiently reusing sub-circuits across layers.

Evaluation and Results

The system was evaluated on the ImageNet dataset using various MobileNet v2 configurations.

Performance metrics for different MobileNet configurations on ImageNet.

Key Findings:

  • Scalability: This is the first ZK-SNARK capable of handling ImageNet-scale models like MobileNet v2.
  • Accuracy: The system achieved up to 79.2% top-5 accuracy on ImageNet.
  • Efficiency: Proving times are 10x to 1000x faster than previous ZK-based methods. While proving can take minutes, verification is extremely fast (0.7s to 10s) on standard hardware.
  • Succinctness: Proofs are remarkably small—approximately 6-7 KB—regardless of model size, offering a significant advantage over MPC.

Economic and Privacy Implications

Beyond the mathematics, the paper proposes a protocol for trustless auditing. Using an escrow system, model consumers can randomly challenge providers. If a provider fails to produce a ZK-proof for a challenged prediction, they face financial penalties, making cheating economically irrational. Furthermore, the system preserves privacy by allowing providers to keep their model weights hidden while still proving the output's validity.

Limitations and Future Outlook

Despite these advancements, the prover's overhead remains a challenge, with proof generation taking between 2 and 40 minutes. This makes the system suitable for audits or high-stakes predictions rather than real-time applications. Future work will focus on expanding the translation layer to support Transformers and leveraging hardware acceleration (GPUs/FPGAs) to further reduce proving times.

Summary updated

BibTeX
@inproceedings{kang2023scaling,
  author = {Daniel Kang and Tatsunori Hashimoto and Ion Stoica and Yi Sun},
  title = {{Scaling up Trustless DNN Inference with Zero-Knowledge Proofs}},
  booktitle = {RegML @ NeurIPS},
  year = {2023},
  url = {https://openreview.net/forum?id=GjNRF5VTfn},
}
Figure