Certifying FPGA Logic Networks at the Gate Level

Neural networks can be compiled straight into FPGA lookup tables. An FPGA is a reconfigurable chip, and its basic building block is a lookup table (LUT): a tiny memory that implements an arbitrary Boolean function of a few input bits. BitLogic trains such networks by gradient descent, then collapses each relaxed node into a fixed truth table. It reports 18.63 ns latency and 72.3% CIFAR-10 accuracy with under 0.3 million gates, and its export pipeline makes the hardware bit-identical to the software model. The deployed object is therefore a finite Boolean circuit with no floating-point arithmetic in it. That matters for formal verification, meaning mathematical proof that a model satisfies a property on every allowed input. No Soundness in the Real World showed that proofs about idealized real-valued networks fail on real hardware. In its experiments, every tested verifier certified a backdoored network that collapsed to 0.11% accuracy once deployed. A LUT network has no rounding or summation order, so a proof about its truth tables is a proof about the chip.

This note proposes making that proof cheap. Robustness of a LUT network reduces to Boolean satisfiability (SAT): asking a solver whether any assignment of input bits flips the output. The proposal has two parts. The first is a verifier that propagates "unknown" bits through truth tables and hands only the remaining undetermined part of the circuit to SAT. The second is a training penalty, computed by the same propagation, that pushes most LUTs to have a fixed output inside the perturbation region, so that little of the circuit is left undetermined. The claim is that bit-exact certificates, valid for the synthesized FPGA netlist, become feasible at network sizes well beyond the roughly 52,000-parameter ceiling of current quantized-network verifiers. We have found no work that formally verifies LUT-native networks at all.

Core Claim

Exact verification of quantized arithmetic networks is PSPACE-hard (Verifying Quantized Graph Neural Networks is PSPACE-complete, Scalable Verification of Quantized Neural Networks). The hardness comes from fixed-point step activations encoded as bit-vector arithmetic. A trained LUT network has no arithmetic to encode. Its verification query is a SAT problem whose size equals the number of LUTs whose output can actually change inside the perturbation region.

We claim this "unstable cone" can be made small by training, the same way ReLU-stability helped continuous verifiers. Within that regime, two things should hold. Certified accuracy should be comparable to what quantized verifiers obtain on networks much smaller than ours, at comparable verification time. And because the certificate is checked against the post-synthesis netlist, it is immune to the implementation gap.

Research Program

Verifier. Inputs use a thermometer code, which turns each pixel into $k$ bits, where bit $i$ is 1 exactly when intensity exceeds threshold $i$. We assume a BitLogic-style binarized input and will adapt the code if BitLogic's encoding differs. Under this code, an $L_\infty$ ball of radius $\epsilon$ leaves uncertain only the bits whose thresholds lie within $\epsilon$ of the pixel value. Those bits also obey a monotone ordering constraint.

The first stage of the verifier is ternary propagation. Every bit is 0, 1, or X (unknown). A LUT with $m$ unknown inputs outputs a definite value if its truth table is constant over all $2^m$ completions of those inputs. LUTs have only about six inputs, so this check is exact per node and costs almost nothing. The result is sound but loose, because it ignores correlations between X bits.

The second stage handles the logic that stays X and feeds the output comparison. That cone of influence is encoded into conjunctive normal form, the clause format SAT solvers take, along with the exact thermometer constraints. An incremental SAT solver then asks whether some admissible input makes a wrong class's score bit-pattern win.

Relational properties use a miter, two copies of the circuit constrained to ordered inputs. One example is monotonicity of a learned index from NN4SysBench.

Hardware link. After Vivado synthesis and technology mapping, the netlist no longer matches the truth tables structurally. We close that gap with combinational equivalence checking of the mapped netlist against the exported truth tables. The certificate therefore covers the bitstream's logic, not just the Python model.

BoolE motivates this design. It shows that recovering high-level structure from optimized netlists turned a 32,402-second multiplier proof into 0.07 seconds. We differ from BoolE in that we never discard the structure we need. The LUT boundaries are known from training, so we verify at that level and use equivalence checking only to tie it to the mapped netlist. If equivalence checking proves slow on deep nets, BoolE-style rewriting is the fallback.

Training for verifiability. During training each LUT is a relaxed differentiable node, as in BitLogic. From a sampled perturbation set we propagate a relaxed ternary state. Let $u_j(x,\epsilon)\in[0,1]$ be the relaxed probability that node $j$'s output is undetermined given its inputs' X-probabilities. The objective is

$$L = \mathbb{E}_{(x,y)}\Big[\mathrm{CE}(f(x),y) + \lambda \sum_j u_j(x,\epsilon)\Big],$$

where CE is the cross-entropy of the network output $f(x)$ against label $y$, and $\lambda$ trades accuracy against stability.

