Skip to content
Borregolife laboratory ES · Español

How the cells think

In the Brains version every cell carries an artificial neural network: the same idea behind today's artificial intelligence, but tiny. It does not think like us: it is more like an inherited instinct that evolution keeps fine-tuning.

Here is what is inside, without hard formulas.

First time here? «Start here» explains everything from scratch, with examples. And words with a dotted underline have their definition: tap them.

1. One neuron

An artificial neuron always does the same thing: it takes some numbers, multiplies each one by a weight, adds them up with a bias and passes the result through a curve that keeps it between −1 and 1.

The weights are what make one neuron different from another: a large positive weight means “this matters and pushes me to say yes”; a negative one, “this puts me off”; one close to zero, “I don't care”.

Try it: this neuron decides whether to breed by looking at three things.

123 Σ
Sum
Output
Decision

2. A brain: many neurons together

Each cell's brain has two parts, each with its own neurons. The inputs (on the left) are what the cell sees; in the middle, the hidden neurons combine those inputs in many ways; on the right, the outputs are its decisions.

These are two real brains, taken from games that had already been evolving for thousands of generations. Every line is a weight: blue if it pushes towards “yes”, red if towards “no”, and thicker when stronger.

Small brain · 7 hidden neurons and 59 weights.
Big brain · 14 hidden neurons, 186 weights and two memory values.

A brain thinking, live

This is not a made-up example: it is a Brains game running right now in your browser, on a 64 × 64 board that has already gone through 400 generations. I follow one cell, the one in the white square. Every time it decides something, its network lights up with what it saw: each line shows the signal it carries at that moment (weight × input) and each neuron fills according to how strongly it fires, blue towards “yes” and red towards “no”. When it learns, its weights change in front of you.

3. One decision, one pass

There are no loops and no “thinking longer”: every decision is a single pass through the network, from left to right.

  1. The cell looks around and turns it into numbers between −1 and 1 (for example, full of food = 1, empty = −1).
  2. Each hidden neuron multiplies those numbers by its weights, adds them up and passes them through the curve.
  3. The output does the same with what comes from the hidden neurons.
  4. If the output is above zero, the answer is yes.

The big brain also has memory: two outputs that decide nothing but are stored and fed back in the next generation. It is the only thing carried from one time to the next, and it lets a decision take into account what happened before. It also sees its experience (how its last nests went), the food in the surrounding cells and its partners' age.

FeatureSmallBig
Hidden neurons714
Weights59186
Things it sees when choosing a partner711
Things it sees when deciding whether to stay alive59
Memoryno2 numbers

4. How the weights change

Nobody tells a cell which weights to have. They change in three ways:

  • Inheritance. The daughter takes each weight from one of her three mothers, at random.
  • Mutation. With a 5 % chance, each weight changes a little at birth.
  • Learning during life. After every nest, the mother adjusts her weights a little: if the daughter made it, towards “yes” in similar situations; if not, towards “no”. It is the same idea used to train neural networks, but with one experience at a time. What she learns is not inherited: the daughter is born with her mothers' birth weights. What is inherited is how much she learns.

Selection does the rest: brains whose decisions work leave more daughters, and their weights spread. This is called neuroevolution.

5. Does thinking more help survival?

More neurons guarantee nothing: there are more weights to tune and evolution may take longer to find good ones. To find out, I simulated identical games with each brain (4 of each, 6000 generations, same board and same food):

MeasureSmall (7 neurons)Big (14 neurons)
Board occupied19.0 %18.1 %
Starve to death each generation4.4 %5.5 %
Prefer a partner of their colour+0.22 to +0.29 (avg. 0.26)+0.23 to +0.69 (avg. 0.50)
Hold on according to their own food+0.81 to +0.95+0.61 to +0.82
Hold on according to food in their areacannot see it+0.27 to +0.59 in 3 of 4 games

Thinking more does not make them survive more (for now): the big brain keeps almost the same population and starves a little more. But it learns things the small one cannot: it chooses partners with twice the discernment and, in 3 out of 4 games, decides whether to hold on by checking whether its area has food, not just its own cell.

