Quantize to Prove, Quantize to Transfer

A model trained on simulated data often fails on real sensor data. Separately, the systems that let a model owner prove a prediction was computed honestly, called zero-knowledge proofs (cryptographic certificates that a computation ran correctly without revealing the model's weights), are slow. Proving a single MobileNet v2 inference takes 2 to 40 minutes (Scaling up Trustless DNN Inference with Zero-Knowledge Proofs). The main lever for cutting that cost is to represent activations with fewer bits. In the proof systems these papers use, each nonlinearity is checked against a precomputed lookup table, and the table grows exponentially with bit-width. This note asks whether that same lever also closes the sim-to-real gap. The hypothesis is that coarse quantization of a network's early layers erases low-amplitude simulator artifacts, such as clean borders, deterministic noise patterns and idealized LiDAR returns, which models otherwise exploit as shortcuts. If so, one training procedure could produce a network that is both cheaper to prove and better on real data.

The idea in two sentences is this. Proof cost and sim-to-real brittleness both depend on how finely a network represents its early activations. We search for per-layer bit-widths that jointly minimize proving cost and target-domain error, and test whether the resulting "quantization bonus" is a real transfer effect or just disguised noise augmentation. The motivating hint comes from Privacy-Preserving UCB Decision Process Verification via zk-SNARKs. That paper proved bandit decisions inside a zero-knowledge circuit and found that medium quantization ($2^8$ scaling) slightly outperformed unquantized decision-making in total reward. The result comes from a three-armed toy bandit with no distribution shift, so it is a hint, not evidence.

Core Claim

Nobody has measured how the quantization required to make proofs tractable interacts with synthetic-to-real shift. The research file finds no work connecting the two directions. The closest proof system, Kang et al., compiles int8 TensorFlow Lite graphs into Halo2 circuits but evaluates only on in-distribution ImageNet.

We claim three things. First, the effect of bit-width on target accuracy is non-monotone and layer-dependent. Second, there is a regime of low early-layer precision where real-domain accuracy rises or holds while proving cost falls substantially. Third, this regime can be found from synthetic data plus unlabeled real data, without real labels.

A clarification sharpens the scope. The adaptation machinery in the sim-to-real literature only shapes training: the GAN translator in PixelDA (Unsupervised Pixel-Level Domain Adaptation with Generative Adversarial Networks) and the Gumbel-Softmax masking in ASM (Adversarially Masking Synthetic to Mimic Real). Only the deployed task network needs to be proved. We therefore do not try to prove GANs. Our object is the deployed network, and we ask how its numeric format affects both cost and transfer.

Research Program

The cost side starts from the structure of Plonkish arithmetization, the table-of-constraints format Halo2 uses. The rough cost model is:

$$ C(\mathbf{b}) \approx n(\mathbf{b}) \log n(\mathbf{b}), \qquad n(\mathbf{b}) = \max\Big(\textstyle\sum_\ell g_\ell(b_\ell),\; \max_\ell 2^{b_\ell}\Big) $$

The symbols are defined as follows:

  • $C$ is prover time.
  • $\mathbf{b} = (b_1, \dots, b_L)$ are the activation bit-widths of the $L$ layers.
  • $g_\ell(b_\ell)$ is the number of circuit rows layer $\ell$ needs, including range checks.
  • $2^{b_\ell}$ is the size of that layer's lookup table.
  • The $n \log n$ form reflects the polynomial transforms and multi-scalar multiplications that dominate proving.

We will not trust this model blindly. We will calibrate it against measured Halo2 proving times from the open compiler of Kang et al., and cross-check with zkPyTorch.

The transfer side trains quantization-aware networks on synthetic data. We vary the per-layer bit-width $b_\ell \in \{2, 3, 4, 6, 8\}$ and leave the layers past the first few at int8. We first map the landscape with grid sweeps over early-layer bit-widths. We then run a learned selection that minimizes

$$ \mathcal{L}_{\text{src}} + \lambda\, \hat{D}(\text{src}, \text{tgt}) + \mu\, \log C(\mathbf{b}) $$

where:

  • $\mathcal{L}_{\text{src}}$ is the synthetic-domain task loss.
  • $\hat{D}$ is a domain discrepancy measured on unlabeled real features (a domain-classifier accuracy).
  • $\lambda$ and $\mu$ trade off transfer against proof cost.

Real labels are used only for final evaluation.

To understand why any bonus appears, we will measure how much simulator-identifying information survives each quantized layer. Concretely, we train a probe to tell synthetic from real activations at each layer and bit-width. If the shortcut-erasure hypothesis holds, probe accuracy should collapse at the same bit-widths where real-domain accuracy improves.

Baselines

Naive reference. The do-nothing point is a full-precision model trained only on synthetic data. ASM reports this "source only" setting at 15.2% mIoU on SynLiDAR→SemanticKITTI and 11.5% on SynLiDAR→nuScenes (Li et al.).

Pipeline used in ZK work today. This is the same model with uniform int8 quantization, as in Kang et al.. Its cost and accuracy define the "ZK-ready" reference.

Strongest existing competitor. This is the best published adaptation method, followed by int8 quantization so it can be proved. On LiDAR it is ASM, which reports 22.8% mIoU on SemanticKITTI and 17.0% on nuScenes, against a 55.5% oracle trained on labeled real data (Li et al.). On images it is PixelDA, which reports 98.2% on MNIST→MNIST-M and a 23.5° mean angle error on synthetic→real LineMod (Bousmalis et al.).

No reported result was found on Lacuna for any of these methods after int8 or lower quantization, or for proving cost on any sim-to-real benchmark. We will therefore re-run them ourselves under the protocol below.

Fairness protocol. Every method uses:

  • the same backbone;
  • the same synthetic and unlabeled real data;
  • the same training epochs;
  • the same hyperparameter search budget, about 20 trials each.

We also apply our bit-width search on top of ASM and PixelDA. This tests whether the effect is complementary or redundant.

What counts as beating the competitor. We beat the strongest competitor if, at matched or better target accuracy (within one standard deviation over three seeds), our model's measured proving time is at least 2× lower. Alternatively, we beat it if, at matched proving cost, it reaches higher target accuracy than int8 ASM or int8 PixelDA.

Key ablations. Two ablations isolate the key ingredient:

  • Uniform low-bit quantization of all layers versus early layers only. This tests whether where we quantize matters.
  • A float network trained with additive noise matched in magnitude to each layer's quantization error. This tests whether quantization helps beyond plain noise.

Why not just…?

Why not just adapt in float and quantize to int8 afterwards? This is the default pipeline, and it may be enough. Nothing in the file shows that post-hoc int8 harms transfer. The "int8 ASM / int8 PixelDA" baseline answers the question directly. If post-hoc int8 already loses nothing, and lower bit-widths add no transfer benefit, our contribution shrinks to a cost study. That cost study is still useful: it shows how far bit-width can drop before transfer breaks.

Why not just inject noise during training instead of quantizing? This is the most serious threat. Quantization can be modeled as noise, and ASM succeeds precisely by injecting learned dropout noise into shallow layers. The matched-noise ablation settles it. If float noise reproduces the transfer gain, we will report that the bonus is noise regularization. The genuinely new finding would then be that the cost-reducing format delivers this regularization for free. That is a weaker but honest claim. It is distinct only because noise injection does nothing to shrink lookup tables, whereas quantization does.

Why not just skip zero-knowledge and use a trusted hardware enclave or optimistic auditing? Kang et al. already propose an escrow scheme in which challenged predictions must be proved later, which means proofs are only needed occasionally (Kang et al.). We accept that framing rather than fight it. Even under occasional auditing, each audit costs 2 to 40 minutes of proving. Our result lowers the cost per audit and thus raises the feasible audit rate. Enclaves rest on different trust assumptions, and comparing them is outside this proposal.

Proposed Experiments

We use three benchmarks from the file, chosen so that proving is feasible on at least two of them.

MNIST→MNIST-M. Small convolutional networks are fully proved in Halo2. We report target accuracy, measured prover time, peak memory, proof size and verification time.

Synthetic→real LineMod. This applies the same pipeline to pose regression, with mean angle error as the metric.

SynLiDAR→SemanticKITTI and SynLiDAR→nuScenes. We use SqueezeSegV2, a range-image network built from 2D convolutions that compiles into circuits. ASM lists it at 20.0% mIoU. We report mIoU for every configuration. We fully prove a reduced-resolution range image and extrapolate full-scan cost through the calibrated cost model, stating the extrapolation explicitly.

Decisive checks. Three outcomes decide the proposal:

  • The main plot is target accuracy against measured prover time across bit-width configurations. The proposal succeeds if early-layer low-bit configurations lie on a better tradeoff curve than the int8 baselines. It fails if the curve is monotone, meaning fewer bits always means worse real performance.
  • The synthetic-versus-real probe test must show simulator-identifying information dropping at the bit-widths where real accuracy rises. If it does not, the shortcut-erasure explanation is wrong, even if a gain appears.
  • The matched-noise ablation determines whether the gain is specific to quantization or generic regularization.

Together these three outcomes tell us whether reducing proof cost and closing the sim-to-real gap are one design problem or two.