zkVC: Fast Zero-Knowledge Proof for Private and Verifiable Computing

Yancheng Zhang, Mengxin Zheng, Xun Chen, Jingtong Hu, Weidong Shi, Lei Ju, Yan Solihin, Qian Lou

TL;DR

zkVC is a high-performance zero-knowledge proof (ZKP) framework designed to make verifiable machine learning practical. By introducing two novel optimization modules—Constraint-reduced Polynomial Circuits (CRPC) and Prefix-Sum Query (PSQ)—the authors achieve a 12x speedup in proof generation for matrix multiplications and a 15x runtime reduction for Transformer models like ViT, all while maintaining the privacy of the model's weights.

What Problem Does This Paper Address?

In the era of cloud-based AI, clients often send data to a server for processing (e.g., medical image analysis). This creates two major trust issues:

  1. Integrity: How does the client know the server actually ran the correct model and didn't return a "lazy" or tampered result?
  2. Privacy: The server owner wants to keep their proprietary model weights secret.

Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge (zk-SNARKs) solve this by allowing the server to provide a mathematical proof that the computation was done correctly without revealing the model itself. However, standard ZKPs are notoriously slow. Proving a single medium-sized matrix multiplication can take minutes, making it impossible to verify modern, massive models like Transformers (ViT, BERT) in real-time. The bottleneck lies in the "constraints"—the mathematical equations used to represent the computation—which scale poorly as the matrix size increases.

Methods

The authors introduce zkVC, which optimizes the ZKP "circuit" (the mathematical representation of the program) through two primary techniques:

  • Constraint-reduced Polynomial Circuits (CRPC): Standard ZKP representations of matrix multiplication require $O(n^3)$ constraints. CRPC transforms matrix multiplication into polynomial multiplication using a random intermediate variable. This clever mathematical shift reduces the number of constraints from $O(n^3)$ down to just $O(n)$, drastically lowering the computational burden on the prover.
  • Prefix-Sum Query (PSQ): Even with fewer constraints, the "wires" (variables) connecting these constraints can become a bottleneck during the accumulation phase of a dot product. PSQ records prefix sums of intermediate products rather than individual values. This reduces the number of "left-wire" variables, leading to a more lightweight Rank-1 Constraint System (R1CS) and a 70% reduction in R1CS computation costs.
  • Non-linear Function Approximation: Since ZKPs only natively support arithmetic (addition/multiplication), zkVC uses Taylor series and polynomial approximations to handle complex functions like SoftMax and GELU, which are essential for Transformers.

Datasets

The framework was evaluated across both computer vision and natural language processing tasks:

  • Computer Vision: CIFAR-10, Tiny-ImageNet, and ImageNet. Notably, the authors claim this is the first instance of verifiable Transformers being tested on the full ImageNet dataset.
  • NLP: The GLUE benchmark (including MNLI, QNLI, SST-2, and MRPC) using a BERT model.

Key Insights and Ideas

  • The Polynomial Shortcut: The most significant "aha moment" is realizing that matrix multiplication doesn't have to be proven element-by-element. By treating rows and columns as coefficients of polynomials, the prover can verify the entire operation in one fell swoop.
  • Succinctness vs. Interaction: Unlike some prior works (like zkCNN) that require multiple rounds of back-and-forth communication between the client and server, zkVC is non-interactive, making it much better suited for cloud deployments.
  • Hybrid Accuracy: The paper highlights that while "SoftMax-free" models (which use simpler linear attention) are faster to prove, they often lose accuracy. zkVC allows for a "hybrid" approach, using its optimized modules to keep standard SoftMax layers where they matter most for accuracy while maintaining high speed.

Key Results

  • Matrix Multiplication Speedup: zkVC achieves a 12.5x reduction in proving time compared to vCNN, a prior state-of-the-art method.
  • End-to-End Transformer Performance: On Vision Transformer (ViT) models, zkVC achieved over a 15x runtime reduction compared to baselines without these optimizations.
  • Prover Efficiency: Proving time for a matrix multiplication of dimension [49, 320] × [320, 512] was reduced from roughly 3 minutes in standard schemes to just a few seconds.
  • Verification: The verification time on the client side remains extremely low (milliseconds), and the proof size is compact (kilobytes), ensuring that the "succinct" part of zk-SNARK holds true.

Limitations and Future Work

  • Approximation Errors: Using Taylor series for SoftMax and GELU introduces small approximation errors. While the authors show these have a minimal impact on Top-1 accuracy (often <1-2%), extremely sensitive applications might require higher precision.
  • Hardware Constraints: While 15x faster, ZKP proving is still significantly slower than "vanilla" inference. Generating proofs for massive models like GPT-4 would still be prohibitively expensive with current technology.
  • Future Directions: The authors suggest further research into hardware acceleration (using GPUs or FPGAs specifically for ZKP) and exploring even more efficient ways to handle the quadratic complexity of self-attention in very long sequences.

Summary updated

BibTeX
@inproceedings{zhang2025zkvc,
  author = {Yancheng Zhang and Mengxin Zheng and Xun Chen and Jingtong Hu and Weidong Shi and Lei Ju and Yan Solihin and Qian Lou},
  title = {{zkVC: Fast Zero-Knowledge Proof for Private and Verifiable Computing}},
  booktitle = {DAC},
  year = {2025},
  url = {https://openreview.net/forum?id=OqlehIeR0b},
}

Loading related content...

Figure