A sound simplification method for redundant checks in zero-knowledge machine learning circuitsSound Debloating of Redundant Checks in Zero-Knowledge Machine-Learning Circuits
The authors propose a sound deletion tool for redundant checks in ZK ML circuits, which deletes 25.5% of constraints on average and reduces proving time by 33.4% on average on ezkl/zkml circuits.
The victim system is the verifier of the ZK ML proof system. The attacker is a malicious prover: if constraints are unsafely deleted from the circuit (unsound debloating), the attacker can submit a forged witness, causing the verifier to accept an inference result that the model never actually computed. The defense requires that the circuit after deletion, C\R, accept exactly the same witness set as the original circuit C.
- ZK ML frameworks compile neural network inference into constraint systems, in which many check constraints such as range checks, sign lookups, and bit decompositions become mutually implied and redundant after composition; deleting them can accelerate proving, but improper deletion lets a malicious prover forge witnesses.
- The authors propose a three-stage process: abstract interpretation over the whole circuit derives facts about each variable, a provenance graph records which constraints prove each fact, and then an AND/OR proof search with cycle detection verifies one by one that after each candidate constraint is deleted its fact can still be derived, deleting only the constraints that pass verification.
- On the two pipelines ezkl and zkml, across 13 model-pipeline pairs (largest 25.3M constraints), the tool deletes 25.5% of constraints on average (highest 48.7%, zkml/PTB-LSTM) and reduces proving time by 33.4% on average (highest 72.8%, ezkl/BERT-tiny); existing optimization tools delete at most 0.4% on the same circuits.
- The authors state that the analysis is sound but incomplete and may miss redundant deletions; the evidence covers only ML circuits; end-to-end evaluation of larger models (such as GPT-2 scale) was not done due to prover memory limits. Empirical verification is sampled cross-checking, not exhaustive.
- Evaluated models
- MNIST-MLPLeNet-5MobileNet-v2PTB-RNNPTB-GRUPTB-LSTMBERT-tiny
- Benchmarks
- ezkl 编译的 7 个模型电路zkml 编译的 6 个模型电路基于 circomlib-ml 模板补全检查构建的 5 个 R1CS 电路(MLP、LeNet、RNN、GRU、LSTM)
- Metrics
- 约束删除率 Red%证明时间变化 ΔP验证时间变化 ΔV证明大小变化 Δ|π|分析时间
The researchers propose an automated framework that removes redundant checks in zero-knowledge machine learning circuits under the premise of provably preserving soundness, deleting up to 48.7% of constraints and reducing prover time by 72.8%. For each candidate deletion, the framework first uses whole-circuit abstract interpretation to determine whether the rest of the circuit can on its own rule out the values excluded by the deleted check, and records the substitute argument in a provenance graph; deletion is performed only when an alternative path from which relevant facts can be derived still exists in the graph, ensuring that no new forgery strategy is left to attackers. The evaluation covers MLP, CNN, RNN and transformer architecture circuits generated by two production-level frameworks, ezkl and zkml, with up to 25.3 million constraints; the paper notes that under-constrained circuits in deployed ZK systems have allowed attackers to forge transactions and completely bypass verification.
Paper analysis
What problem does this paper attempt to solve?
How to automatically delete redundant check constraints in ZK ML circuits to accelerate proving while guaranteeing that no soundness hole allowing forged witnesses is introduced.
Core problem: in ZK ML circuits, many check constraints are redundant because they are mutually implied after composition; can they be automatically identified and safely deleted (debloated) to reduce proving cost without weakening security?
- Setting and importance: ZK ML frameworks (ezkl, zkml) compile neural network inference into constraint systems, and proving cost grows with the number of constraints; the authors cite existing benchmarks stating that proving overhead can exceed ordinary inference by more than 10,000×. Frameworks emit checks such as range checks, sign lookups, and bit decompositions self-containedly for each gadget, and after composition an upstream check often already implies a downstream check; the authors state that such redundancy accounts for up to 48.7% of constraints in their evaluation (§6).
- Shortcomings of existing methods: the authors state that existing optimization tools (compiler optimizations, Distilling, CirC, Clap, Halo2 analyzer) decide deletions only from the syntactic or algebraic form of constraints and do not ask what the remaining constraints imply; on their benchmarks they delete at most 0.4% (§6.4).
- Core observations: redundancy is global (implications can flow in both directions across layers), non-compositional (deleting two individually redundant constraints together may be unsound, which the authors call the premise-asymmetry problem), and exact determination is co-NP-hard (§3.3).
- What the paper proposes: an automated framework that uses whole-circuit abstract interpretation plus a provenance graph for proof search, deleting a check constraint only when the facts it enforces can still be derived from the remaining constraints; the authors state that this is the first sound and scalable method for this class of semantic redundancy.
- Threat model (Figure 1):
- Attacker goal: make the verifier accept a forged proof π claiming that model M produced an output on input x that it never computed.
- Attacker capability: provide a forged witness as a malicious prover; the verifier can only see π.
- Victim system: the verifier of the ZK proof system.
- Defense requirement: the circuit after deletion, C\R, accepts exactly the same witness set as C (safe debloating, Def. 4).
What related research exists?
Related work falls into four groups: ZK circuit constraint optimization, ZK ML and its acceleration, DNN verification, and ZK circuit program analysis and software debloating.
ZK circuit constraint optimization (§2.3; the paper compares capabilities in Table 1)
- Mainstream compiler optimizations (Circom O2, ZoKrates, Noir, Leo): constant folding, common subexpression elimination, Gaussian elimination of linear constraints; the paper notes that they do not handle nonlinear constraints and do not reason about variable values.
- Distilling Constraints (Albert et al., 2022) and CirC (Ozdemir et al., 2022): the former derives linear consequences from nonlinear R1CS triples, the latter performs IR-level optimization; the paper notes that both are purely algebraic/syntactic and are not aware of implication redundancy.
- Clap (Stronati et al., 2024) and Halo2 analyzer (Soureshjani et al., 2023): the former performs PLONKish structural rewriting, the latter uses abstract interpretation to mark unused gates and columns; the paper notes that they only detect syntactic duplication or structural dead code and do not ask whether an active and unique check is implied.
ZK ML and proof acceleration (§8)
- Circuit design for specific model families: zkCNN, vCNN, pvCNN (CNN), zkLLM (language models), etc.
- Protocol and hardware routes for reducing proving cost: folding schemes, lookup arguments, GKR protocols, GPU acceleration; the paper positions itself as an orthogonal post-processing pass that deletes constraints already redundant after composition.
DNN verification (§8)
- AI2, Reluplex, Marabou, ERAN, α,β-CROWN, DeepSRGR, etc. use abstract interpretation and bound propagation to prove input-output properties of networks. The paper notes that the common point is that they all use abstract domains, but the object of this paper is the compiled ZK constraint system, and the problem is implication among constraints rather than network properties.
ZK circuit program analysis and software debloating (§8)
- QED2, Coda, AC4, Ecne: detect underconstrained circuits (witness set too large); the paper states that these are complementary to this work—those tools ask whether the witness set is too large, whereas this paper asks whether an individual constraint contributes to shrinking the witness set.
- Software debloating work such as Trimmer, RAZOR, Chisel, SanRazor, LClean; the paper notes that they operate on control-flow IR, whereas this paper's setting has no control flow and requires exact preservation of the witness set.
Baselines and benchmarks: RQ3 compares Circom O2, Distilling, CirC, Clap, korrekt (Halo2 analyzer), and an exact SMT method (cvc5 solving QF_NIA), on 5 R1CS circuits (MLP, LeNet, RNN, GRU, LSTM, built from circomlib-ml templates with completed checks) (§6.1).
Authors' positioning: this paper targets the "semantic optimization/logical implication" dimension that existing tools do not cover at all (in Table 1, these two rows are × for all prior tools).
How does the paper address this problem?
Three-stage pipeline: abstract interpretation derives variable facts, a provenance graph records the derivation source of facts, and a proof search with cycle detection verifies deletion safety one by one.
Overall approach: for each candidate check constraint c, verify that the facts c enforces can still be derived from the remaining constraints after c is masked out; if so, delete it. The framework has three stages: abstract interpretation → provenance graph → provenance-guided debloating (§4).
Problem formalization (§3.1)
- A constraint system C is a conjunction of constraints over a finite field; a witness w satisfies C is written w |= C.
- Redundancy definition: c ∈ C is redundant if and only if C \ {c} ⊢ c (the remaining constraints imply c).
- Safe deletion: R ⊆ C is a safe debloating if and only if C \ R ⊢ R, i.e., the witness set is exactly the same before and after deletion. Maximum safe deletion is an exact problem at the ΣP2 level, so the authors instead use a polynomial-time sound-by-construction over-approximation.
Stage one: abstract interpretation over constraints (§4.1)
- Each variable is tracked by the reduced product of three lattice domains: constants, intervals [ℓ, u], and known bit patterns (bitmask + value pattern), which refine each other.
- Each constraint type defines a transfer function (arithmetic gates, lookup tables, bit decomposition), and propagation is directionless: x + y = z can use any two variables to tighten the third.
- WrapGuard rule: a derived fact is retained only when the integer interpretation and modular arithmetic agree within the sign window W = [−(p−1)/2, (p−1)/2]; otherwise it is widened to ⊤, ensuring the fact holds for all witnesses (including wrap-around).
- Worklist fixpoint computation, with time complexity O(n·d·h) (n = number of constraints, d = maximum constraint arity, h = height of the interval lattice).
Stage two: Provenance graph (§4.2)
- The fixpoint records only "which facts hold" and discards derivation history; to handle premise-asymmetry (two constraints each serving as the premise for the other's redundancy proof), a bipartite AND/OR graph is built: fact nodes (OR side, one atomic fact per variable per domain) and constraint nodes (AND side, recording that constraint c derives fact f from premise set P).
- Construction method (Alg. 1): for each (c, v), reset v to ⊤ and replay c's transfer function, exposing c's contribution to v; MinPremises (Alg. 2) uses the drop-to-top rule to trim the premise set to the facts actually consulted. Nodes with P = ∅ are axiom nodes and do not participate in dependency cycles.
- Complexity O(n·d³); the graph contains O(|V|) fact nodes and O(n·d) constraint nodes (Theorem 4.1).
Stage three: Provenance-guided deletion (§4.3)
- Implication filter: when the fixpoint already implies the property enforced by c (e.g., the interval of a range lookup is already covered by the variable's interval), c becomes a candidate; the filter is sound but incomplete, and constraints whose shape does not match are always retained.
- Proof search (Alg. 3): AND/OR depth-first search under a mask (set of masked nodes); the visiting set returns false when backtracking to a node on the stack, rejecting cyclic derivations and thereby excluding premise-asymmetry cycles.
- Deletion loop (Alg. 4): process candidates one by one in greedy order, temporarily mask c's nodes and check whether every fact in its obligation set Obl(c) is still provable; if so, delete and keep it masked, otherwise restore. The order is ascending by uniqueness score (§5), which affects only the size of the deletion set, not soundness.
- Soundness: Theorem 4.2 (provability is sound) plus Theorem 4.3 (a provenance-grounded R is a safe debloating); the authors also mechanize soundness proofs for the covered constraint types in Rocq (§5).
Implementation (§5)
- Rust implementation of about 30k lines; R1CS is parsed from Circom source via ANTLR4, and PLONKish is exported as JSON by observing one synthesis pass of the halo2 mock prover.
- At load time, model weights (advice columns) are assumed unknown to the tool, and no weight-specific optimization is performed.
- After deletion, dead code elimination (unreachable auxiliary structures) and column pruning are performed.
What experiments did the paper conduct?
Three RQs: effectiveness (13 model-pipeline pairs), scalability (1×–32×), and comparison with 5 existing tools and exact SMT, plus empirical soundness validation.
Experimental setup
- Circuits tested: 7 architectures—MNIST-MLP, LeNet-5, MobileNet-v2, PTB-RNN, PTB-GRU, PTB-LSTM, BERT-tiny—compiled through the two PLONKish pipelines ezkl and zkml respectively; MobileNet-v2 only via ezkl (zkml does not support depthwise-separable convolutions), for a total of 13 model-pipeline pairs (§6.1).
- Circuit scale: about 6K to 25.3M constraints; when zkml memory exceeded 768 GiB, the largest scale that could be completed was used (hidden=50 for PTB-*, d_model=32 for BERT-tiny).
- Proving system: Axiom's halo2 implementation, recording CPU time for proving and verification; hardware was AMD EPYC 9754, 768 GiB RAM.
- Comparison baselines (RQ3): Circom v2.2.3 O2, Distilling, CirC (R1CS side); Clap, korrekt (PLONKish side, run on zkml compilation output); the exact method used cvc5 to solve a QF_NIA encoding, with a 24-hour budget per circuit. The R1CS corpus was self-built from circomlib-ml templates completed and checked according to zkml constraint patterns (the authors state that circomlib-ml itself is under-constrained), containing five circuits: MLP, LeNet, RNN, GRU, LSTM.
- Metrics: constraint deletion rate Red%, relative change in proving/verification time ΔP/ΔV, change in proof size Δ|π|, analysis time.
- Number of repetitions: the paper does not report the number of repetitions for each measurement.
Main results
RQ1 (Table 2, selected key rows; ΔP is the relative change in proving time):
Swipe horizontally to read the table
Model Pipeline Constraints Red% ΔP MNIST-MLP zkml 6.30K 22.30% −16.80% LeNet-5 zkml 338.10K 31.70% −41.20% PTB-RNN zkml 28.10K 43.10% −36.70% PTB-LSTM zkml 76.10K 48.70% −43.70% BERT-tiny ezkl 10.20M 24.90% −72.80% PTB-RNN ezkl 3.80M 12.90% −62.90% MobileNet-v2 ezkl 25.30M 22.80% −4.10% MNIST-MLP ezkl 416.50K 3.20% −20.70% (Full 13 rows in Table 2; omitted here are the ezkl rows for PTB-GRU and PTB-LSTM and the zkml rows for LeNet-5 and BERT-tiny, etc.)
- The authors state that the deletion rate is 3.20%–24.90% on ezkl (median 12.90%) and 22.30%–48.70% on zkml (median 40.25%), and explain that zkml inlines checks per call site, so there is more constraint-level redundancy.
- Proving time reductions: 16.80–43.70% on zkml, 1.10–72.80% on ezkl; the authors explain that the PLONKish prover pays per column and per lookup type, and on ezkl BERT-tiny and PTB-RNN cut 38% and 62% of advice columns respectively, hence the largest speedups.
- Verification time changes from +3.40% to −59.10%, and proof size reductions are 1–74% on ezkl and 3–46% on zkml (Table 2).
RQ2: Scalability (§6.3, Figure 3)
- What was measured: each architecture was scaled 1×–32× along the main dimension, recording analysis time and deletion rate.
- Results: fitting T ∝ n^α gives α ∈ [0.90, 1.70] (ezkl), [1.30, 2.50] (zkml); the smallest circuit (zkml/FC-MLP, 476 constraints) took 0.10 s, the largest (ezkl/MobileNet, 38.40M constraints) 2.90 h. On zkml, the deletion rate for RNN/GRU/LSTM varies by less than 0.30 percentage points across scales; on ezkl, FC-MLP and the recurrent family drop by 8–10 percentage points at high multipliers.
- Authors' interpretation: analysis time grows efficiently with the number of constraints, and the deletion rate is basically stable across scales on both pipelines; the one-time offline analysis can be amortized.
RQ3: Comparison with existing tools and exact SMT (§6.4, Table 3)
- What was measured: the constraint deletion rate of each tool on 5 R1CS circuits.
- Results: Circom O2 and Distilling delete only 0.2% on RNN and 0 on the rest; CirC at most 0.4%; Clap and korrekt are 0 across the board; this paper's tool deletes 15.9% (RNN) to 51.6% (LSTM). The exact SMT method terminated within 24 hours only on a reduced MLP instance with 116 constraints (11.4 hours), and its deletion set exactly matched this paper's tool's result in 0.06 s.
- Authors' interpretation: syntactic tools delete at most 0.40%, exact implication is the correct specification but does not scale; this paper's tool is the only method that achieves a substantial deletion rate within budget.
Empirical soundness verification (Appendix G, Table 4)
- What was measured: an independent cross-check—for each deleted lookup, sample and tamper its input cells with out-of-bounds or wrap-around adversarial values, and check whether the circuit after deletion likewise rejects that witness.
- Results: 3.62×10^11 iterations were executed across the 13 model-pipeline pairs, with 0 divergences; each deleted lookup was tested at least once.
- Authors' note: this is sampled cross-checking rather than a soundness proof, with single-cell perturbations and non-exhaustive; soundness is supported by the proof in §4 and the Rocq mechanized argument.
Other ablations and analyses
- No-Graph ablation (Table 3): disabling the provenance graph and rerunning the fixed point for each candidate completed within 4 hours only on LSTM (51.6%, the same as the full tool); the other four circuits timed out; the full tool took 4 s (LSTM) to 11 min (LeNet) on the 5 circuits.
- Case studies (Appendix F): zkml/MNIST-MLP deleted 788 of 791 constraints as lookups; ezkl/BERT-tiny deleted 715,517 constraints (404,924 gates, 310,593 lookups), with all 309,696 dot-product gates retained; zkml/PTB-LSTM deleted 15,240/31,280 constraints.
- Negative/exceptions: ezkl/MobileNet-v2 proving time dropped only 4.10%, and PTB-GRU only 1.10% (Table 2); the authors explain this as less column pruning and lookup elimination. Verification time increased on some benchmarks (up to +3.40%).
What are some points that can be further explored?
The authors state that the analysis is incomplete, the evidence is limited to ML circuits, and end-to-end evaluation of large models is limited by prover memory; porting to new domains is left for future work.
Limitations and future directions noted by the authors
- Incompleteness (§7 Discussion): exact maximum deletion is infeasible at the target scale; the analysis uses intervals, known bits, and constant domains plus templated implication rules and greedy deletion, which is a sound but incomplete polynomial approximation and may miss redundant checks (missed deletions only affect optimization effectiveness, not soundness).
- Scope (§7): the tool targets only cross-constraint implication among check constraints; algebraic simplifications such as constant folding are out of scope and must be combined with the tools of §2.3.
- Generality to non-ML domains (§7): the method is in principle general (it only consumes R1CS/PLONKish), but redundancy density is specific to ML; the authors state that signature verification and bignum circuits are natural targets but deletion rates may be lower, and configuring abstract domains and transfer functions for new domains is left as future work.
- Scalability to complex ML models (§7): the authors expect the method to scale to transformers and LLMs (the BERT-tiny results are consistent with this), but larger-scale end-to-end evaluation is currently blocked by prover memory (GPT-2 requires about 1 TB RAM), which the authors state is a bottleneck for ZK ML as a whole rather than for their analysis.
- Limitations of empirical validation (Appendix G.1): validation is sampled cross-checking rather than proof; each iteration perturbs only a single cell, and witnesses involving coordination across multiple cells are out of scope; coverage is at least once per deleted lookup, not exhaustive across rows or attack patterns.
Experimental coverage
- The circuits under test are 13 model-pipeline pairs from 7 architectures compiled through the two pipelines ezkl and zkml, with constraint counts of about 6K–25.3M (§6.1); MobileNet-v2 is covered only by ezkl.
- The RQ3 comparison covers 5 existing tools plus exact SMT, on 5 self-built R1CS circuits (MLP, LeNet, RNN, GRU, LSTM); MobileNet and BERT were not included in RQ3 because circomlib-ml cannot encode them (§6.1).
- Proof measurements use the Axiom halo2 implementation, CPU time, on a single machine with 768 GiB RAM; zkml's PTB-* and BERT-tiny used reduced configurations due to memory limits (§6.1).
- Empirical soundness validation covers all deleted lookups of all 13 pairs (at least once), totaling 3.62×10^11 iterations (Table 4).
- The paper does not report the number of repetitions for proof/verification time measurements, nor statistics from multiple runs of analysis time.
Summarize the main content of the paper
A sound redundant-check deletion tool for ZK ML circuits: deletes 25.5% of constraints on average, reduces proving time by 33.4% on average, and has a mechanized soundness proof.
A systems paper on ZK machine learning circuit optimization (ACM CCS 2026 author version).
- Problem: After ZK ML frameworks compile inference into constraint systems, checks such as range checks, sign lookups, and bit decompositions that each gadget emits self-containedly become mutually implied after composition, forming semantic redundancy; deleting them can reduce proving cost, but unsafe deletion lets a malicious prover forge witnesses (threat model in Figure 1).
- Method: A three-stage pipeline—whole-circuit abstract interpretation (three domains: intervals/known bits/constants, with wrap-around protection) derives variable facts; a provenance graph records the derivation source of each fact to handle premise-asymmetry cycles; an AND/OR proof search with cycle detection verifies candidate deletions one by one, and any that fail verification are retained. The Rust implementation is about 30k lines, supports R1CS and PLONKish, and mechanizes soundness proofs for the covered constraint types in Rocq.
- Main results:
- On 13 model-pipeline pairs (largest 25.3M constraints), an average of 25.5% of constraints are deleted, with a maximum of 48.7% (zkml/PTB-LSTM, Table 2).
- Proving time drops by an average of 33.4%, with a maximum of 72.8% (ezkl/BERT-tiny, Table 2).
- Existing tools (Circom O2, Distilling, CirC, Clap, korrekt) delete at most 0.4% on the same circuits (Table 3).
- Exact SMT terminates only on a 116-constraint instance, in 11.4 hours, and its deletion set matches the result of this paper's tool in 0.06 s (§6.4).
- 3.62×10^11 adversarial empirical validation iterations with zero divergence (Table 4).
- Authors' conclusion: Semantic-level redundancy is a class entirely uncovered by existing optimizers, and provenance-guided approximate analysis can achieve substantial deletion rates while keeping the witness set unchanged; the authors also state that the analysis is incomplete, the evidence is limited to ML circuits, and end-to-end evaluation of larger models is limited by prover memory.