Active Inference InstituteSimulations

Chapters 3, 4 and 8AdvancedNew edition

Predict, then test: the tree quiz

Twenty-four cells share one model of a plant and act until their sensations match it. Each question describes an experiment on them. Commit to a prediction; the page then runs that experiment, and the measured result decides which answer was right.

Dashed gold rings: the target form, 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.

Now

Measured on the stage

Total free energy F, in nats
–
of which sensory error
–
of which prior on ψ
–
Places filleda cell within 0.35 of the target
–
Mean certaintyeach cell’s largest s, averaged
–
Cells
–
Model time t
–

Learn by doing

Try this

There is no time limit, and every question can be tried again. A wrong prediction is useful: it shows where your picture of the model and the model itself differ.

  1. Watch a body build itself. The stage opens on 24 undecided cells sorting themselves into a sapling. Then answer the four questions of level 1, which are about the main idea: the form is a set of prior beliefs, and the cells act to make them true.Predict before you press: say your answer aloud, then commit.
  2. Break the signalling. Level 2 changes how much the cells trust what they sense, removes signals, and removes cells. Precision is the weight given to a prediction error. Read the measured numbers under each result; they are taken from the run you have just watched.Predict: when does a small free energy go with a bad form?
  3. Weigh complexity against accuracy. Level 3 asks what certainty costs, what happens when cells do not share a model, and what changes when every precision is scaled together. After each run the stage holds the final state: press Play to let it run on.Predict: which term of free energy is left when a body is at rest?

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. It is the cell with the largest free energy when an experiment ends.

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.