Skip to content

security-Anonymous/zkGPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zkGPT

Introduction

This is the implementation of zkGPT, which is a SNARK for LLM inference. This project partially references code from the work of zkCNN and Lasso. Current implementation only supports GPT-2.

Requirement

Software Requirement

  • C++14
  • cmake >= 3.10
  • GMP library

Recommended Server Configuration

To ensure smooth execution, we recommend using a server with the following specifications:

  • Operating System (OS): Linux (e.g., Ubuntu 18.04 or later)
  • Processor (CPU): Multi-core CPU, preferably with 16 cores or more
  • Memory (RAM): at least 200GB

Experiment Script

Clone the repo

To run the code, make sure you clone with

git clone --recurse-submodules [email protected]:security-Anonymous/zkGPT.git

since the mcl library is included as a submodule.

Install GMP Library

sudo apt install libgmp-dev

Run a demo of proving LLM inference

The script to run LLM inference proving.

./llm.sh

Performance Notes

The circuit initiation phase may take minutes because brute-forcely computing plaintext matrix multiplication using CPU single thread. We will optimize this part in future. Note this part will not become bottleneck in real world, due to it can be computed extremely efficiently on GPU.

Reference

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages