ZKML: An Optimizing System for ML Inference in Zero-Knowledge Proofs

Bing Jyue Chen, Suppakit Waiwitlikhit, Ion Stoica, Daniel Kang

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

Machine learning (ML) is increasingly used behind closed systems and APIs to make important decisions. For example, social media uses ML-based recommendation algorithms to decide what to show users, and millions of people pay to use ChatGPT for information every day. Because ML is deployed behind these closed systems, there are increasing calls for transparency, such as releasing model weights. However, these service providers have legitimate reasons not to release this information, including for privacy and trade secrets. To bridge this gap, recent work has proposed using zero-knowledge proofs (specifically a form called ZK-SNARKs) for certifying computation with private models but has only been applied to unrealistically small models. In this work, we present the first framework, ZKML, to produce ZK-SNARKs for realistic ML models, including state-of-the-art vision models, a distilled GPT-2, and the ML model powering Twitter's recommendations. We accomplish this by designing an optimizing compiler from TensorFlow to circuits in the halo2 ZK-SNARK proving system. There are many equivalent ways to implement the same operations within ZK-SNARK circuits, and these design choices can affect performance by 24×. To efficiently compile ML models, ZKML contains two parts: gadgets (efficient constraints for low-level operations) and an optimizer to decide how to lay out the gadgets within a circuit. Combined, these optimizations enable proving on a wider range of models, faster proving, faster verification, and smaller proofs compared to prior work.

Original languageEnglish (US)
Title of host publicationEuroSys 2024 - Proceedings of the 2024 European Conference on Computer Systems
PublisherAssociation for Computing Machinery
Pages560-574
Number of pages15
ISBN (Electronic)9798400704376
DOIs
StatePublished - Apr 22 2024
Externally publishedYes
Event19th European Conference on Computer Systems, EuroSys 2024 - Athens, Greece
Duration: Apr 22 2024Apr 25 2024

Publication series

NameEuroSys 2024 - Proceedings of the 2024 European Conference on Computer Systems

Conference

Conference19th European Conference on Computer Systems, EuroSys 2024
Country/TerritoryGreece
CityAthens
Period4/22/244/25/24

ASJC Scopus subject areas

  • Computer Networks and Communications
  • Control and Systems Engineering
  • Hardware and Architecture

Fingerprint

Dive into the research topics of 'ZKML: An Optimizing System for ML Inference in Zero-Knowledge Proofs'. Together they form a unique fingerprint.

Cite this