The evolving neural controller

Every organism in this world is driven by the same small neural network: 53 inputs, 24 recurrent hidden units, 8 outputs. The shape never changes. The 2,081 numbers inside it are inherited, mutated, and selected on, and they are the only thing that makes one organism behave differently from another.

Implementation Ruleset pre-genesis-candidate-v2 Source: src/el/neural.py

Why there is a controller at all

The alternative would be to write down what an organism should do: seek food when hungry, flee heat, reproduce when rich. That approach produces a simulation of the rules its author already believed. It cannot surprise anyone, because every behaviour in it was put there deliberately.

Instead each organism carries a function from what it senses to what it does, and the parameters of that function are inherited with mutation. Nothing scores an organism. Nothing computes how well it is doing. Organisms that happen to survive long enough to reproduce pass their parameters on, slightly changed, and organisms that do not, do not. Whatever behaviour appears is whatever survived that filter.

Emergent Life implementation

There is no fitness function anywhere in src/el/. This is a checkable claim rather than a slogan, and it was checked: see RN-003, which ran the identical world twice per seed with only mutation toggled and found the predicted gene moved in the predicted direction in 8 of 8 seeds when mutation was on, and could not move at all when it was off.

The shape of the network

One layer of recurrent hidden units, with a linear map into it and a linear map out of it. That is the whole architecture. It is deliberately small: an organism pays energy every tick to run it, and a controller too large to pay for is not a controller an ecology can support.

The controller: 53 inputs into 24 recurrent hidden units into 8 outputs Observations enter a layer of 24 recurrent hidden units through a 24 by 53 weight matrix. The hidden layer feeds back into itself through a 24 by 24 recurrent matrix and carries part of its previous value forward. The hidden layer then feeds 8 action outputs through an 8 by 24 matrix. observation 53 channels W_ih 24 x 53 hidden state 24 units, H0 to H23 W_hh + leak W_ho 8 x 24 actions 8 channels move_x move_y ingest reproduce push pull manipulate signal
The full controller. Nothing is hidden in this picture: there is no second hidden layer, no attention, no gating, no convolution. The blue path is the only thing that carries information from one tick to the next.

One decision, step by step

This is the forward pass, transcribed from el.neural.forward. It runs once per organism per tick, for every living organism at once.

# obs: the 53 sensory values, built by the SENSE stage from a frozen world # h: this organism's own 24 hidden units, as its last decision left them pre_h = W_ih . obs + W_hh . h + b_h lambda = leak_min + (leak_max - leak_min) * sigmoid(leak_raw) # in [0.05, 0.95] h_new = (1 - lambda) * h + lambda * tanh(pre_h) action_pre = W_ho . h_new + b_o action = squash(action_pre + sigma * noise) # noise added BEFORE squashing
squash is fixed per channel and never evolves: tanh on the two movement channels and the signal channel, a logistic sigmoid on the other five.

Everything an organism perceives is read from the world as it stood at the start of the tick, before anything in that tick has moved. Every organism therefore decides against the same frozen snapshot, and no organism can react within a tick to something another organism did in that same tick. That constraint is what makes the whole simulation order-independent and reproducible.

Memory, leak and recurrence

The hidden layer is the only memory an organism has. It is not reset between ticks, so information can persist: a value that rose several ticks ago is still partly present now, faded by however many updates have happened since.

How fast it fades is lambda, and lambda is inherited. An organism with a low leak rate carries much of its previous state forward and changes slowly. One with a high leak rate is dominated by whatever it is sensing right now. Both are available to evolution, and the founder value sits exactly at the midpoint of the allowed range rather than at either extreme.

Emergent Life implementation

The hidden state is zeroed at every birth. An organism inherits its parent's weights but never its parent's memory. Whatever an organism knew when it died is gone, in the strong sense that the numbers themselves are set to zero and the array is not copied.

What the 2,081 parameters are

Each organism carries one flat vector of 2,081 numbers. The first 2,072 are the connectome: the actual weights and biases. The remaining 9 are scalars that control how the organism runs and how it learns, and they are inherited and mutated exactly like any weight.

The parameter layout, read from el.neural. Every organism has all of them, at every generation.
BlockShapeCountWhat it does
W_ih24 x 531,272How each sensory channel drives each hidden unit
W_hh24 x 24576How the hidden units drive each other, tick to tick
b_h2424Each hidden unit's resting bias
W_ho8 x 24192How each hidden unit drives each action
b_o88Each action's resting bias
leak_rawscalar1How fast the hidden state fades
sigma_rawscalar1How much exploration noise this organism adds
learning_rate_rawscalar1How fast it adjusts weights during life
plasticity_scale_rawscalar1How much those adjustments count
elig_decay_rawscalar1How long an eligibility trace lasts
reinforcement weights44What it treats as reinforcing: energy, gut, health, injury

