How a neural network makes one decision

Underneath every neural network, however large, is arithmetic simple enough to do by hand: multiply, add, and squash the result into a range. Everything else is scale and arrangement. This is what one decision actually consists of, followed step by step.

One artificial neuron, in full

A single unit takes several numbers in, and produces one number out. It does three things, in order.

It multiplies each input by a weight belonging to that connection. It adds those products together, plus a bias belonging to the unit itself. Then it passes the total through a function that squashes it into a bounded range, so the value cannot run away as it moves through the layers.

How one artificial neuron turns several inputs into one output Four input values on the left each travel along a connection carrying a weight. The products are summed together with a bias in a central node, and the total passes through a squashing function that bounds it, producing a single output value on the right. 0.8 x 0.5 0.2 x -1.2 0.9 x 0.3 0.1 x 0.9 sum + bias squash to a range out multiply, add, squash. Every unit in every network does exactly this.
The weights are the only part that differs between one network and another. The arithmetic is identical everywhere, which is why a network's behaviour lives entirely in its numbers.

The squashing step is not decoration. Without it, stacking layers would be pointless: a chain of pure multiplications and additions collapses mathematically into a single multiplication and addition, so a hundred-layer network without it would be exactly as capable as a one-layer network. The bend in that curve is what makes depth mean anything.

From one unit to a decision

A network arranges these units in layers. Inputs arrive, every unit in the next layer computes its own weighted sum of all of them, and the results become the inputs to the layer after that, until a final layer produces the outputs.

In this world every organism carries the same shape: 53 numbers in, a hidden layer of 24 units, and 8 numbers out, for a total of 2,081 values that differ between individuals. Those 2,081 numbers are the entire difference between one creature's behaviour and another's. The exact figures and what each channel measures are on the evolving neural controller.

One decision therefore costs a few thousand multiplications and additions. That is all. There is no deliberation, no search, no consideration of options. The inputs go in and the outputs fall out, in a fixed amount of arithmetic that takes the same time whether the situation is trivial or fatal.

The loop that adds a past

A plain layered network is a function: the same inputs always give the same outputs, with no history. That is fine for sorting photographs and useless for anything living in time, because it cannot tell a rising reading from a falling one.

A recurrent network fixes this by feeding the hidden layer's own values back into itself on the next step. What it does now depends on what happened before. Nothing instructs it what to remember; whatever the weights cause it to carry forward is what it carries.

Here, how long that memory lasts is itself inherited. A leak value between 0.05 and 0.95 sets how much of the old state survives each step, so slow persistent memory and fast forgetful memory are both available, both heritable, and both mutating. The population is quietly testing how much of the past is worth keeping. More on the mechanism in recurrent neural networks.

Where the numbers come from

Most networks you have heard of get their weights by training: run an input through, compare the output to the correct answer, and nudge every weight in the direction that would have reduced the error. This needs a known correct answer and a differentiable path back to every weight.

Neither exists here. There is no correct answer for what an organism should do, and nothing supplies one. The weights are inherited from a parent with mutation, and a network that leads its owner to run out of energy before reproducing is not corrected, it is simply not copied. That is neuroevolution, and the trade is severe: no gradients needed, far more evaluations required.

There is a second, smaller mechanism that adjusts weights during an individual's own life, driven by which connections were recently active together and a reinforcement signal the organism computes from its own internal state. Everything it acquires that way is discarded at death and never inherited, which is tested rather than assumed and reported with its null results on lifetime neural plasticity.

Watching the arithmetic happen

All of this is inspectable. Select any organism on Watch and open its controller, and you get that individual's real 53 inputs, its 24 hidden values, and its 8 outputs, on this tick.

What you will not find is a unit that means something. There is no neuron that lights up for food, no output labelled with an intention. It is a few thousand numbers doing arithmetic, and the interesting fact is not that any of it is legible, because it is not. The interesting fact is that this is sufficient to keep something alive in a world with weather.