Zero-knowledge machine learning (ZKML) lets AI agents prove they executed a specific model on specific inputs and produced specific outputs, without revealing the model weights, the input data, or anything beyond the correctness of the claim. Aleo's native zero-knowledge proof infrastructure provides the foundation for this kind of application.
The question ZKML answers is simple: how do you trust a computational claim made by autonomous software? An agent says it ran a model. Did it? ZKML gives you a cryptographic answer instead of a social one. The prover generates a mathematical proof that a specific computation occurred correctly. The verifier checks that proof in milliseconds and learns nothing about the underlying data or model. No reputation system. No blind faith. Just math.
What Is ZKML
Zero-knowledge machine learning is the practice of generating a zero-knowledge proof that a particular machine learning model produced a particular output from a particular input. The proof attests to the integrity of the computation: that inference was carried out faithfully according to the model's architecture and weights, without disclosing any of the private variables involved.
To be precise about the claim: a ZKML proof says "There exists a model M with weights W, and an input X, such that M(X) = Y, and the commitment to M matches the published commitment C_M." The verifier learns Y (or a commitment to Y) and can confirm that the computation was honest. The verifier does not learn W, does not learn X (unless the prover chooses to reveal it), and does not learn anything about the internal activations of the model during inference.
That is a useful primitive. But be equally clear about what ZKML cannot do.
A zero-knowledge proof of inference does not tell you the model is accurate, fair, unbiased, or fit for any purpose. It proves correct execution, not correct design. If a model was trained on biased data and produces discriminatory outputs, a ZKML proof will faithfully confirm that yes, the biased model did produce the discriminatory output. The proof says the computation was done correctly. It says nothing about whether the computation was worth doing.
ZKML also does not prove that a model was trained correctly or that training data met some quality standard. Training verification (proving that a model's weights result from a specific training procedure applied to a specific dataset) is a related but distinct research problem. It currently sits beyond the practical frontier of ZK proof systems because representing full training runs as arithmetic circuits is enormously expensive.
What ZKML does offer is a foundation for computational accountability. Combine it with commitments to specific model versions, auditable model registries, and well-defined inference protocols, and you get a cryptographic layer that makes verification possible without surveillance.
Why AI Agents Need Verifiable Inference
Autonomous AI agents introduce a trust problem that traditional software architectures were not designed for. When Agent A delegates a task to Agent B (running a credit scoring model, classifying a medical image, evaluating a smart contract for vulnerabilities), Agent A has no native way to verify that Agent B actually performed the requested computation.
Agent B could have run a cheaper, less accurate model. It could have fabricated the output entirely. It could have run the correct model on different inputs. In a competitive agent marketplace, the economic incentive to cut corners is real.
Today, this trust gap is bridged through blunt mechanisms: reputation systems, legal contracts, centralized intermediaries that vouch for service providers, or just running the computation yourself and skipping delegation altogether. None of these scale well when thousands of autonomous programs transact with each other at machine speed.
ZKML offers a cryptographic alternative. If Agent B generates a zero-knowledge proof alongside its inference result, Agent A can verify the proof and gain mathematical certainty that the computation was performed correctly. No reputation system needed. No intermediary. No re-execution.
The proof is the trust layer.
Here are three concrete scenarios where this matters:
Regulatory compliance without data exposure. A financial institution must prove its AML model was applied to every transaction, but it cannot share customer financial data with auditors directly. ZKML lets the institution generate proofs that its compliance model processed each transaction and produced specific risk scores, without revealing any customer data to the verifying party. The regulator sees proof of process. The customer's privacy stays intact.
IP protection for model owners. An AI company that spent millions training a proprietary model faces a dilemma when potential customers want evidence the model works before licensing it. Traditionally, this means either exposing the model (risking theft) or asking the customer to take marketing claims on faith. With ZKML, the model owner proves their model produces correct outputs on agreed-upon test inputs without ever revealing the weights. The weights stay private. The performance claims become verifiable.
Agent-to-agent service verification. In a multi-agent system, specialized agents offer inference-as-a-service. An image classification agent charges per query. A risk assessment agent charges per evaluation. The paying agent needs assurance that it received the output of the model it paid for, not a degraded substitute. ZKML proofs, attached to each inference result, provide that assurance at the protocol level.
How ZK Proofs Work for ML Models
Understanding how zero-knowledge proofs apply to machine learning requires a simplified picture of the proof pipeline. Four stages: circuit construction, witness generation, proof generation, and verification.
Circuit construction. A zero-knowledge proof operates over an arithmetic circuit, a directed acyclic graph of addition and multiplication gates over a finite field. To prove a statement about an ML model, you must express the model's inference computation as such a circuit. Every operation in the forward pass (matrix multiplications, activation functions, normalization layers, softmax computations) must be decomposed into field arithmetic. This is the compilation step, and it is where much of the engineering difficulty lives.
Some operations translate more naturally than others. Linear operations (matrix multiplication, bias addition) map cleanly to arithmetic circuits. Nonlinear activation functions like ReLU, sigmoid, or GELU are harder because they involve comparisons or transcendental functions with no direct representation in finite field arithmetic. In practice, these are handled through lookup tables, piecewise approximations, and range-check gadgets: specialized circuit components that implement the desired function within the constraint system.
The circuit's size is roughly proportional to the number of operations in the forward pass. A small neural network with a few thousand parameters might yield a circuit with millions of constraints. A model with millions of parameters can produce circuits with billions of constraints. Circuit size is the primary bottleneck.
Witness generation. The witness is the set of all intermediate values produced during the computation: every activation, every partial product, every value at every gate. The prover computes it by running the model's forward pass with the actual inputs and weights. This step costs roughly as much as running the model normally, plus some overhead for maintaining the exact field-arithmetic representation.
Proof generation. This is the expensive part. The prover takes the circuit, the witness, and the public inputs (such as the output and the commitment to the model) and generates a cryptographic proof that the witness satisfies the circuit's constraints. For SNARK-based systems, this requires cryptographic operations proportional to the circuit size, involving multi-scalar multiplications and fast Fourier transforms over large fields. For a circuit with N constraints, proof generation generally runs in O(N log N) time.
In practical terms: a model that runs inference in 10 milliseconds might require 10 seconds to 10 minutes for proof generation, depending on model size and proof system. This overhead is the central cost that ZKML research is trying to reduce.
Verification. Once the proof exists, verification is fast. For SNARK-based systems, verification runs in constant or near-constant time regardless of circuit size. A proof for a billion-constraint circuit can be verified in a few milliseconds. This asymmetry (expensive proving, cheap verification) is exactly what makes ZKML useful. The prover pays the cost once. Any number of verifiers check the result cheaply.
Current limitations. As of early 2026, practical ZKML is constrained to relatively small models. Fully verified inference has been demonstrated for models with tens of thousands to a few hundred thousand parameters: small convolutional networks, shallow decision trees, logistic regression models, compact classifiers. Models in the tens-of-millions range push current proving systems hard, requiring hundreds of gigabytes of RAM and hours of proving time. Billion-parameter models like modern LLMs are not yet within reach.
Research is pushing these boundaries through several approaches: more efficient proof systems with lower constant factors, recursive proof composition (breaking a large proof into smaller sub-proofs verified incrementally), GPU and custom ASIC acceleration, and hybrid approaches that verify only the most sensitive portions of a model's computation.
Aleo's Role in ZKML
Aleo occupies an unusual position in ZKML because its entire architecture is built around zero-knowledge proofs. Unlike blockchains that bolted on ZK capabilities after the fact or use ZK proofs solely for scalability (as in ZK-rollups), Aleo's execution model is ZK-native. Every program execution on Aleo produces a zero-knowledge proof by default. That creates natural infrastructure for ZKML applications.
A programmable ZK-proof system for arbitrary circuits. Aleo programs are written in Leo, a high-level language that compiles to R1CS (Rank-1 Constraint Systems) and subsequently to the proof artifacts needed for Aleo's proof system. While Leo was designed primarily for smart contracts (token transfers, state transitions, access control), the underlying constraint system is general-purpose. Any computation that can be expressed as an arithmetic circuit can, in principle, be compiled to an Aleo program and proven on the network. That includes ML inference circuits, provided they fit within the system's practical constraints.
In practice, encoding a neural network inference as a Leo program requires careful attention to fixed-point arithmetic (Leo operates over finite fields, not floating-point numbers), circuit size limits, and proof generation time. Small models can be expressed directly. Larger models may need off-chain proving with on-chain verification of the resulting proof.
On-chain verification. Aleo's blockchain is a public verification layer. A ZKML proof generated off-chain can be submitted to an Aleo smart contract that verifies the proof and records the result. This creates an immutable, publicly auditable record that a specific inference occurred correctly, without revealing any private data. Other programs and agents can query this record and condition their behavior on verified inference results.
The verification cost on Aleo is modest. Verifying a SNARK proof on-chain requires fixed computation regardless of the original inference's complexity. Even as ZKML systems target larger models, the on-chain verification cost stays constant. That matters for economic viability.
The record model for private state. Aleo's record model provides a way to store proofs, credentials, and inference results privately. An Aleo record is a piece of encrypted state owned by a specific address. ZKML proofs, model commitments, and inference attestations can be stored as records, visible only to their owner but verifiable by anyone who receives the proof. This is well-suited to ZKML applications where inference results may themselves be sensitive (medical diagnoses, financial risk assessments, security evaluations) and should not sit on a public ledger in cleartext.
Where things actually stand. ZKML on Aleo is early-stage work. As of this writing, no production-grade ZKML application is deployed on Aleo mainnet. The tooling for compiling ML models into Leo programs or Aleo-compatible circuits is nascent. The practical model size that can be proven within Aleo's constraint system is limited to small models. Aleo's value for ZKML is not about what is deployed today. It is about architectural alignment: as ZKML proof systems mature and model-to-circuit compilers improve, Aleo provides a verification and privacy layer that does not need retrofitting.
Research collaborations and open-source tooling efforts are underway to bridge the gap between ML frameworks (PyTorch, ONNX) and Aleo's proof system. The path from a trained model to an Aleo-verifiable proof involves model quantization (converting floating-point weights to fixed-point representations), circuit compilation, optimization passes to reduce constraint count, and integration with Aleo's proving infrastructure. Each step is an active area of development.
Agent Identity and Credentials
Full ZKML (proving that a specific neural network produced a specific output) remains demanding. But a closely related and more immediately practical use case is agent identity and credential verification. This uses the same cryptographic primitives on much smaller circuits. It is deployable on Aleo today.
In a multi-agent ecosystem, agents need to prove things about themselves. That they are authorized to act on behalf of a specific user. That they hold a valid license for a particular jurisdiction. That they have been audited and meet certain compliance standards. That they have access to a specific model version. That their operator has staked a bond as a guarantee of good behavior.
All of these claims involve information the agent should not have to broadcast publicly.
Zero-knowledge proofs let an agent prove possession of a credential without revealing the credential itself. An agent can prove "I hold a valid KYC certificate issued by an authorized provider" without revealing the certificate, the provider's identity, or any personal data. An agent can prove "I am authorized to execute trades up to $100,000 on behalf of account holder X" without revealing X's identity or account details.
On Aleo, these credential proofs are program executions. A credential is stored as a private record. A verification program checks that the record meets certain conditions (valid signature from an issuer, unexpired timestamp, matching capability flags) and produces a proof that the check passed. The verifying party receives the proof and learns only that the conditions were satisfied.
This pattern, sometimes called "selective disclosure" or "zero-knowledge credentials," is directly applicable to agent-to-agent interactions today. When Agent A encounters Agent B for the first time, Agent B presents a bundle of zero-knowledge proofs attesting to its capabilities, authorizations, and compliance status. Agent A verifies these proofs on-chain or off-chain and decides whether to transact. No centralized identity provider needed. No sensitive data exposed. The trust is rooted in cryptography.
The connection to ZKML is direct. As proof systems become efficient enough to handle model inference, the same credential infrastructure extends to include proofs about model execution. An agent's credential bundle might eventually include not just "I am authorized" but also "I ran model M version 3.2 on your input and here is the verified output." The credential system and the inference verification system share the same cryptographic foundation and the same on-chain verification layer.
The Road Ahead
ZKML is defined by its trajectory as much as its current capabilities. The gap between what is theoretically possible and what you can actually deploy is narrowing, driven by advances in proof systems, hardware, and tooling.
More efficient proof systems. The zero-knowledge proof field is moving fast. Newer systems like Plonky2, Halo2, and various folding schemes (Nova, SuperNova, HyperNova) offer significant improvements in prover efficiency over earlier systems. Folding schemes are particularly interesting for ZKML because they allow incremental verification. A large computation can be broken into steps, each step folded into an accumulating proof, with the final proof attesting to the entire sequence. This maps naturally to neural network inference, where each layer's computation can be folded into a running proof without materializing the entire circuit at once.
These advances do not eliminate proving overhead. They reduce it. Operations that required hours of proving time in 2023 may require minutes in 2026 and seconds in the years ahead.
Hardware acceleration. Proof generation is computationally intensive but highly parallelizable. The core operations (multi-scalar multiplication, number-theoretic transforms, polynomial evaluations) are well-suited to GPUs, and several teams have demonstrated order-of-magnitude speedups by moving ZK provers onto them. Beyond GPUs, custom ASIC designs for ZK proving are in development, with the potential to reduce proving costs by another one to two orders of magnitude. As ZKML workloads grow, dedicated proving hardware may become as common in the infrastructure stack as GPUs are for training and inference today.
Standardized verification circuits. One barrier to ZKML adoption is that current implementations are bespoke. Each model architecture requires a custom circuit, and changes to the model (different layer sizes, different activation functions, different normalization schemes) require circuit recompilation. Standardization efforts aim to create reusable circuit templates for common operations: matrix multiplication gadgets, activation function libraries, attention mechanism circuits. These can be composed to represent a wide variety of architectures without custom engineering for each one.
The ONNX (Open Neural Network Exchange) format provides a natural abstraction layer. A model exported as an ONNX graph can be systematically converted to an arithmetic circuit using a standardized compiler. Several research projects are pursuing ONNX-to-circuit compilers. Their maturation will make ZKML significantly more accessible.
Hybrid verification approaches. Full end-to-end proof of inference may not always be necessary or economical. Hybrid approaches verify the most important portions of a computation while leaving the rest unproven or verified through cheaper means. For example, you might generate a full ZK proof for the final classification layer (proving that a specific feature vector maps to a specific output) while using a cheaper commitment scheme for the earlier layers. The security properties are weaker than full verification, but the cost savings can be substantial. For many applications, the partial guarantee is enough.
Aleo as a verification layer for ZKML. Aleo's ZK-native architecture positions it as a natural settlement and verification layer for ZKML applications. The things ZKML requires (programmable proof generation, on-chain proof verification, private state management, a network of provers) are already core components of the Aleo network. As ZKML tooling matures, the integration path to Aleo is shorter than the path to blockchains that would need to add ZK verification capabilities from scratch.
The long-term vision is an agent ecosystem where computational claims are routinely backed by cryptographic proofs. An agent that asserts "I ran model X and the result is Y" can back that assertion with a proof that any other agent, smart contract, or human auditor can verify independently. The model weights stay private. The input data stays private. The proof is public and permanent. That is the promise of ZKML. The field has real engineering work ahead, but the underlying cryptography is sound, the trajectory of improvement is clear, and the infrastructure is being built.
Sources
Frequently Asked Questions
Can ZKML prove that an AI model is unbiased?
No. ZKML proves that a specific computation was executed correctly - that a given model produced a given output from a given input. It says nothing about whether the model itself is fair, accurate, or unbiased. Bias is a property of the training data and model design, not of a single inference execution. ZKML can be combined with other auditing mechanisms (such as proving that a model was trained on a certified dataset, or that a fairness metric was computed correctly), but the zero-knowledge proof of inference alone does not address bias.
How large a neural network can be verified with ZK proofs today?
As of early 2026, fully verified ZK inference has been demonstrated for models with up to a few hundred thousand parameters - small convolutional networks, compact classifiers, and shallow architectures. Models with tens of millions of parameters are at the experimental frontier, requiring substantial compute resources and extended proving times. Models with billions of parameters, such as modern large language models, are not yet feasible for full ZK verification with publicly available proof systems. Research into recursive proofs, folding schemes, and hardware acceleration is actively pushing these limits upward.
Is ZKML the same as federated learning?
No. Federated learning and ZKML address different problems. Federated learning is a training technique where multiple parties collaboratively train a model without sharing their raw data - each party trains on local data and shares only model updates. ZKML is a verification technique where a prover demonstrates that a specific inference computation was performed correctly without revealing private inputs or model weights. Federated learning concerns how a model is trained. ZKML concerns how a model's inference is verified. They can be complementary: a model trained via federated learning could later have its inference verified via ZKML.
What is the performance overhead of generating ZK proofs for ML inference?
Proof generation for ML inference is currently orders of magnitude more expensive than the inference itself. A model that runs inference in milliseconds may require seconds to minutes for proof generation, depending on model size and the proof system used. The overhead stems from the cost of cryptographic operations (multi-scalar multiplications, polynomial commitments) applied to the circuit representation of the model. Hardware acceleration via GPUs can reduce this by 10-100x, and ongoing research into more efficient proof systems continues to narrow the gap. Verification, by contrast, is extremely fast - typically a few milliseconds regardless of model complexity.
Can ZKML work with large language models?
Not with current technology for full end-to-end proof of inference. Large language models have billions of parameters and involve computations (attention mechanisms, layer normalization, large matrix multiplications) that produce circuits with trillions of constraints. This exceeds the capacity of any current ZK proof system. However, partial approaches are being explored: verifying only specific layers or components, using recursive proof composition to break the computation into manageable chunks, or proving properties of the output (such as that it was generated by a model matching a specific commitment) without proving every individual operation. Full LLM verification remains a long-term research goal.
How does ZKML relate to agent-to-agent trust?
ZKML provides a cryptographic mechanism for one agent to verify another agent's computational claims. When Agent B tells Agent A "I ran model M on your data and the result is Y," ZKML allows Agent B to attach a proof that Agent A can verify independently. This eliminates the need for Agent A to trust Agent B's honesty, re-run the computation itself, or rely on a trusted intermediary. In a multi-agent economy where agents routinely delegate inference tasks to specialized service providers, ZKML transforms trust from a social or institutional problem into a mathematical one.