
zkPyTorch: The most efficient compiler for verifiable machine learning
Turn standard models into verifiable ZK circuits. No cryptography required, just PyTorch.
What is zkPyTorch?
zkPyTorch is a next-generation compiler that transforms standard PyTorch machine learning models into zero-knowledge proof-compatible programs. It allows developers to prove that a model inference was computed correctly—and can be used for both open-source and proprietary models.
With zkPyTorch, you can:
Convert unmodified PyTorch models into ZK circuits
Generate proofs of correctness for model outputs
Protect proprietary AI models and user data
Build trust into AI workflows with cryptographic verification
Building trust into AI workflows
Scalable, Real-World Performance
zkPyTorch powers proof generation for complex, large-scale models:
VGG-16 on CIFAR-10:
~2.2 seconds per proof (1 CPU core)Llama-3 (8B parameters):
~150 seconds per token (1 CPU core)All proofs are compatible with Polyhedra's Expander ZKP backend—built for parallelism, speed, and
composability.
Easy Integration
No need to redesign your model or learn ZK internals. zkPyTorch integrates directly with standard PyTorch workflows using ONNX and supports:
Standard CNNs, MLPs, Transformers
Quantized models for field-friendly performance
Transparent, universal cryptography (no trusted setup)
How It Works
zkPyTorch compiles PyTorch/ONNX models through a three-stage pipeline:
1. Preprocessing
Converts the model into an ONNX graph
Augments it with auxiliary operations to ensure ZK verifiability
2. ZK-Friendly Quantization
Transforms floating-point operations into field-friendly integer arithmetic
Preserves accuracy while optimizing for performance
3. Hierarchical Circuit Optimization
Applies model-level, operation-level, and gate-level optimizations
Produces efficient, parallelizable circuits ready for proof generation
Proving and Verifying
The compiled circuit is then executed natively with Expander, the fastest ZKP engine, producing an output and proof that can be publicly verified.
Trustless proof your model works correctly
With zkPyTorch, developers can:
Reuse trained models directly from PyTorch
Generate and verify inference proofs for AI predictions
Publish verifiable AI outputs to blockchain, partners, or auditors
Keep the model and IP secure while proving correctness
Use it in:
Machine Learning as a Service (MLaaS)
Verifiable on-chain AI
Secure collaborative ML pipelines
Compliance-sensitive domains (finance, healthcare, defense)
Use Cases
Verifiable AI AgentsGive AI agents an unforgeable identity guaranteeing integrity of agent actions.
Auditable AI ServicesProve your AI model performed as promised—without exposing user data.
Web3 + On-Chain AIEnable verifiable off-chain inference with on-chain ZK verification.
Regulatory ComplianceShow compliance with fairness, transparency, or governance policies using cryptographic proofs.
IP-Protected InferenceDeliver provable results from your proprietary model—reinforcing the integrity of model outputs.
Architecture Diagram

Frequently Asked Questions
© 2025 Polyhedra Network.Press Kit