[Paper Review] Deep Differentiable Logic Gate Networks
This paper proposes differentiable logic gate networks, a novel architecture that enables gradient-based training of sparse, binary logic gate networks by continuously relaxing logic operations via real-valued logics and softmax parameterization. The resulting models achieve inference speeds exceeding one million MNIST images per second on a single CPU core, outperforming state-of-the-art neural networks by 2–3 orders of magnitude in speed while maintaining high accuracy.
Recently, research has increasingly focused on developing efficient neural network architectures. In this work, we explore logic gate networks for machine learning tasks by learning combinations of logic gates. These networks comprise logic gates such as "AND" and "XOR", which allow for very fast execution. The difficulty in learning logic gate networks is that they are conventionally non-differentiable and therefore do not allow training with gradient descent. Thus, to allow for effective training, we propose differentiable logic gate networks, an architecture that combines real-valued logics and a continuously parameterized relaxation of the network. The resulting discretized logic gate networks achieve fast inference speeds, e.g., beyond a million images of MNIST per second on a single CPU core.
Motivation & Objective
- To enable gradient-based training of logic gate networks, which are traditionally non-differentiable and thus incompatible with standard backpropagation.
- To develop a method that combines real-valued logic and continuous relaxation to allow effective optimization of logic gate choices per neuron.
- To achieve inference speeds far exceeding those of standard neural networks, particularly by leveraging the intrinsic sparsity and binary nature of logic gates.
- To explore whether learning the optimal logic gate (e.g., AND, XOR, NAND) per neuron leads to efficient and accurate models.
- To demonstrate that logic gate networks can achieve competitive accuracy with drastically reduced computational cost at inference time.
Proposed method
- Each neuron in the network is continuously parameterized by a probability distribution over the 16 possible binary Boolean functions, learned via softmax over 4-bit gate identifiers.
- The network uses real-valued logic to relax discrete logic operations, enabling backpropagation through the logic gate choices during training.
- During inference, each neuron selects the logic gate with the highest learned probability, resulting in a hard, discrete logic gate network.
- The architecture uses fixed, pseudo-random connectivity between neurons, with only the choice of logic gate per neuron being learned.
- The model is trained using standard backpropagation with differentiable approximations of Boolean operations, such as T-norms and T-conorms.
- Class predictions are obtained by bit-counting over multiple output neurons, which aggregates the final logic outputs into class scores.
Experimental results
Research questions
- RQ1Can logic gate networks be effectively trained using gradient descent by introducing a continuous relaxation of discrete logic operations?
- RQ2How does the performance of differentiable logic gate networks compare to standard neural networks in terms of inference speed and accuracy?
- RQ3Which logic gates (e.g., AND, XOR, NAND) are most frequently selected during training, and what does this reveal about the learned representations?
- RQ4Can logic gate networks achieve high accuracy with minimal parameters while maintaining extreme inference efficiency?
- RQ5To what extent does the architecture’s sparsity and binary nature contribute to its computational efficiency compared to dense or sparse neural networks?
Key findings
- The proposed differentiable logic gate networks achieve inference speeds exceeding one million MNIST images per second on a single CPU core, representing a 2–3 order-of-magnitude improvement over state-of-the-art models.
- On the MNIST dataset, the method achieves over 97.5% accuracy with inference times below 1 microsecond per image on a single CPU thread.
- On CIFAR-10, the largest model (5.12M parameters) reached 62.14% accuracy with an inference time of 73 microseconds per image on CPU, significantly faster than comparable baselines.
- The learned logic gate distributions show that XOR and XNOR gates are most frequent in the final layer, suggesting their role in modeling conditional dependencies.
- The first layer favors basic gates like AND, OR, NAND, and NOR, while later layers increasingly use identity and negation operations (A, B, ¬A, ¬B), indicating residual-like behavior.
- The method outperforms even the fastest binary and sparse neural networks in inference speed, with the largest gains observed in CPU-based inference.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.