Abstract
Machine Learning as a Service (MLaaS) allows clients to outsource computationally intensive training tasks to cloud providers. However, the lack of transparency creates a "trust gap" regarding service correctness, accounting, and fair payment. We present VeriML, a framework that combines zero-knowledge proofs (SNARKs) with blockchain technology to provide verifiable training iterations and atomic fair payments. By utilizing probabilistic sampling, state chaining, and ML-specific circuit optimizations, VeriML ensures that clients can verify the integrity of the training process with minimal overhead, while maintaining model confidentiality until payment is secured.
Introduction
The rise of Machine Learning as a Service (MLaaS) has enabled users to leverage powerful cloud infrastructure for model training. Despite its benefits, MLaaS suffers from a fundamental trust gap. Clients often pay for a "black box" service without guarantees that the server actually performed the requested training iterations correctly or honestly. Specifically, three critical assurances are missing:
- Service Correctness: Ensuring the server executed the algorithm as specified rather than returning a heuristic guess.
- Trustworthy Accounting: Verifying that the billed iterations (e.g., 10,000) were actually completed.
- Fair Payment: Solving the "atomic swap" dilemma where the client wants the model before paying, and the server wants payment before releasing the model.
Existing Verifiable Computation (VC) techniques are often too slow for iterative ML or require revealing the model during verification, which compromises commercial interests. VeriML addresses these challenges through a novel "commit-and-prove" protocol.
System Architecture
VeriML bridges the trust gap by integrating succinct zero-knowledge proofs (SNARKs) with a blockchain-based payment layer. The workflow involves three main entities: the Server, the Client, and the Blockchain.
The server commits to the training process by generating proofs and identifiers for specific iterations. To ensure fairness, the server provides an "Encrypted Model" to the client. The client can verify the correctness of the training via the "Verification" module without seeing the raw weights. Once verified, a "Hash Check Contract" on the blockchain facilitates the exchange of the decryption key for the payment, ensuring an atomic and fair transaction.
Technical Innovations
To make verification practical for large-scale ML tasks, VeriML introduces several optimizations:
- Probabilistic Sampling: Instead of verifying every iteration, VeriML randomly samples a subset. This "spot check" approach provides high mathematical confidence in the entire process's honesty while significantly reducing overhead.
- State Chaining with Identifiers: Each iteration's proof is linked to the previous state's hash, creating a continuous, tamper-evident chain of computation.
- Model Blinding: By using a client-provided random coefficient vector to generate identifiers, the client can verify state transitions without exposing the underlying model weights.
- Arithmetic Circuit Optimizations:
- Remez Algorithm: Approximates non-linear functions like the sigmoid more accurately than Taylor expansions within arithmetic circuits.
- Freivald’s Algorithm: A probabilistic method to verify matrix multiplications in $O(n^2)$ time instead of the $O(n^3)$ required to compute them.
- Fixed-Point Arithmetic: Implements decimal handling within the integer-based finite fields of SNARKs.
Evaluation and Results
The authors evaluated VeriML across six common algorithms (Linear/Logistic Regression, SVM, Neural Networks, K-Means, and Decision Trees) using datasets such as BHP, US Census, MNIST, and Nursery.
Key findings include:
- Efficiency: For a linear regression task with 100,000 iterations, the verification overhead is only 2.2% of the native execution time.
- Scalability: Communication is highly efficient; 10,000 iterations require only 317 KB of proof data.
- Accuracy: The use of 32-bit fixed-point representation resulted in no significant accuracy loss compared to floating-point implementations.
- Security: The system is highly tunable. For 100,000 iterations, verifying just 14 random samples provides >99% confidence that the server did not skip more than 30% of the work.
Conclusion
VeriML demonstrates that integrity and fairness in MLaaS are achievable with practical overhead. While the system currently faces challenges such as potential Denial-of-Service (DoS) from aborting parties and the high memory requirements of SNARK generation, it provides a robust foundation for verifiable and fair cloud-based machine learning. Future work will focus on optimizing circuits for more complex modern activation functions.
Summary updated