zkML and the Convergence of AI and Crypto
Augmenting smart contracts with machine learning moves the industry closer to its initial vision of "automation at the center, humans at the edges."
The post was originally written in September 2023.
The term DAO, as originally coined by Vitalik Buterin in 2014, refers to "an entity that lives on the internet and exists autonomously, but also heavily relies on hiring individuals to perform certain tasks that the automaton itself cannot do." As blockchains have gotten more modular and complex, the desire for “automation at the center, humans at the edges” seems further and further removed.
Zero-knowledge learning (zkML), which enables AI models to serve as provable extensions to smart contract logic, introduces a new paradigm that unlocks more advanced and complex decentralized protocols, while minimizing the need for human governance over complex, dynamic functions. zkML provides a guarantee that a user knows that the model’s operator won’t be able to switch out model weights, architecture, or inputs and influence the final outcome (aka “verified AI inference”).
The primary abstract problem that zkML attempts to solve is, “If a model is behind a service, how do you know what model is running?” Example use cases include:
zkML offers computational integrity, and anomaly / fraud detection
It also offers privacy measures: a ML provider might want to keep model weights hidden; ZKML can help prove that they ran the model that they say they ran properly
A secondary problem it’s solving is, “How do you know the inputs are valid and how do you know they are incorporated property in the model?”
Given the privacy features of zkML, handling sensitive data with compliance requirements is an obvious use case (e.g., health care data or private KYC).
A good example of this would be applying a machine learning model on some sensitive data where a user would be able to know the result of model inference on their data without revealing their input to any third party.
Currently, a consumer does not have an avenue to post-process or check a model’s outputs and must trust a brand to operate the right model. zkML offers the medium to decouple trust in a brand from trust in the underlying model, proposing a new gold standard that implies a machine is best suited to check if a machine is running properly (not the user). For example, a lending protocol could use zkML to have an AI model govern its risk parameters, such as loan collateralization ratios, without compromising on trust guarantees the protocol seeks to offer because the model could be proven to have run as specified.
In this way, zkML will enable AI agents to be placed at the center of decentralized protocols, obviating the need for more subjective, manual processes over dynamic inputs, which are often coordinated by humans today.
Projects like Modulus Labs, ZKonduit, and Giza are exciting early leaders in this emergent space, all aiming to enable AI models to serve as provable extensions to smart contract logic. Borrowing heavily from zk-rollups, projects like Modulus Labs leverages the efficiencies of centralized compute by running an AI model’s architecture and inputs through an zk-proof system off-chain, before publishing the proof of that inference on-chain (i.e., this model created these outputs using specific inputs).
While there are persistent foundational challenges – including but not limited to: 1) scaling the complexity of models that can be handled, 2) optimizing for speed of proofs, and 3) standardizing hardware support for biometrics – in the first year of its existence, the industry has made rapid progress on the R&D of the underlying technology, suggesting a promising future for zkML and its potential to seamlessly integrate AI agents into decentralized protocols. Though the technology is in its infancy and inefficient as it stands today, there are a number of real-world use cases that leaders in the industry are testing, as outlined in this Worldcoin Blog.
My view is that in the near future, there will be a market of applications leveraging zkML on-chain. Augmenting smart contracts with machine learning is the most interesting intersection of what AI can unlock for crypto applications since it moves the industry closer to its early vision of "automation at the center, humans at the edges." This emerging technology not only addresses critical challenges in trust and privacy, but also promises a new standard where machines validate the actions of machines, reducing the need for subjective, human-mediated processes.
For an introduction on this topic, I suggest reading An introduction to zero-knowledge machine learning (Worldcoin).