Active Inference InstituteSimulations

Chapter 3AdvancedNew edition

Hierarchical Markov blankets

A Markov blanket is not a membrane you draw. It is a pattern of conditional independence that you can compute: once the blanket is known, the inside of a thing tells you nothing more about its outside. Below, 108 coupled units form 19 cells, four organs and one organism. Every boundary on the picture is found by calculation, and every one can be checked.

Slide from one cell, to its organ, to the whole organism.
An internal unit drives an outside unit directly, past the blanket.
Weaken it and the cell stops standing out from its surroundings.

AII: EduActive · Watch, then do

Three short clips, three things to try

These three passages come from an Institute study group, a recorded conversation and a lecture. Each is two to three minutes. Watch one, then press its button and look for the same thing in the tissue and the matrix above.

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

    Before you start

    No telekinesis, no telepathy

    Divide the world into a thing and what surrounds it. The inside and the outside never affect each other directly. Everything passes through a boundary called the blanket: the world reaches the thing only through its senses, and the thing reaches the world only through its actions.

    Listen for
    Internal and external states are not connected directly. So there’s no telekinesis and there’s no telepathy. There isn’t a direct connection except through the mediating blanket.
    Then try
    The button adds one wire from an internal unit straight to an outside unit, past the blanket. That is the kind of link the speaker rules out. Predict what happens to the independence number, then press.
    In the model the blanket condition

    The statement is the blanket condition: given the blanket b, internal states μ and external states η are independent. The page checks it in two ways, as a conditional mutual information I(μ; η | b) of zero and as an empty μ–η block in the precision matrix Π. The speaker’s two further rules, that the outside does not drive active states and the inside does not drive sensory states, are how roles are assigned in step 2 of the partition.

    The speaker is describing agents that perceive and act. Nothing on this page perceives or minimises free energy. It is a linear system of 108 coupled units at steady state, and it shows only the statistical separation. The fourth try-this step also shows that leaving out direct wires is not enough by itself to give that separation.

    The blanket condition · How the partition is found

    Further viewing: a blanket is a boundary in state space, not always one in space, 1:01 · how a thing is told apart from what is not the thing, 5:28 · boundaries at several scales, from countries down to organs, 43:23

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

    While it runs

    Blankets inside blankets

    Where does a thing stop? One answer is that it depends on how closely you look. Any part of the picture can be opened up, and inside it the same pattern appears again: an inside, an outside and a boundary between them. Which level you choose depends on what you want to explain.

    Listen for
    Each of those nodes in our Bayesian graph we can kind of double-click on and zoom in, and that itself is a thing that has internal, blanket, sensory.
    Then try
    The button zooms out from one cell to its organ and then to the whole organism. Predict whether the same three roles, internal, sensory and active, will be found at each scale.
    In the model the next scale

    On this page the move between scales is step 4 of the partition. Each thing is described by its blanket units alone, its internal units are eliminated, and the same procedure is run again on the things. That gives cells, then organs, then one organism.

    The speaker zooms in from a person to the parts; the page builds upwards from units. The speaker mentions the renormalisation group. In Friston (2019) that step keeps the slow modes of the blanket states. The page keeps the blanket units as they are, which is simpler and exact for a system this small. The speaker’s last point holds here too: the partition is not unique, and depends on a threshold that is a setting.

    How the partition is found

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

    Afterwards

    Colony, nestmate, cell

    An ant colony can be drawn in the same way. The colony is one thing, each nestmate inside it is a thing, and each nestmate is made of cells. The colony limits what its ants can do, and what the ants do changes the colony.

    Listen for
    This outer blue line, maybe the colony, and then each of these smaller entities is a nestmate, and they’re composed of cells, and cells have constituents too.
    Then try
    Here the smallest things are cells. Weaken the coupling inside one of them. Predict whether the calculation will still find it as a thing, then press and watch its units.
    In the model what is left out

    The page has three nested scales, and the same partition rule finds the things at each. A thing is found only while its units are strongly coupled to each other. The slider for coupling inside the chosen cell weakens that, the information the inside shares with its blanket, I(μ; b), falls, and below some strength the partition no longer finds the cell.

    The speaker’s picture is much richer than this one. It concerns organisms and populations over generations, with influence running both down from the colony and up from the nestmates. On this page nothing evolves, develops or infers. The structure was written into the couplings beforehand, and the calculation only recovers it.

    How the partition is found