The first time I tried it, the big brain did clearly worse (16.9 % of the board): its extra inputs and neurons started with random weights and added noise from day one. Now they start dormant (weight 0) and evolution only wakes them up if they are useful.

6. How far the rules can change

A brain does not rewrite the rules: it decides within them. Some things no cell can change, however much its brain evolves, and there are two moments where it can depart from what the rule says.

Each example is a made-up situation, but it is worked out by the same engine as the laboratory, generation by generation. The brains are made to measure so that they decide what the example needs.

What never changes

Being born takes exactly 3 neighbours and at least 5 food in the nest. No brain can make a daughter be born with 2 or 4 neighbours, or in a cell with no food.

Being born: exactly 3 neighbours
This example needs a more recent browser.

Generation 0

    The neighbours are always the 8 around it. No cell sees further or knows what happens on the rest of the board.

    Only the 8 around count
    This example needs a more recent browser.

    Generation 0

      Living costs 1 food per generation, and without food a cell dies. Each cell regrows 0.3 per generation, up to 30.

      Living costs food
      This example needs a more recent browser.

      Generation 0

        Inheritance has its own rules: the daughter's colour is the average of her mothers' with a small change, each mother puts 30 % of her food into the nest and, at birth, every brain weight has a 5 % chance of changing, by ±0.5 at most.

        Inheritance
        This example needs a more recent browser.

        Generation 0

          Where the brain does decide

          Being born: it can only say no

          When an empty cell meets the rule, the three neighbours that would be its mothers look at the nest and each one decides with her brain. A single “no” is enough for nobody to be born. So a brain can make fewer daughters be born than the rule alone would, never more. And even if all three say yes, if their brains are very different the daughter may not make it.

          The nest: one “no” is enough
          This example needs a more recent browser.

          Generation 0

            Staying alive: obey, hold on or give up

            Every generation, each cell sees what the rule says (it stays alive with 2, 3 or 4 neighbours) and decides. It can obey, give up although the rule lets it live, or hold on although the rule says it dies. Holding on is not free: it costs 8 food on top of the usual 1.

            Holding on, while it can pay
            This example needs a more recent browser.

            Generation 0

              Giving up hardly ever happens (0.9 % of the time in the evolved population), but it can, and it makes room:

              Giving up
              This example needs a more recent browser.

              Generation 0

                And the brain has limits too

                Every weight is between −6 and +6. More would hardly change anything: with a weight of 6 the neuron is already practically at its maximum.

                not allowed 0246810 10 weightoutput 0.760.9950.99999

                How much it learns during life is a gene that goes from 0 (learns nothing) to 2.

                Example: a brain that, faced with a certain nest, wanted to breed (+0.78). The nest goes wrong and it learns from it. How much it changes depends on its “learns” gene:

                Before+0.78Learns 0+0.78Learns 0.5+0.13Learns 1−0.54Learns 2−0.89

                Neurons: 7 in the small brain and 14 in the big one. If “Brain size evolves” is switched on, each neuron can switch on or off at birth, and each one that is on eats 0.1 food per generation.

                Every neuron eats
                This example needs a more recent browser.

                Generation 0

                  What really happens

                  Measured in real games: three 256 × 256 games from scratch (200 generations at each point) and the laboratory's already evolved population (300 generations from 20,000 onwards).

                  MeasureAt the startGen. 1000Gen. 6000Gen. 20,000
                  Hold on when the rule says they die1.3 %21 %21 %23 %
                  Give up although the rule lets them live0.1 %0.7 %0.5 %0.9 %
                  Nests where all three mothers say yes73 %89 %94 %90 %
                  Nests a daughter is born from68 %79 %81 %79 %

                  How many stay alive, by number of neighbours

                  0 %50 %100 % 01234567
                  At the startAfter 20,000 generationsThe rule lets it live
                  NeighboursThe rule saysAt the startAfter 20,000 generations
                  0dies2.5 %19 %
                  1dies1.7 %24 %
                  2lives97 %95 %
                  3lives97 %96 %
                  4lives97 %96 %
                  5dies0.9 %25 %
                  6dies0.5 %11 %
                  7dies0.3 %4.7 %

                  With 2, 3 or 4 neighbours it does not reach 100 % because some run out of food or give up. With 8 neighbours there is hardly ever anyone: it is left out of the table.

                  In practice, at the start the brains almost always obey the rule. After about a thousand generations, the rule “stays alive with 2, 3 or 4 neighbours” has become “stays alive with 2, 3 or 4, and one in four or five also holds on with 0, 1 or 5 if it can pay for it”. They do not hold on blindly: the ones that hold on have 16.7 food on average, and the ones that accept dying 6.4. Nobody taught them: the ones that held on without food starved and left no daughters.

                  Being born still takes exactly 3 neighbours. What changes is how many nests the mothers accept (from 73 % to 94 %) and who with: at the same time, they learn to prefer partners of their own colour.

                  See an already evolved population The same game, without being able to hold on

                  7. Can everything stand still?

                  In Conway's Game of Life many games end up still: blocks and shapes that repeat for ever. In Brains, a game could stop in two ways: everyone dies, or a few cells stay alive without ever changing. The first can happen, and it is for ever. The second cannot.

                  Everyone dying: possible, and for ever

                  An empty board never changes again, because being born takes 3 live neighbours. If at some point every cell dies, the game is over. The brains can lead there in two ways. The first, by deciding to give up:

                  They all give up
                  This example needs a more recent browser.

                  Generation 0

                    The second, if nobody wants daughters. Every death is for ever, and what looks still ends up running out of food:

                    Nobody wants daughters
                    This example needs a more recent browser.

                    Generation 0

                      In normal games it does not happen: a brain that gives up or wants no daughters leaves no offspring, and those brains vanish on their own. Besides, starting brains are born willing to breed and obeying the rule. What does end a game is a rule that is too harsh. With Conway's (stays alive with 2 or 3 neighbours) plus food, all 5 128 × 128 test games died out, between generations 76 and 185. With the Brains rule (2, 3 or 4), none of 5 in 3000 generations.

                      Alive and still: impossible

                      Every live cell eats 1 food per generation, and its cell only regrows 0.3: it loses 0.7 every generation. So even starting with a full cell (30), no cell can live more than 43 generations, and holding on only shortens it. A shape that does not change, like the block, runs out of food:

                      A still block
                      This example needs a more recent browser.

                      Generation 0

                        The only thing that lasts is what renews itself: some cells die and others are born where the food has grown back, and each mother gives her daughter part of hers.

                        What does last: renewing
                        This example needs a more recent browser.

                        Generation 0

                          The same happens in the laboratory's evolved population (128 × 128) over 1000 generations. The population moved between 2653 and 3459 alive, no cell got older than 29 generations, and every generation, on average, as many cells were born or died as 32 % of the living. From afar it looks stable; up close, nothing stands still.

                          By the same sums, on average no more than 3 cells in 10 can be alive: each cell gives 0.3 food per generation and each living cell eats 1. In that population, 1 cell in 5 is alive.

                          8. What they are not

                          • They do not reason. Given the same inputs they always give the same answer, like a reflex.
                          • They remember nothing specific. The big one keeps two numbers from one generation to the next; that is all.
                          • They do not see far or communicate: only their cell, their neighbours and the nest.
                          • Nobody trained them with data like a chat AI: their weights come from evolution and a little of their own experience.

                          For scale: the small brain has 7 neurons and the big one 14; a microscopic worm (C. elegans) has 302, and today's language models have billions of weights.

                          The interesting part is not in a single cell but in the population over thousands of generations: no cell “knows” why it prefers its colour, but the ones that did left more daughters.

                          In the laboratory, choose Brains and the “Inspect a cell” tool: the card draws its brain with its real weights.

                          See a cell's brain in the laboratory The Brains rules

                          On this page