cd /news/artificial-intelligence/embedding-boolean-circuits-in-a-neur… · home › topics › artificial-intelligence › article
[ARTICLE · art-162036] src=edwardbenson.com ↗ pub= topic=artificial-intelligence verified=true sentiment=· neutral

Embedding boolean circuits in a neural network

A blog post on Robot Book Club lays out a method for installing a boolean circuit as a sidecar to an already-trained neural network, splitting the problem into representing boolean gates as neurons and wiring that circuit into the trained model. The post gives neuron formulas for AND (A + B - 1.5 > 0), OR (A + B - 0.5 > 0) and NOT (0.5 - A > 0), and defines a "Probe" that maps a real-valued neuron such as L3 N234 into a boolean signal and a "Stim" that adds a signed steering magnitude, such as -12.5 on L11 N15292, back into the residual stream. The author notes the probe must run before the layer it stimulates within a single forward pass and published no code, describing the post as structuring thinking for a larger project.

read3 min views2 publishedNov 1, 2026

Robot Book Club.

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:

AND(A, B) = A + B - 1.5 > 0
OR(A, B) = A + B - 0.5 > 0
NOT(A) = 0.5 - A > 0

There’s no extra story needed here with respect to boolean expressions. These gates are all you need to create any expression, and the neurons can compose exactly as the symbolic operators would compose on paper.

The second problem is patching this circuit to a trained network. Signals in a trained neural network aren’t necessarily a clean 0 or 1 depending on where you draw them from.

So you need an ingress and egress mapping: from the neural net into the boolean circuit, and then back into the neural net. Kind of like Neuralink but for LLMs.

For the ingress side, let’s call a Probe a mapping from a trained neuron with real-valued output into a boolean-valued signal. We’ll notate a probe like this:

probe Trigger: [L3 N234 >1]

This probe would be 0 if neuron L3 N234 was equal to or less than 1, and 1 otherwise. It can be implemented with a single neuron at the ingress of the boolean circuit, with a threshold set based on knowledge of the targeted neuron and observed meaning of it firing under different values.

For the egress side, let’s call a Stim an additive push that a boolean value switches on or off. A stim identifies a neuron and a signed steering magnitude.

stim Watermelon: [L11 N15292 -12.5]

Here -12.5 sets the direction and size of the added push. This size value has to be chosen based on the observed and desired effect in the trained LLM. For example, if you found a neuron that made the model act like a watermelon when pushed at -12.5, then you might connect this stim as the output of some boolean circuit intended to switch it on at the right time.

An individual MLP neuron has a scalar activation. In a transformer, its output weights define a direction in the vector-valued residual stream. Here, a stim adds the stated signed magnitude along that direction, normalized to length 1.

Within one forward pass, the probe must run before the location it stimulates, as in the L3-to-L11 example above. Reading a later layer and stimulating an earlier one requires carrying the signal into a subsequent processing step.

And that’s it!

I’m fairly certain this describes:

  • A method of translating a boolean expression into a neural circuit
  • A method of adapting real-valued neurons into boolean-valued inputs for this circuit
  • A method of adapting boolean-valued outputs of this circuit back into real-valued outputs in the network

No code example attached this time. I’m using this blog post to structure my thinking for something slightly more involved I’m hacking on.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @robot book club 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/embedding-boolean-ci…] indexed:0 read:3min 2026-11-01 · —