This project conducts differentially-private machine learning, ultimately producing both a model which can be readily used in a MLaaS setting, and a quantum-secure, non-interactive cryptographic proof that the program was executed honestly. It is derived from the RISC-Zero starter template.
To better understand the concepts behind this template, check out the Structure of a zkVM Application explainer.
Make sure you have the required dependencies:
sudo apt install curl build-essential libssl-dev pkgconf
install
Rust if you don't already have it, then install the cargo risczero
tool:
cargo install cargo-risczero
Next we'll need to install the risc0
toolchain with:
cargo risczero install
First, make sure rustup is installed. This project uses a nightly version of Rust. The rust-toolchain
file will be used by cargo
to automatically install the correct version.
The following command reads an (x,y) dataset from the csv included with this repo.
cargo run --release
Or, if you have CUDA and a GPU available:
cargo run -F cuda --release
Expect a lengthy, one-time build process when running with CUDA for the first time.
It processes the dataset into a vector, initializes the prover/guest, and commits the dataset to the guest environment. Following training, a "receipt" is produced which verifies the integrity of the computation. The receipt is zero-knowledge, and together with the differentially-private model, nothing is revealed about the training data.
DP Training Converges to Expected Model: