Active Inference InstituteSimulations

Chapters 3, 4 and 8IntermediateNew edition

The self-evidencing tree

Twenty-four identical cells start in a heap. Each carries the same model of the whole plant, and each acts until what it senses is what a cell in one place of that plant should sense. Watch them sort themselves into a body. Then cut it, graft it, or change the model.

Dashed gold rings: the target form, which is the cells’ shared prior. Cell colour: the cell’s belief about its tissue; pale lilac means undecided. Red glow: the cell’s own free energy. Haze: the summed signal of each tissue. Drag a cell to graft it.

The shared model (same cells, different prior)

Interventions

Settings

How much a cell trusts the signal it senses from the others.
How firmly a cell holds that it is in no particular place.
Random motion added to every cell’s position.

AII: EduActive · Watch, then do

Three short clips, three things to try

These three passages come from an Institute interview and from two of the Institute’s livestreams on the paper “Morphogenesis as Bayesian inference” (Kuchling et al. 2020). Each is one to two minutes. Watch one, then press its button and look for the same thing among the cells above.

  1. Plays here, from 1:33. Nothing loads from YouTube until you press play.Open on YouTube at 1:33

    Before you start

    What morphogenesis is

    Morphogenesis is the way a living body builds its own shape. Nobody assembles it from outside. The striking part is that the same shape is often reached even when something goes wrong on the way, such as an injury.

    Listen for
    So, for example, a salamander loses a limb. Those cells have to not only restore the entire structure, but then also know to stop when it’s done.
    Then try
    All 24 cells will start in one heap, undecided. No cell is told which place is its own. Say whether you expect them to reach the dashed outline, and whether two cells will ever settle on the same place. Then watch.
    In the model equation 1

    The speaker calls the shape a body returns to its target morphology. On this page the target is three tables held by every cell: a position, a secretion and an expected signal for each of 24 places. Each cell moves and secretes until what it senses matches a place in those tables. When the errors are small there is little left to descend, and the cells stay put.

    The speaker is describing embryos and regenerating animals. The page is far simpler. Its cells do not divide while the body forms, they migrate as real plant cells do not, and there is no mechanics or molecular pathway.

    Equation 1, the shared model · Equation 4, perception and action

  2. Plays here, from 3:34. Nothing loads from YouTube until you press play.Open on YouTube at 3:34

    While it runs

    Cells that share one model

    In the simulation being described, every cell carries the same plan of the finished body. At the start no cell knows which part of the plan it is. By signalling to the others and sensing their signals, each one slowly works out its part.

    Listen for
    They all share a model, a morphology they could achieve, that they essentially are programmed to achieve at some point. But none of the cells are any of the given cell types initially.
    Then try
    Every cell is about to be given the plan of a different plant. Nothing will be moved by hand. Say what you expect the same cells to build. Then watch the belief chart as well as the stage.
    In the model equations 1 and 4

    The shared model is the set of tables X*, C* and Λ* in equation 1, the same in every cell. What differs between cells is the internal state ψ, which the softmax turns into a belief s over places. A cell that starts undecided has a nearly flat s; perception sharpens it as the signals arrive.

    The simulation the speaker describes has a few cells that each infer one of four cell types. This page has 24 cells and 24 places, each place with its own signal, and it colours a cell by the tissue of the place it believes in. Several details of the published model were reconstructed here and not checked against its code.

    Equation 1, the shared model · Equation 4, perception and action

  3. Plays here, from 58:50. Nothing loads from YouTube until you press play.Open on YouTube at 58:50

    Afterwards

    Same target, altered signalling

    A body can come out wrong even when its plan is untouched. In the experiments described here the plan in every cell stays exactly the same. Only the way cells respond to each other’s signals is changed, and the final shape changes with it.

    Listen for
    One thing I tried to stress in that paper: the target morphology in all the simulations is exactly the same.
    Then try
    The cells will start again with the same plan, but with the weight they give to sensed signals cut from 16 to 0.25. Say how many of the 24 places you expect to be filled. Then compare with the first run.
    In the model equation 3

    On this page the nearest control is the precision of sensed signals, πλ, which weights the signal error in equation 3. Lowering it leaves the tables of the shared model as they were. It changes only how much a cell’s belief and action are moved by what it senses from the others. The button beside it in Try this, which knocks out the leaf signals, alters signalling in a second way: the cells can no longer secrete them.

    The published experiments differ. One makes the cells’ response to the signals asymmetric and obtains a body with two heads or two tails. Another cuts the sensitivity of a single cell. This page changes all cells at once and does not reproduce either result.

    Equation 3, free energy of one cell · Equation 2, the sensed signal

The quoted lines are taken from the automatic captions, with punctuation added and hesitations removed. The speakers are discussing living tissue and the published simulations, not this page; where the two differ, the notes say so. Each clip stops at the end of the passage. The full recordings are listed under Sources.

Learn by doing

Try this

Before each step, say what you think will happen. Then press the button and watch the cells, the belief chart and the free energy trace.

  1. Build a body from one point. All 24 cells start together and undecided. No cell is told which place is its own. Each one senses the others’ signals, revises its belief, moves and secretes.Predict: will two cells ever settle on the same place?
  2. Graft a cell. The topmost cell is put down among the roots. Its belief is not touched. It could come to believe it is a root, or it could act to make its old belief true again.Predict: which gives way, the belief or the position?
  3. Change the model, not the cells. Every cell is given the model of a different plant. Nothing is moved by hand. A prior is what a model expects before evidence; here the form is the prior.Predict: what will the same cells build?
  4. Blunt the senses. Start again, with the precision of sensed signals cut from 16 to 0.25. Precision is the weight given to a prediction error. With little weight on the signal from others, a cell has almost nothing to tell it where it is.Predict: how many places will be filled?
  5. Cut the body in half. The upper cells are removed. The survivors can still move and secrete, but the signals of the missing cells are gone, and no action of theirs can make them.Predict: what will free energy do, and will it come back down?
  6. Let it regenerate. Survivors at the wound divide. The new cells are undecided. The places that are empty are the ones whose signals are missing, and that is what the new cells sense.Predict: will the new cells copy their parents or fill the gaps?

