Live data from Hacker News

Reverse engineering a neural network's clever solution to binary addition (2023)

cprimozic.net

11–19 of 19 posts

Re: Reverse engineering a neural network's clever solution to binary addition (2023)

#11

>As I mentioned, before, I had imagined the network learning some fancy combination of logic gates to perform the whole addition process digitally, similarly to how a binary adder operates. This trick is yet another example of neural networks finding unexpected ways to solve problems. My intuition is that this solution allows for some form of gradient approach to a solution, which is why it's unintuitive. We think ab…

Right, binary gates are discrete elements but neural networks operate on a continuous domain.

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.

Re: Reverse engineering a neural network's clever solution to binary addition (2023)

#12
post #8

>As I mentioned, before, I had imagined the network learning some fancy combination of logic gates to perform the whole addition process digitally, similarly to how a binary adder operates. This trick is yet another example of neural networks finding unexpected ways to solve problems. My intuition is that this solution allows for some form of gradient approach to a solution, which is why it's unintuitive. We think ab…

The more interesting question is is it even possible to learn the logic gates solution through gradient descent?

You could riff off an approach similar to https://google-research.github.io/self-organising-systems/di...

Re: Reverse engineering a neural network's clever solution to binary addition (2023)

#13
Very nice. I think people don't appreciate enough the correspondence between linear algebra, differential equations, and wave behavior.

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.

Re: Reverse engineering a neural network's clever solution to binary addition (2023)

#14
>> I created training data by generating random 8-bit unsigned integers and adding them together with wrapping.

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).

Re: Reverse engineering a neural network's clever solution to binary addition (2023)

#15
This is really cool and I hope there will be more experiments like this.

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.

Re: Reverse engineering a neural network's clever solution to binary addition (2023)

#17
Binary layer functions, whether for DACs which convert 4-bit or 8-bit inputs to a unitary neuron allows the network to both sum the inputs as well as convert the sum to analog all within a single layer ... [to] do it all before any [Ameo] activation functions even come into play." This is sin⁻¹(tan)x in the absence of asymptote.

Re: Reverse engineering a neural network's clever solution to binary addition (2023)

#18

Binary layer functions, whether for DACs which convert 4-bit or 8-bit inputs to a unitary neuron allows the network to both sum the inputs as well as convert the sum to analog all within a single layer ... [to] do it all before any [Ameo] activation functions even come into play." This is sin⁻¹(tan)x in the absence of asymptote.

Preserving the Golden Circle in a network, whether a φ ratio, π ratio is 1:1.618, which is on the one hand a rectangle's L/W or a circle which successively folds outward.

Re: Reverse engineering a neural network's clever solution to binary addition (2023)

#19
post #11

>As I mentioned, before, I had imagined the network learning some fancy combination of logic gates to perform the whole addition process digitally, similarly to how a binary adder operates. This trick is yet another example of neural networks finding unexpected ways to solve problems. My intuition is that this solution allows for some form of gradient approach to a solution, which is why it's unintuitive. We think ab…

Right, binary gates are discrete elements but neural networks operate on a continuous domain. 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.

[dead]
Post reply on HN