Introduction
While neural networks are typically trained on data, they can also be directly "synthesized" from Boolean networks—the logic gates that power digital circuits. This synthesis approach is highly attractive for safety-critical systems because it provides strict functional guarantees that traditional learning-based models lack.
However, current synthesis methods often produce "bloated" networks with an excessive number of neurons and connections, leading to slow simulation times and high memory usage. Optimizing these networks while ensuring they remain functionally equivalent (lossless optimization) is an NP-hard problem. Standard deep learning compression techniques, such as pruning, are typically "lossy" and slightly alter the network's behavior, defeating the purpose of using a precise Boolean specification. The core challenge is to significantly shrink these networks without losing a single bit of logic.
Methodology
The authors propose a multi-stage optimization framework to tackle this challenge:
- MMP Optimization: The researchers establish a mathematical link between Multilinear Polynomials (MPs) and neural network architecture. The number of neurons corresponds to the number of polynomial terms, and connections correspond to the degrees of those terms. They frame the search for the smallest network as finding a Minimal Multilinear Polynomial (MMP). While this is an NP-hard $\ell_0$ minimization problem, they successfully relax it to a convex $\ell_1$ problem using linear constraints.
- Objective-Aware Acceleration: To avoid repeatedly solving the same hard optimization problem, the framework uses Negation-Permutation-Negation (NPN) classification. This identifies sub-logic blocks that are essentially identical under simple transformations (e.g., flipping an input or swapping wires). The optimization is solved once for a "canonical" version and mapped back to all equivalent blocks.
- Architecture-Aware Selection: Two strategies are introduced:
optAllfor maximum compression, andoptMaintainDepth. The latter uses a "leeway" algorithm to identify neurons not on the critical path, allowing them to be compressed without increasing the network's overall latency (depth).
Datasets
The methods were evaluated on two types of Boolean specifications:
- Digital Circuits: Open-source hardware cores including
uart,sha3,ecg,aes,add,alu, and ariscvpipeline. - Deterministic Finite Automata (DFA): Symbolic models used for pattern matching, specifically
aaa(substring detection) andcmod5(a counter).
Key Insights
- Polynomial Sparsity Equals Network Efficiency: The complexity of a Heaviside-threshold neural network is directly tied to the sparsity of its underlying multilinear polynomial representation. Minimizing the polynomial automatically minimizes the hardware footprint.
- Symmetry as a Speedup: In large digital circuits, identical logic patterns appear thousands of times. By leveraging NPN classification, optimization becomes a "lookup" problem rather than a "compute" problem, bypassing the exponential costs of integer linear programming for most subproblems.
- Leeway for Latency: By calculating "leeway," the algorithm identifies exactly where it can afford to add slight complexity (like an extra threshold layer) to save on connections without slowing down total execution time.
Key Results
- Size Reduction: Compared to the current state-of-the-art, the proposed method reduced connections by up to 70% and neurons by up to 60%.
- Optimization Speed: The NPN-aware algorithm provided consistent speedups, reaching 34.3× faster than a naive approach and 5.9× faster than simple result caching.
- Depth Preservation: The
optMaintainDepthalgorithm successfully compressed networks (reducing connections by ~50%) while keeping simulation latency identical to the unoptimized version.
Limitations and Future Work
The primary limitation is the $\ell_1$ relaxation. While it makes the problem solvable, it acts as a heuristic that may occasionally yield a slightly larger network than the theoretical $\ell_0$ minimum. Additionally, NPN classification becomes computationally expensive as the number of inputs ($K$) to a logic block increases, though $K \le 10$ is generally sufficient for practical applications.
Future work could explore alternative approximation methods for the $\ell_0$ problem or investigate how these optimized Boolean-to-NN representations perform on specialized "AI at the edge" hardware, where connection density is a major physical constraint.
Summary updated