The mathematics

What is being computed

Each cell runs the same small calculation. The numbers under each equation are the current values for one cell, the one ringed in blue on the stage. Click or tap a cell to choose another.

1 · The model every cell shares s=σ(ψi),sk=eψik∑leψil x^=∑kskXk*,c^=∑kskCk*,λ^=∑kskΛk* Code: cellEval (predictions xh, yh, ch, lh), belief.

The body plan has 24 places. Place k has a target position X*k, a target secretion C*k and an expected signal Λ*k. These three tables are the generative model: the cell’s account of what it should sense. They are the same in every cell. What differs between cells is the internal state ψi, a list of 24 numbers. The softmax function σ turns it into s, the cell’s belief: a probability for each place. The cell’s predictions are the table entries averaged under that belief.

2 · What a cell senses from the others λi=∑j≠icje−dij/ℓ,Λk*=∑j≠kCj*e−dkj*/ℓ Code: lambda (sensed), form (the table Λ*).

Each cell secretes signals, cj, which fade with distance dij over a range ℓ. A cell senses the sum from all the others, λi. The model’s table Λ* is the same sum worked out for the finished body. So Λ*k is what a cell in place k would sense if every other place were filled. In this edition each place has its own signal; the haze on the stage adds them up by tissue.

3 · Free energy of one cell Fi=12πx|εx|2+12πc|εc|2+12πλ|ελ|2+12πψ|ψi|2 εx=xi−x^,εc=ci−c^,ελ=λi−λ^ Code: cellEval (Fx, Fc, Fl, Fp, F), freeEnergy (the sum over cells).

A prediction error ε is a sensation minus its prediction. A precision π is the weight an error is given; it is the inverse of the variance the model expects in that sensation. Free energy F is the weighted sum of squared errors, in nats. The first three terms measure inaccuracy. The last term is the prior on ψ: it says that, before any evidence, a cell is in no particular place. It plays the part of the complexity term, the cost of holding a belief that departs from the prior. This is the Laplace form of free energy used for continuous states, with the constant terms left out because the precisions here are fixed settings.

4 · Perception and action descend the same quantity ψ˙i=−κψ∂Fi∂ψi,x˙i=−κa∂Fi∂xi,c˙i=−κa∂Fi∂ci ∂Fi∂ψik=−sk(qk−q¯)+πψψik,qk=πxXk*·εx+πcCk*·εc+πλΛk*·ελ Code: flow (the rates), step (Heun’s method at a fixed step). Here κψ = κa = 1 and q̄ = Σk sk qk.

Perception changes the belief so that predictions fit sensations better: the belief in place k grows when that place explains the errors better than the cell’s current average, q̄. Action changes the sensations so that they fit the predictions: the cell moves and secretes. A cell’s action reaches only its own position and its own secretion. It cannot make another cell’s signal. Each cell descends its own Fi; because the other cells are moving too, the total ΣFi usually falls but can rise for a moment when cells change their minds.

Reading

Where this comes from

Self-evidencing here means acting to garner sensory data consistent with (i.e., that affords evidence to) an internal model, hence maximizing model evidence.Parr, Pezzulo & Friston (2022), Active Inference, chapter 3, p. 47

What is established

Friston, Levin, Sengupta and Pezzulo (2015) wrote down this kind of model and simulated it. In their words, they “offer a proof of principle that self-assembly is an emergent property of cells that share a common (genetic and epigenetic) model of organismal form.” Their eight simulated cells sorted themselves into a simple head-to-tail body, and re-formed after the body was cut.

Kuchling, Friston, Georgiev and Levin (2020) extended the simulations to altered body axes and to a single cell with false beliefs. Pezzulo and Levin (2016) set out the wider case for describing pattern regulation by its target state. The idea that cells act on information about their position goes back to Wolpert (1969).

The free energy principle is a principle and a modelling framework. This page is an illustration of it. It is not evidence that plant or animal cells compute these quantities.

What this model leaves out

  • Real plant cells do not migrate. Plants take their form by oriented division and growth of walled cells. The plant shapes here are a picture of pattern regulation, in the spirit of the 2015 model, which was itself abstract.
  • The 2015 model has 8 cells and 4 signals used in combinations. This edition has 24 cells and gives each place its own signal with a long range. With only four signals shared by tissue, our reconstruction usually stalled in blended states, so that version is not shown.
  • Several details were reconstructed and not checked against the paper’s own code: the form of the signal kernel, the precisions, the integration scheme, and how far action takes account of the signal a cell senses. They are listed in the comments of the model code.
  • The model has no cell division during development, no mechanics, no cell contact, and no molecular pathway. Re-seeding after a cut adds naive cells at the wound by rule.
  • The form does not always come out right. In our tests of this model, without jostle, the form was completed from a single point in 59 of 60 runs, and after the upper half was cut away and re-seeded in 10 of 10 runs. With a shorter signal range (ℓ = 6) the second figure was 5 of 10. A run that fails ends in a wrong but stable form; the literature treats such outcomes as failures of pattern regulation.
  • On the stage the Brownian jostle adds a small, fluctuating amount to the position error. The tests are run without it.