Blockchain Innovations with Nethermind:Exploring zkML & More - ETHGlobal Brussels 2024
ETHGlobal·Wed, Oct 9, 2024, 12:00 AM
Join Albert Garreta from Nethermind, for a workshop titled, “Blockchain Innovations with Nethermind:Exploring zkML & More.” We cover many aspects of blockchain, including core engineering, security services, formal verification, smart contract audits, research, infrastructure management, dApps & enterprise engineering, and AI & ZK engineering. In this workshop, we will focus on zkML, security-driven development, preconfirmations, and large-scale compute. You will also learn more about the Nethermind prizes. This workshop took place during ETHGlobal Brussels, a 3-day hackathon held in Brussels, Belgium from July 12 to 14, 2024. ETHGlobal Brussels brought together the most skilled web3 developers, designers and product builders from all around the globe for a weekend-long adventure to advance the Ethereum ecosystem! ---------------- Follow us: x.com/ethglobal Website: https://ethglobal.com Email us at: hello@ethglobal.com
Transcript
[Music] all right thanks everyone for being here and for taking interest in Nether mindes and bounties uh here I'll I'll briefly discuss the four of them but I'll focus on zkl so I'll speak about zkl first and at the end I'll I'll briefly mention the other bounties and point you to to people in our team that you should speak to for more information okay so our zml bounty has to build a project that combines ZK technology and machine learning and of course this is a very open-ended description so let's look at some possible approaches uh that you may take to this bounty so zkl technically um we use the term zkl to refer to any application that uses ZK technology uh in combination with machine learning or AI so here by ZK we don't specifically mean zero knowledge we mean singly verifiable computation or zero knowledge so we don't really care it is possible that we don't have actual zero knowledge and we only care about sex inness so that's perfectly valid so zkl is a wide area of research and Engineering some of these areas that I think are very interest interesting at least for this bounty are proof of correct inference proof of training and Federated learning so let's see proof what's proof of inference so in proof of in inference we have a model let's call it f and let's say that this model is signed by a trusted party and let s be the signature so in proof of inference there is a public input X and one wants to create a z proof for the following statement one wants to prove that the mo there is a model that has been valid that has a valid signature and that when run on input X okay so here it should say x when run on input X the models output F ofx satisfies some property for example f ofx is bigger than zero so this is a bit abstract so let's look at an example so say that f is a model that takes a a phase photo and determines if the phase corresponds to a legal legal citizen of the country and S is a signature of the model that is made by the government so now Bob could check that Alice is a legal citizen by checking that s is a valid signature of the model and running the model f on a picture of Alice's face and checking that the output of the model is say positive okay um yeah so this is exactly the copy of example however you you could do that but this means for example that every time that Alice wants to prove that she's a citizen the whole model needs to be run so Bob needs to run the model over and over again so if he and if if Alice wants to prove that she's a citizen to several parties then uh each one of the parties has to run the model so an alternative could be that Alice creates a saxing proof by of these two claims that valid signature and that F the output of the model is positive so it it creates a SX improv and this way whenever Alice wants to prove that she's a legal citizen Alice just sends the proof a picture of his her face and the signature and then Bob just verifies that the proof is valid so that's um typical use case of proof of inference this is for example how worldcoin wants to use zkl so yeah so in the worldcoin in W coin wants to do precisely this and in here s would be a signature of w coin and note that Bob doesn't even need to know the model it just needs to know that it is signed by a party trust like a government okay so yeah here we only need we only care about Pi being sucing here we don't really care about zero knowledge we don't we don't want to to hide data here here we just want that the proof is short and that it can be verified very cheaply and yeah depending on the on the application Maybe f is not signed it's committed maybe f is public um yeah so and this branch of zkl is a a currently a very hot topic of research and Engineering so I highly encourage you to to take a look at this one if you are interested in zkl so in proof of then there's another branch of zkl proof of training so in proof of training there's a usually a private data set and um a model so I didn't know the model fwx so here x is the input to the model and W are the parameters and in yeah in many applications you have a commitment to the data set and to the model or to some of them and recall what what does training mean training me training a model on a data set d means finding parameters so that when you use these parameters on the model the model makes good predic on this data set so the goal of proof of training is to create a ZK proof of the following statement I know a data set D whose commitment is some public value and I know some parameters W such that the model with those parameters to commit to some public value and these parameters are the result of running certain training algorithm for the model on the data set and yes and so you this is exactly the end of the last uh slide and why would you why would we want to prove this well there are several interesting use cases for proof of training uh you there's distributed training where a model owner distributes the training of the model among untrusted workers so there are several untrusted workers you want them to train your model so you ask them to train the model and also provide the proof that they trained it correctly because you don't trust them so you you could create some kind of marketplace of trainers or for example ARB tring copyright claims where a model owner proves that the model was trained on on data that doesn't contain copyrighted data okay so yeah proof of training is quite a tricky area of zkl and this is because as you know training a model is orders of magnitude more more expensive than uh running a model so in and just proving proof of inference is already quite a tricky area of of ZK it's quite hard to do efficiently if the model is large So Pro of training for for example large language models is sort of Out Of Reach at the moment so this this track of this this approach to our Bounty is kind of more difficult than proof of inference but yeah if you want to to Center to focus your project on this on proof of training that's perfectly fine we will take into account that this is a harder um aspect that that this is harder than proof of inference and yeah if you want to do this I recommend you focus on on small models that you prove training of small models perhaps classical models instead of deep learning models or if you want to work on deep learning models then just use models with a small amount of parameters okay so proof of inference let's go back to proof of in inference and some some ideas on how you might tackle um this topic so I would recommend you look at existing zkl Solutions and improve some parts of it in the Bounty description we have several links and one of the links is aome awesome zkl it's a GitHub repo maintained by W coin and there's lots of um ckl Solutions in there so one possible way to start the project is to check those and look at one of them and try to improve a small part of it so possible aspects of zkl that I think need Improvement and that at nether mind we are working on improving are the the following the treatment of floating Point arithmetic the fact that models in deep learning are self similar I'll explain what this means in a moment and the fact that there's many nonlinearities in the models and yeah now I will talk about these three points but um very important point if you want to work on this on this bounty be creative the the best thing you can do for the Bounty is to be creative and have a have a great idea even if yeah so cre creativity is gold so don't limit yourself to what I'm saying here if you have nice ideas please pursue them and surprise us okay so one area of improvement I think that like it's right for it's lwh hanging fruit for zkl is leveraging the fact that models are are often the result like the computation of a deep learning model is often the result of apply applying the same computation many times over and over again for example um in a deep learning model there's maybe a layer like a say a convolutional layer that's applied dozens dozens of times in a row and even for example in a single layer there's many computation the same computation that repeated many times for example a convol convolutional layer applies uh the same filter many times for many B so it applies the filter to lot of patches of the input right and the same Matrix Vector multiplication can also be split into uh chunks of computation where each computation is the same and a popular technique to approach computations where this happens that computations where that can be split into smaller computations that look the the same is to use folding so in a folding scheme just crash course on on folding schemes there's a pro and verifier the prover has to two statements that wants to prove and then the pr and verifier interact to create create a new statement so that if this new statement is valid then the two initial statements were valid so in more plain terms a folding scheme reduces the task of proving two statements to proving a to the task of proving a single one so you can use folding schemes to prove large statements so say that xw is the large statement you can break this large statement into very small parts parts each one from the same this basically the same computation and then you fold all these small parts into a single one and then you prove the the folded instance so I think that zml is right for is ready for this type of of tech technique what's the time 5 minutes okay so let's look at this one and then um I'll skip the the later point and we can discuss after the me after the talk okay so deep learning models deal mostly with linear operations most most operations happening in a deep learning model are inner products or Matrix multiplications however there's there's crucial nonlinear operations happening in in the models such as Rel soft Max Max pulling Etc and proving this in a in a ZK Nar can introduce a huge computational burden because um as you know CK proof schemes rely on proving statements about field operations addition and multiplication between field elements however Rel and sof Max Max ping Etc have nothing to do with field operations and writing this this this nonlinearities as addition and multiplications between field elements leads to a huge blowout in the in the statement you are you are proving and yeah a popular way to T to tackle this problem in general not only in zkl is to use look up arguments when you want to prove something that's very hard to Ari matize you can use a lookup argument this is already being done in some zkl applications but I think it can be done uh in a much more deeper way so if you want to know more about this please come talk to me afterwards okay so I'll skip this explanation of look up arguments yeah and so yeah that's my overview of this bounty as I said please talk to me if you are interested on in working on zkl I'll be very happy to expand on any of the points I I mentioned our other bounties are the following um security driven development in this bound the goal of this bounty is to design uh to develop some cool code and focus on how to make sure that the code is secure so here we suggest you either use fasing or formal verification there other B another bount is large scale compute in this bounty the goal is to leverage L2 uh L2 rollups where fees are cheap so as to build an application that's not possible to run on ethereum uh an application that uses a lot of computation for example some game that requires a lot of computation or maybe uh training models on uh on stet for example and then prec confirmations innovation uh anything that has to do with pre-confirmation uh even if it's just a theoretical exploration is welcome in this in this area for any of if if you are interested in any of these um bounties please come talk to to us in our stand and yeah as final remarks we are hiring so we are both hiring for fulltime positions and then we have a wonderful internship program um yeah if you are interested in working with us you want to work on any of the topics I just uh talked about right now or many more please reach out to us and please reach out to a uh in the back of the room uh thanks [Music]
Automatic transcript — names and jargon may be misspelled.