Abstract
We consider efficiency in the implementation of deep neural networks. Hardware accelerators are gaining interest as machine learning becomes one of the drivers of high-performance computing. In these accelerators, the directed graph describing a neural network can be implemented as a directed graph describing a Boolean circuit. We make this observation precise, leading naturally to an understanding of practical neural networks as discrete functions, and show that so-called binarised neural networks are functionally complete. In general, our results suggest that it is valuable to consider Boolean circuits as neural networks, leading to the question of which circuit topologies are promising. We argue that continuity is central to generalisation in learning, explore the interaction between data coding, network topology, and node functionality for continuity, and pose some open questions for future research. As a first step to bridging the gap between continuous and Boolean views of neural network accelerators, we present some recent results from our work on LUTNet, a novel Field-Programmable Gate Array inference approach. Finally, we conclude with additional possible fruitful avenues for research bridging the continuous and discrete views of neural networks.
Introduction
Deep neural networks (DNNs) are traditionally formulated as continuous functions operating on real numbers. However, the physical hardware used for inference—GPUs, FPGAs, and ASICs—is inherently discrete, composed of Boolean logic gates (AND, OR, XOR) operating on bits. Current optimization techniques like quantization attempt to bridge this gap by squashing continuous values into lower-precision integers. This paper argues that such an approach is fundamentally inefficient because it forces hardware to emulate a continuous model rather than leveraging its native Boolean capabilities. By treating neural networks as learnable Boolean circuits, we can align the "syntactic" description of the network with the "semantic" hardware implementation.
A Unified Formalism
To reconcile the continuous and discrete views, we introduce a "typed graph" formalism. This framework allows us to distinguish between the syntax (the graph structure) and the semantics (the mathematical function computed). As shown in the commutative diagram below, we can map the continuous operations in $\mathbb{R}^n$ to discrete operations in Boolean space $\mathbb{B}^{kn}$ through a series of embeddings and isomorphisms.
This mapping is crucial for understanding how properties like Lipschitz continuity—which governs generalization in the continuous domain—translate to the discrete domain. For instance, a "smooth" Boolean circuit is one where small bit-flips in the input lead to minimal changes in the output, a property essential for robust learning. The paper demonstrates that standard hardware components, like ripple-carry adders, are 1-Lipschitz, aligning hardware design principles with AI generalization principles.
Functional Completeness and the Topology Trap
A key theoretical contribution is the proof that Binarized Neural Networks (BNNs) are functionally complete. This implies that any Boolean function can be represented by a BNN, provided the topology is appropriate. However, the paper identifies a "topology trap": using the same network structures for both high-precision and low-precision models is often suboptimal. The optimal circuit shape is intrinsically linked to the data type and encoding used; bits are not inherently "weak," but they require architectures designed for their discrete nature.
LUTNet: Learning the Arithmetic
As a practical application of these ideas, we propose LUTNet. In traditional FPGA implementations, lookup tables (LUTs) are used to implement fixed logic gates (e.g., XNOR). LUTNet instead treats each $K$-input LUT as a flexible, learnable node. During training, the network learns the optimal Boolean function for each LUT, effectively "learning the arithmetic" that best suits the task and the hardware rather than forcing a predefined mathematical operation.
Experimental Results
The LUTNet approach was evaluated on the CIFAR-10 image classification benchmark. By utilizing the native flexibility of FPGA LUTs, LUTNet achieved a 50% reduction in hardware area (logic gates used) compared to standard BNN baselines (such as the CNV model) while maintaining identical classification accuracy. Furthermore, the framework allows for a fine-grained area-accuracy tradeoff by adjusting the number of inputs ($K$) to the LUTs, giving engineers precise control over hardware resource allocation.
Conclusion
The divide between continuous mathematical models and discrete hardware implementations represents a significant source of inefficiency in modern AI. By embracing Boolean logic as the native language of neural networks and co-designing topology, encoding, and functionality, we can achieve substantial performance gains. Future research should focus on this "trinity" of factors to unlock the full potential of hardware-native machine learning.
Summary updated