Weights are unconstrained real numbers, clipped to plus or minus 4.0 after mutation. That clip is a numerical safety rail, not a meaning: unlike the physical genome, where every gene lives in a defined zero-to-one range that maps to a stated physical quantity, a weight of 2.7 does not mean anything on its own.

How the weights mutate

Neural weights use a four-outcome model, deliberately different from the physical genome's three-outcome one. Per weight, independently, at every birth:

Read from el.config.NeuralParams. Probabilities are evaluated in this order.
OutcomeProbabilityChange
Unchanged95%Copied exactly from the parent
Large0.10%Add a draw from a normal with standard deviation 0.3
Moderate0.73%Add a draw with standard deviation 0.08
Tiny4.17%Add a draw with standard deviation 0.02

Each draw is keyed on the parent's identifier, the offspring's identifier and the weight's index, so the same birth always produces the same offspring. See determinism and reproducibility for what that guarantee is worth and how it is tested.

Exploration noise

An organism's real action is not exactly what the formula above computes. Keyed noise of magnitude sigma is added to each channel's pre-activation before squashing, and sigma is itself an inherited parameter, capped at 0.5.

Two things follow. An organism with low sigma behaves almost deterministically given its state; one with high sigma explores. Which is better is not decided anywhere in the code. And because the noise is keyed on the seed, the tick and the organism's identifier rather than drawn from a hidden generator, the same organism at the same tick in the same world always makes the same decision, however many times the run is replayed.

What this means for the live panel

The Brain Inspector shows the network's output without that noise, because the noise for a tick that has not run yet has not been drawn, and drawing it from a viewing panel would consume the stream the simulation itself uses. The panel says so where it shows those numbers: the real decision is drawn from around them, not exactly on them.

How the input layer grew six times

The controller did not start with 53 inputs. It started with 40, of which several were allocated but permanently fed zero, because the properties they would have described did not yet have any physical consequence. The project's own stated reason for leaving them empty is worth quoting: a sensor for a property with no mechanical consequence yet would be actively misleading.

As later phases gave those properties consequences, the reserved channels were filled. Filling a reserved channel costs zero new parameters, needs no migration, and works with every already evolved brain, because every brain in every generation already carried a weight row for it and had simply been multiplying it by zero. Adding a genuinely new channel is different: it costs exactly 24 new weights, one per hidden unit.

The input layer's growth, from el.perception and el.neural's own comments.
PhaseInputsWhat was addedParameter cost
Phase 1B40Body state, own cell, neighbours, four directional sectors. Channels 32 to 39 allocated and fed zero.The original layout
Phase 5A40Object density, mass, hardness, nutrition, carrying, held mass. Reserved channels 32 to 37 activated.Zero new parameters
Phase 5B40Heat from matter here and around. The last two reserved channels, 38 and 39.Zero new parameters
Phase 5F42Signal field and trace field. Genuinely new, with no reserved substitute.+48 weights
Phase M part 146Did the last action work, was the last move blocked, what is under me, did the last force do anything.+96 weights
Phase M part 248Mass in the cell ahead, and whether that cell is passable.+48 weights
Phase Z53Whether it is carrying a block of ground; how much ground has been piled on or dug out of its own cell; whether the cell ahead steps up or down; how much material that cell could still give; and how much it would still need to reach the waterline.+120 weights
Observed result

The Phase M additions were not speculative. They followed RN-001, which found that organisms were attempting to push objects 85 million times and succeeding 9,968 times, because nothing in their sensory layer told them whether an attempt had worked. Under the reworked substrate, the average number of attempts before an organism's first success fell from 306.9 to 181.4 across the first several generations.

Why the shape does not evolve

The number of hidden units, the number of layers, and the presence of the recurrent connection are fixed constants in the source, with the same status as the width of the genome. Only the numbers inside evolve.

This is a real limitation and is stated as one rather than defended as a virtue. An architecture that could itself evolve would be a different and more ambitious project. What a fixed shape buys is that every organism's brain is directly comparable to every other organism's brain and to the founding ancestor's, which is what makes a number like neural distance from the founder meaningful at all, and what lets a single stored array hold the whole population's brains.

What this controller cannot do

Look at a real one

All of the above is checkable on any living organism right now. Open the live world, select an organism, and open its controller: the panel shows that individual's actual 53 input values, its actual 24 hidden units both as its last decision left them and as the current observation transforms them, and its actual 8 outputs, together with an exact term-by-term decomposition of where each output came from.

Open the live world How the panel works