Embedding boolean circuits in a neural network

by Edward Benson, 30 October 2026

This post is mostly me thinking out loud: how is it possible to install a boolean circuit sidecar to an otherwise trained neural network?

It strikes me that there are essentially two distinct problems here:

  • Representing the boolean circuit as a set of neurons
  • Connecting the boolean circuit to a trained network

The representation part is relatively straightforward. A neuron is a weighted sum of inputs, plus a bias, passed through an activation function.

If we assert that the inputs are all either 0 or 1, and the activation function is simply “is it greater than zero”, then we can turn boolean operators into neurons like so: