Learning Compact Boolean Networks

Shengpu Wang, Yuhao Mao, Yani Zhang, Martin Vechev · DOI

TL;DR

This paper introduces a highly efficient framework for training Boolean Networks (BNs)—neural networks that operate entirely on bits (0 and 1) rather than power-hungry floating-point numbers. By combining a novel "adaptive resampling" strategy for learning connections with a layer-wise discretization schedule, the authors achieved state-of-the-art accuracy on vision tasks while using up to 37x fewer Boolean operations than previous methods.

What Problem Does This Paper Address?

Standard deep learning is computationally expensive. While modern GPUs handle floating-point arithmetic well, edge devices, IoT sensors, and "green" computing initiatives require something much leaner. Boolean Networks are the logical extreme of model compression: every "neuron" is just a simple logic gate (like AND, OR, or XOR).

However, BNs are notoriously difficult to train. Because logic gates are discrete, you can't use standard gradient descent directly. Researchers usually "relax" these gates into continuous functions during training and then "snap" them back to discrete gates for inference. This leads to three major hurdles:

  1. Connection Learning: Deciding which neurons should talk to which others is a combinatorial nightmare.
  2. Architectural Bloat: Previous convolutional BNs used complex "trees" of gates to process image patches, which are computationally heavy.
  3. The Discretization Gap: The jump from a "smooth" continuous model during training to a "hard" Boolean model at inference often causes a massive drop in accuracy.

Methods

The authors attack these problems from three angles:

  • Adaptive Resampling for Connections: Instead of using fixed random connections or massive, memory-intensive weight matrices, the authors propose a "stable-or-swap" approach. Each neuron starts with a set of candidate input pairs and operations. If a neuron’s weights don't converge (measured by high entropy), the system "resamples" its connections to explore better combinations. This allows the network to learn its own topology without adding extra parameters.
  • Single-Operation Convolutions: Unlike prior work that used exponential "Boolean trees" for kernels, this method uses a single logic gate per convolutional step. This is made possible by the connection learning mentioned above—the network learns to pick the two most informative bits from a 3x3 patch rather than trying to process all of them through a complex tree.
  • Adaptive Discretization: Instead of discretizing the whole network at the end of training, the authors use a progressive schedule. They monitor the convergence of each layer; once a layer is "stable," they freeze it into its Boolean form and continue training the deeper layers. This forces the rest of the network to adapt to the specific errors introduced by discretization.

Datasets

The researchers evaluated their approach on two standard computer vision benchmarks:

  • MNIST: The classic "hello world" of computer vision (handwritten digits).
  • CIFAR-10: A more complex dataset of 60,000 tiny images across 10 classes (planes, dogs, etc.).

They compared their results against existing state-of-the-art Boolean frameworks, specifically DiffLogicNet and TreeLogicNet.

Key Insights and Ideas

  • The Paradox of Channel Restriction: One of the most surprising findings was that restricting a convolutional kernel to see only one input channel actually improved accuracy (by about 4.5% on CIFAR-10). The authors hypothesize that "thermometer encoding" (the method used to turn pixels into bits) is so destructive to color information that mixing channels too early creates more noise than signal.
  • Stability as a Signal: By tracking the entropy of a neuron's weights, the authors can identify "useless" neurons mid-training. If a neuron is "dispersed" (not favoring any specific logic gate), it’s essentially a waste of space, triggering a resample to find a more useful configuration.
  • Efficiency via Sparsity: Because each neuron only takes two inputs (bivariate), the resulting circuits are incredibly sparse. This makes them ideal for implementation on FPGAs or custom ASICs.

Key Results

The proposed method consistently outperformed previous work on the Pareto front of accuracy vs. computation:

  • MNIST: Achieved 99.41% accuracy, surpassing the previous best Boolean model while using 27x fewer Boolean Operations (BOPs).
  • CIFAR-10: Their "Large" model reached 72.67% accuracy, outperforming TreeLogicNet while using 3x fewer neurons and significantly fewer operations.
  • Training Speed: The adaptive discretization strategy actually sped up training by 1.8x in some cases, as discretized layers are computationally cheaper to process during the remaining training steps.

Limitations and Future Work

  • Floating-Point Training: While the final model is Boolean, the training process still requires floating-point math for gradients. This means you still need a powerful machine to train the model, even if it eventually runs on a toaster.
  • Domain Specificity: The current work focuses on vision. The authors note that extending this to text (LLMs) or time-series data is a necessary next step.
  • Logic Synthesis: The paper uses a simple pruning algorithm. Integrating more advanced logic synthesis tools (like the industry-standard ABC tool) could potentially shrink these networks even further after training.
  • Input Encoding: The reliance on thermometer encoding is a bottleneck. Finding a way to "learn" the best way to turn real-world data into bits remains an open challenge.

Summary updated

BibTeX
@misc{wang2026learning,
  author = {Shengpu Wang and Yuhao Mao and Yani Zhang and Martin Vechev},
  title = {{Learning Compact Boolean Networks}},
  year = {2026},
  eprint = {2602.05830},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.05830},
}
Figure