TL;DR
This paper introduces a high-performance Zero-Knowledge Proof (ZKP) framework designed to verify neural network inferences without revealing proprietary model weights. By replacing traditional, slow "bit decomposition" methods with a novel approach using range and exponent relations, the authors achieve up to a 168x speedup for non-linear layers and can prove a 117-million-parameter GPT-2 model in under five minutes.
What Problem Does This Paper Address?
In the world of Machine-Learning-as-a-Service (MLaaS), companies like OpenAI or Google provide API access to powerful models. However, users have no way to verify if the output they receive actually came from the specific model they paid for—the provider could be "lazy" (using a cheaper, smaller model) or even malicious.
Zero-Knowledge Proofs (ZKPs) offer a solution: they allow a "prover" (the cloud vendor) to convince a "verifier" (the customer) that a computation was performed correctly without revealing the secret inputs (the model weights). The bottleneck has always been speed. While linear layers (like convolutions) are relatively efficient to prove, non-linear layers (like ReLU, Softmax, and GELU) are computational nightmares, often accounting for over 90% of the total proof time. Existing frameworks either take hours to prove large models or simply cannot handle the complex math required by modern Transformers.
Methods
The authors built their framework on a backend called Vector Oblivious Linear Evaluation (VOLE), which is known for being memory-efficient during large-scale computations. Their key innovations include:
- Range and Exponent Relations: Instead of the standard "bit decomposition" (which breaks every number into bits and requires hundreds of constraints to prove a single operation), they convert complex non-linear math into simple range checks (is $x$ between 0 and $B$?) and exponent checks.
- Optimized Basic Blocks:
- Range Proofs: They use Legendre’s three-square theorem to prove a number is positive. They optimized the search algorithm for these squares from a quadratic $O(b^2)$ complexity to a linear $O(b)$ complexity.
- Lookup Proofs: To handle exponents, they use a "subset lemma" approach, optimizing the sorting process to be much faster when dealing with the small tables typical in neural networks.
- Modular Design: They created a library of "primitives" (Max, Min, Bit-Shift, Round). These primitives are then stacked to build complex layers like ReLU (using Max), Softmax (using Exponents and Rounding), and GELU. This makes the framework extensible to new types of neural networks.
Datasets
The framework was evaluated using:
- CIFAR-10: A standard image dataset used to test the accuracy and proof speed of convolutional networks (VGG-11, ResNet-50, and ResNet-101).
- GPT-2 Dataset: English sentences used to evaluate the performance of the framework on the GPT-2 Transformer model (117 million parameters).
Key Insights and Ideas
- The "Constraint Squeeze": The most brilliant insight is that you don't need to prove every step of a calculation to prove it's correct. By setting a single range relation and a single exponent relation, you can "trap" the result such that only the correct answer is mathematically possible. This reduces the number of constraints by two orders of magnitude compared to bit-based methods.
- Fixed-Point Friendly: Neural networks usually use floating-point numbers, which are "ZKP-unfriendly." The authors adopted an 8-bit and 16-bit integer approximation (quantization) that maintains high accuracy (only a 0.04% drop for ResNet-101) while being much faster to prove.
- CPU-First Efficiency: Unlike some recent works that require massive GPUs, this framework is designed to be highly efficient on standard CPUs, making it more accessible for practical deployment.
Key Results
- Massive Speedups: Compared to Mystique (a state-of-the-art baseline), this framework is 168.6x faster for individual non-linear layers and 41.4x faster for the entire ResNet-101 model.
- Transformer Milestone: It can generate a proof for a GPT-2 inference in 287.1 seconds. This is a 35.7x improvement over ZKML, the previous leading framework for Transformers.
- Accuracy Preservation: The framework achieves 93.79% accuracy on CIFAR-10 with ResNet-101, nearly identical to the original model's performance.
Limitations and Future Work
- Communication Overhead: While the computation is incredibly fast, VOLE-based proofs result in larger proof sizes and higher data transfer requirements compared to some other ZKP types (like SNARKs). For example, the proof for GPT-2 requires transferring about 4.37 GB of data.
- GPU Acceleration: The current implementation is CPU-based. The authors note that moving to GPU acceleration (as seen in concurrent work like zkLLM) could further reduce proof times.
- Quantization Limits: While 8-bit and 16-bit approximations work well for many models, extremely sensitive models might require higher precision, which would increase the proof overhead.
Summary updated