The quoted lines are taken from the automatic captions, with punctuation added and hesitations removed. The speakers are talking about living systems and the textbook, 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

  1. Pick a cell and see its computed blanket.

    Predict: which units of this cell will the calculation place in the blanket, and which inside?

    Use Previous and Next, or click a cell. Blue units are internal, green sensory, gold active. Nothing was labelled by hand: the roles are read from which unit drives which. On the right, the same partition orders the rows of the precision matrix Π.

  2. Check the independence number.

    Predict: the exact value is zero. Will an estimate from a finite recording be zero too?

    Collect samples. The exact conditional mutual information is zero to sixteen decimal places. The estimate from data is not: it comes with an error bar, and the claim is that zero lies inside it. Conditional independence is a statistical statement.

  3. Add a bypass link and watch it rise.

    Predict: one extra wire from an internal unit to an outside unit. How much dependence will it create?

    The red arrow goes past the blanket. The block of Π that was empty fills in, and the independence number climbs by many orders of magnitude. The recomputed partition also changes: the unit that now drives the outside is no longer internal, and the cell at the receiving end can lose its interior altogether. Cut the link and the zero returns.

  4. Compare “sparse coupling only” with a true blanket.

    Predict: the wiring diagram stays exactly the same. Does the independence stay?

    In this second system not one coupling changes; only the noise amplitudes of the units differ. The partition read from the wiring is identical, yet a small dependence between inside and outside remains at every scale. Sparse coupling does not by itself give a blanket in Π (Aguilera et al. 2022).

  5. Zoom out through three scales.

    Predict: if only the blankets of cells are kept, will there still be blankets among them?

    At the organ scale the units are cells, each described by its blanket alone. Some cells turn out to be internal to the organ, one sensory, one active. At the organism scale the same thing happens again with organs. The drawing uses one language at every scale, and so does the matrix.

  6. Dissolve a cell, then let it recover.

    Predict: what is left of a blanket when there is nothing strongly coupled inside it?

    Weaken the coupling inside one cell. The information its interior shares with its blanket falls towards nothing. Somewhere between a third and an eighth of full strength, depending on the cell, the partition no longer finds it: its units scatter into fragments with no interior. Restore the coupling and the cell is found again.

The mathematics

What is being computed

The textbook introduces the idea in one sentence.

In brief, a Markov blanket is the set of variables that mediate all (statistical) interactions between a system and its environment.Parr, Pezzulo & Friston (2022), Active Inference, chapter 3, p. 43

And it gives the rule, due to Pearl (1988), for finding one when the dependencies are known.

The blanket for a given variable comprises its parents (the variables it depends on), its children (the variables that depend on it) and, in some settings, the other parents of its children.Parr, Pezzulo & Friston (2022), Active Inference, chapter 3, box 3.1, p. 43

Write μ for internal states, η for external states and b for blanket states. The blanket is made of sensory states s and active states a. The definition is a statement about probabilities.

Markov blanket (textbook box 3.1) p(μ,η|b)=p(μ|b)p(η|b)⟺Πμη=0(for a Gaussian)

The system here is the simplest one in which this can be checked exactly. Each of the 108 units has one number, xi. Units pull on each other through a coupling matrix J, and each is shaken by its own random noise of amplitude Γii. Left to run, the system settles into a steady state, a Gaussian with covariance Σ. That covariance is the solution of the Lyapunov equation, and its inverse Π is the precision matrix.

Process, steady state and precision (model: lyap, inv) x˙=−Jx+ω,JΣ+ΣJ⊤=2Γ,Π=Σ−1

Two numbers measure how well a blanket does its job. The first is the partial correlation between one internal unit i and one external unit j once the blanket is known. It uses the covariance that is left after the blanket has explained what it can.

