Reverse Engineering a Neural Network's Clever Solution to Binary Addition (2023)
Key topics
The article discusses the reverse engineering of a small neural network that learned to perform binary addition, revealing an unexpected analog computing approach, and sparking discussion on the network's internal representations and potential applications.
Snapshot generated from the HN discussion
Discussion Activity
Active discussionFirst comment
4d
Peak period
13
96-108h
Avg / period
8
Based on 16 loaded comments
Key moments
- 01Story posted
Nov 4, 2025 at 2:22 AM EST
about 2 months ago
Step 01 - 02First comment
Nov 8, 2025 at 8:02 AM EST
4d after posting
Step 02 - 03Peak activity
13 comments in 96-108h
Hottest window of the conversation
Step 03 - 04Latest activity
Nov 8, 2025 at 6:13 PM EST
about 2 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
My intuition is that this solution allows for some form of gradient approach to a solution, which is why it's unintuitive. We think about solutions as all or nothing and look for complete solutions.
I'm reminded of the Feynman anecdote when he went to work for Thinking Machines and they gave him some task related to figuring out routing in the CPU network of the machine, which is a discrete problem. He came back with a solution that used partial differential equations, which surprised everyone.
Looking later there's also a strange DAC that gives the lowest resistance to the least significant bit, thus making it the biggest contributor to the output. Very confusing.
On that hunch, I just checked and I get 32896.
Edit: if I exclude either input being zero, I get 32385.
You also get the same number when including input zeros but excluding results above 253. But I’d bet on the author’s reason being filtering of input zeros. Maybe the NN does something bad with zeros, maybe can’t learn them for some reason.
My takeaway is also that we don't really have a good intuition yet how the internal representations of neuronal networks "work" or what kind of internal representations can even be learned through SGD+backpropagation. (And also how those representations depend on the architecture)
Like in this case, where the author first imagined the network would learn a logic network, but the end result was more like an analog circuit.
It's possible to construct the "binary adder" network the author imagined "from scratch" by handpicking the weights. But the question would be interesting if it could also be learned or if SGD would always produce an "analog" solution like this one.
There is some evidence that the activation functions and weights can be arbitrarily selected assuming you have a way to evolve the topology of the network.
https://arxiv.org/abs/1906.04358
So, binary addition in [0,256] (base 10). Did the author try the trained network on numbers outside the training range?
It's one thing to find that your neural net discovered this one neat trick for binary addition with 8-bit numbers, and something completely different to find that it figured out binary addition in the general case.
How hard the latter would be... depends. What were the activation functions? E.g. it is quite possible to learn how to add two (arbitrary, base-10) integers with a simple regression for no other reason than regression being itself based on addition (ok, summation).
So: DAC + sum in analog domain+ ADC is what the NN is doing.
Roughly speaking, it seems the network is essentially converting binary digits to orthogonal basis functions and then manipulating those basis functions. Finally a linear transformation back into the binary digit space.