Skip to main content
QUICK REVIEW

[Paper Review] Trust the Process: Zero-Knowledge Machine Learning to Enhance Trust in Generative AI Interactions

Bianca-Mihaela Ganescu, Jonathan Passerat‐Palmbach|arXiv (Cornell University)|Feb 9, 2024
Adversarial Robustness in Machine LearningComputer Science6 citations
TL;DR

The paper proposes using zero-knowledge proofs to verifiably ensure that outputs from generative AI models come from the correct model, preserving privacy, and introduces snarkGPT as a GPT-2–level ZKML pipeline with empirical scalability analyses.

ABSTRACT

Generative AI, exemplified by models like transformers, has opened up new possibilities in various domains but also raised concerns about fairness, transparency and reliability, especially in fields like medicine and law. This paper emphasizes the urgency of ensuring fairness and quality in these domains through generative AI. It explores using cryptographic techniques, particularly Zero-Knowledge Proofs (ZKPs), to address concerns regarding performance fairness and accuracy while protecting model privacy. Applying ZKPs to Machine Learning models, known as ZKML (Zero-Knowledge Machine Learning), enables independent validation of AI-generated content without revealing sensitive model information, promoting transparency and trust. ZKML enhances AI fairness by providing cryptographic audit trails for model predictions and ensuring uniform performance across users. We introduce snarkGPT, a practical ZKML implementation for transformers, to empower users to verify output accuracy and quality while preserving model privacy. We present a series of empirical results studying snarkGPT's scalability and performance to assess the feasibility and challenges of adopting a ZKML-powered approach to capture quality and performance fairness problems in generative AI models.

Motivation & Objective

  • Motivate fairness, transparency, and reliability in generative AI, especially in health and finance contexts.
  • Develop a protocol to verify that a remote AI service uses the exact requested model without revealing weights.
  • Leverage zkSNARKs to provide cryptographic proofs of correct model execution and output integrity.
  • Demonstrate practicality of ZKML with a GPT-2–sized transformer (nanoGPT) and assess scalability and memory constraints.

Proposed method

  • Describe zkSNARK-based verification for AI inferences (ZKML) and how it provides proofs that the output originates from the requested model.
  • Introduce snarkGPT, a verifiable ZKML pipeline for GPT-2–like transformers, adapted to work with Halo2/KZG backends.
  • Explain EZKL and Halo2 as the backend for constructing zkSNARKs for neural network inferences, including circuit matrices and polynomial constraints.
  • Map transformer components to a finite field suitable for zkSNARK proofs, addressing self-attention and other nonlinearities.

Experimental results

Research questions

  • RQ1How can zkSNARKs be used to verify that AI inferences come from the exact model requested by a client?
  • RQ2Can ZKML provide performance fairness by ensuring uniform model behavior without revealing model weights?
  • RQ3What are the practical costs (time and memory) of generating zkSNARK proofs for transformer-based inferences at GPT-2 scale?
  • RQ4How do model architecture and circuit representation affect the number of constraints and proving efficiency in ZKML?
  • RQ5Is the ZKML approach scalable beyond GPT-like architectures to other neural network models?

Key findings

  • ZKML enables cryptographic proofs that the output is generated by the specified model given a public input and a private model weight witness.
  • snarkGPT demonstrates the feasibility of a GPT-2–sized verifier with a ZKML pipeline, including an end-to-end protocol for proof verification by clients.
  • Empirical results show that proof generation cost grows with embedding size and number of transformer layers, highlighting non-linear scaling considerations.
  • Circuit matrix size substantially affects proof generation time and memory; larger matrices incur high memory usage, up to hundreds of gigabytes in some configurations.
  • The M/N ratio (constraints to parameters) for nanoGPT is significantly higher than in a Modulus Labs MLP model, indicating transformer-based models impose heavier proving workloads.
  • The study confirms the generalizability of ZKML beyond GPT architectures, though transformer models present distinct challenges compared to non-transformer networks.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.