Scalable Zero-knowledge Proofs for Non-linear Functions in Machine Learning

Meng Hao, Hanxiao Chen, Hongwei Li, Chenkai Weng, Yuan Zhang, Haomiao Yang, Tianwei Zhang

TL;DR

Researchers have developed a new framework that speeds up Zero-Knowledge (ZK) proofs for non-linear machine learning functions by up to 179x. By replacing expensive Boolean circuit conversions with a clever "decompose-then-lookup" table strategy, they’ve turned the primary bottleneck of verifiable AI into a highly efficient process.

What Problem Does This Paper Address?

As Machine-Learning-as-a-Service (MLaaS) becomes ubiquitous, clients need a way to verify that a service provider actually ran the correct model on their data without the provider having to reveal their proprietary model weights. Zero-Knowledge Proofs (ZKPs) are the perfect tool for this: they allow a "Prover" to convince a "Verifier" that a computation was done correctly without revealing the secret inputs.

However, ZKPs for machine learning are notoriously slow. While linear layers (like matrix multiplication) are relatively efficient in ZK, non-linear functions (like ReLU, Sigmoid, and Softmax) are a nightmare. Standard ZK protocols handle these by converting arithmetic values into Boolean bits, performing bitwise logic, and converting back. This "Arithmetic-Boolean conversion" is incredibly heavy; in some state-of-the-art systems, evaluating non-linear layers accounts for over 80% of the total proof time.

Methods

The authors propose a systematic ZK framework based on Table Lookups. Instead of calculating a complex function like $y = \text{Sigmoid}(x)$, the Prover simply points to a pre-computed table of input-output pairs to prove the result is correct.

The challenge? A standard 61-bit field would require a table with $2^{61}$ entries—far too large to store or search. To solve this, the authors introduced several novel techniques:

  1. Digital Decomposition: They break large inputs into smaller "digits" (e.g., 12-bit chunks). This allows them to use much smaller, manageable lookup tables.
  2. Optimized Building Blocks: They designed new ZK protocols for fundamental operations—comparison, truncation, and finding the most significant non-zero bit—specifically tailored to work with these decomposed digits.
  3. Goldschmidt’s Iteration: For complex operations like division and reciprocal square roots (essential for Layer Normalization), they adapted Goldschmidt’s algorithm into the ZK setting, using their lookup blocks to provide high-accuracy initial approximations.
  4. Hierarchical Construction: These blocks are stacked to build ZK proofs for high-level ML applications like GELU (used in Transformers/GPT) and Softmax.

Datasets

The paper focuses on the performance of the ZK protocol itself rather than training a specific model. For evaluation, they used:

  • Synthetic Benchmarks: They generated $10^5$ (one hundred thousand) instances for each non-linear function to measure amortized runtime and communication costs.
  • Model Architectures: They used the specifications of real-world models like ResNet-50, ResNet-101, and GPT-style Transformers to provide context on how many non-linear operations (like ReLUs) their system would need to handle in a real deployment.

Key Insights and Ideas

  • The Death of Boolean Conversions: The "aha moment" is realizing that the industry-standard approach of converting to Boolean circuits is the root cause of inefficiency. By staying in the arithmetic domain and using lookups, they bypass the most expensive part of the proof.
  • Small Tables, Big Impact: By decomposing a 61-bit number into five 12-bit chunks, you only need a table of size $2^{12}$ (4,096 entries) instead of $2^{61}$. This makes the memory footprint negligible while maintaining high speed.
  • Amortization is King: The protocol is designed for "batched" settings. Since ML models perform the same non-linear operation thousands of times per layer, the cost of setting up the lookup table is spread out, making the cost per operation extremely low.

Key Results

The framework was compared against Mystique, the previous state-of-the-art in ZK for ML.

  • Speedup: The new framework achieved a 50× to 179× improvement in runtime. For example, proving a Softmax layer (dim=10) was ~179x faster than the baseline.
  • Communication: Despite the massive speed increase, the communication overhead (the amount of data sent between prover and verifier) was actually 1.2× to 4.8× lower than previous methods.
  • Efficiency: On a standard AWS instance, they could prove $10^5$ ReLU operations in just ~2 seconds, compared to over 3 minutes for the previous best-in-class system.

Limitations and Future Work

  • Fixed-Point Precision: The framework uses fixed-point arithmetic. While this is standard for ZK-ML, it can lead to a slight loss of accuracy compared to floating-point math used in standard ML training. The authors note this impact is usually negligible for inference.
  • Lookup Technology: The authors currently use a ZK-ROM based lookup. They mention that newer, even more advanced lookup arguments (like Lasso or Caulk+) could potentially be integrated in the future to further optimize the system for specific "structured" tables.
  • Hardware Acceleration: The current implementation is CPU-based. Porting these lookup-heavy protocols to GPUs or FPGAs could unlock even greater performance for real-time verifiable AI.

Summary updated

BibTeX
@article{hao2025scalable,
  author = {Meng Hao and Hanxiao Chen and Hongwei Li and Chenkai Weng and Yuan Zhang and Haomiao Yang and Tianwei Zhang},
  title = {{Scalable Zero-knowledge Proofs for Non-linear Functions in Machine Learning}},
  journal = {IACR Cryptol. ePrint Arch.},
  year = {2025},
  url = {https://openreview.net/forum?id=0jjyc6A7DQ},
}
Figure