Partial correlation given the blanket (model: condCov, partialCorr) ρij|b=Σij|bΣii|bΣjj|b,Σ·|b=Σxx−ΣxbΣbb−1Σbx

The second gathers every internal–external pair into one figure: the conditional mutual information, in nats. It is zero exactly when the blanket condition holds.

Conditional mutual information (model: cmi) I(μ;η|b)=12[ln|Σμ|b|+ln|Ση|b|−ln|Σμη|b|]

How can a system be built so that Π has the zero block and the couplings still run one way, from outside to sensory to internal to active and out again? The route is the decomposition of a steady-state flow into a dissipative part Γ and a solenoidal part Q, where Q is antisymmetric (textbook chapter 3; Friston 2019). Choose a sparse Π first, then a Q that cancels the unwanted couplings.

The tuned system (model: Builder.finish) J=(Γ−Q)Π,Q=−Q⊤⟹JΠ−1+Π−1J⊤=2Γ

The “sparse coupling only” system keeps this J entry for entry and gives the units unequal noise amplitudes, a setting drawn once between 0.41 and 2.46 times the tuned value. The Lyapunov equation then returns a different Σ, and nothing obliges its inverse to keep the zero block.

How the partition is found

  1. Which things there are. A coupling counts as strong if it is at least half as strong as the strongest coupling at both of its ends (the half is a setting). Units joined by strong couplings form one thing. Friston (2013, 2019) also uses the strength of coupling to decide which states belong together; his method is spectral, this one is simpler.
  2. Roles (Friston 2013). Within a thing, sensory units are those driven by something outside it. Active units are blanket units that are not driven from outside: they drive something outside, or drive a sensory unit. The rest are internal.
  3. Check (Pearl 1988). The parents, children and other parents of children of the internal units all lie within sensory plus active. The test file verifies this for every thing at every scale.
  4. Next scale (Palacios et al. 2020; Friston 2019). Each thing is now described by its blanket units alone. Its internal units are eliminated: Jeff=Jbb−JbμJμμ−1Jμb. Steps 1 to 3 are repeated on the things. The blanket units themselves are kept, not their principal eigenmodes as in Friston (2019), because the system is small and the statistics of the kept units are then exact.

Reading

Where this comes from

What is established

The Markov blanket is Pearl’s (1988) construct: the set of variables that screens a variable off from the rest of a network. For Gaussian variables, conditional independence given all the others is a zero in the precision matrix (Lauritzen 1996). Both are standard.

Friston (2013) proposed dividing the states of a self-organising system into internal, sensory, active and external, with the blanket read from the coupling between states. Kirchhoff et al. (2018) argued that living systems are nested: blankets of blankets, from cells to organisms. Palacios et al. (2020) simulated collections of cells that arrange themselves into such a hierarchy, and Friston (2019) gave a recursive scheme in which the blanket states at one scale become the states of things at the next.

The limits are also published. Aguilera et al. (2022) showed, in linear systems like this one, that sparse coupling does not in general give the conditional independence the blanket requires. Biehl et al. (2021) raised related technical objections. Bruineberg et al. (2022) distinguish Pearl’s blanket, a property of a model, from the stronger reading in which the blanket is a real boundary of a real thing.

What this model leaves out

  • It is linear, Gaussian and at steady state. Real cells are none of these. The exactness shown here is a property of this special case.
  • Nothing here minimises free energy and no unit has a generative model. The page shows the statistical separation that the free energy principle starts from, not the inference built on it.
  • The structure was planted. In Palacios et al. (2020) each cell is an active inference agent and the hierarchy emerges; here the couplings were written down so that it exists, and the algorithm’s task is to find it.
  • The tuned system is fine-tuned by construction. Whether real systems come close to such tuning is the open question that Aguilera et al. (2022) raise.
  • The partition is not unique. It depends on a strength threshold, and other choices of internal states give other valid blankets.
  • Coarse-graining keeps blanket units as they are. Friston (2019) keeps their slow eigenmodes, which also separates time scales. That is not done here.
  • The blankets are in the steady-state density. Independence of whole histories is a different and stronger condition.