This borrows the idea of DIFFAI, which differentiates an abstract worst-case loss through Box and Zonotope transformers. Our version differs in two ways. The abstract domain is discrete per-bit ternary logic rather than real-valued intervals. And the final certificate comes from exact SAT rather than from the relaxation, so looseness costs time, not soundness.

Baselines

The naive reference is the BitLogic network trained without the penalty and handed whole to a SAT solver, with no ternary pruning. This shows what "do nothing beyond bit-blasting" buys, and it is the configuration a skeptic expects to suffice.

The strongest existing competitor for bit-exact robustness is the SMT bit-vector verifier of Henzinger et al., which reasons in bit-vector logic over fixed-point arithmetic. It reports a 1,000x speedup over plain Boolector on 6-bit MNIST networks with over 52,000 parameters, solving 100% of instances at $\epsilon=1$ and 95% at $\epsilon=2$ (Boolector solves 63.6% and 0%). The second strong competitor is EQV, which reports 78x to 100x speedups over QVIP on MNIST networks up to FC2-512 and small CNNs. These are the right comparisons because they are the only cited methods that certify the quantized arithmetic an edge accelerator actually runs.

For fairness we train quantized MLPs and CNNs in their formats, matched to our LUT networks on clean MNIST and Fashion-MNIST accuracy. We give every method the same CPU budget, timeout, and $\epsilon$ in input-intensity units. We will rerun their released settings where available rather than quote numbers across hardware. Beating them means one of two outcomes: higher certified accuracy at equal clean accuracy and timeout, or equal certified accuracy on a network at least 10x larger than theirs.

For continuous verification, DIFFAI's reported 3.6% provable error bound on MNIST ConvSuper serves as a reference ceiling for what floating-point certification achieves. Those certificates are unsound on hardware per Szász et al.. For certified accuracy of LUT-native networks we found no reported result on Lacuna, so our naive baseline sets the first number.

The key ablations isolate the two ingredients. The first applies the penalty with plain SAT and no ternary pruning. The second applies ternary pruning with no penalty. The third replaces our penalty with ordinary PGD adversarial training of the relaxed LUT network, which tests whether robustness alone, rather than stability specifically, shrinks the cone.

Why not just…?

Why not just bit-blast the BitLogic netlist into an off-the-shelf SAT solver? This is the real threat. Modern SAT solvers are strong, and the networks are small in gates. For shallow MNIST LUT nets it may well work, and we will report that honestly. The evidence against relying on it at depth is indirect. Plain Boolector already collapses to 0% solved at $\epsilon=2$ on quantized nets (Henzinger et al.), and generic tools time out on structured circuits without structural help (BoolE). The naive-baseline curve of solve rate against network depth and $\epsilon$ settles the question. If plain SAT matches our method at CIFAR-scale depth, the contribution narrows to the hardware-soundness link and the training penalty becomes unnecessary.

Why not verify a quantized arithmetic network with EQV or bit-vector SMT and deploy that? These verifiers model software quantization semantics. They omit the pipelining, accumulator sizing, and arithmetic-ordering choices that synthesized RTL makes, as the EQV analysis itself leaves open. They also hit the PSPACE wall at tens of thousands of parameters. Our size-matched comparison tests directly whether the LUT representation moves that wall.

Why not train a floating-point network with DIFFAI and quantize it for the FPGA? The certificate would be about a different function from the one executed. Szász et al. show such certificates can be off by a factor of nearly a thousand in accuracy, 97% certified against near zero actual. We include this pipeline and measure, by exhaustive SAT on the deployed quantized model, how many of its certified points are actually violated.

Proposed Experiments

We train LUT networks on MNIST, Fashion-MNIST, and CIFAR-10 at three depths, sweeping $\lambda$. Each configuration is synthesized for the Zynq-7020 so latency and LUT count can be checked against BitLogic's reported figures. We then certify 1,000 test points per configuration at several $\epsilon$. We record certified accuracy, median and timeout-rate verification time, unstable-cone size, and equivalence-checking time for the mapped netlist.

For relational properties, we retrain the small LearnedIndex and CardEsti models from NN4SysBench as LUT networks. We verify their monotonicity specifications via miters, compare runtime on safe versus unsafe instances, and test whether the safe-instance slowdown NN4SysBench observed for αβ-CROWN and Marabou shrinks.

Three checks decide the proposal. First, unstable-cone size should predict SAT time across all configurations; if it does not, the mechanism is wrong. Second, the penalty should cut the cone by an order of magnitude at a clean-accuracy cost of no more than a few points. Third, at matched clean accuracy, our certified accuracy should exceed the Henzinger and EQV baselines' certified accuracy on networks at least ten times larger, within the same timeout. A negative result on the third check, with plain SAT already sufficing, would still establish the first bit-exact robustness certificates for synthesized FPGA neural logic.