Active Inference InstituteSimulations

Beyond the textbookIntermediateNew edition

The eye asks questions

Only the centre of the retina sees detail, so every eye movement is a small experiment: the eye goes where the brain expects to learn most. Watch this eye work out a scene in two or three glimpses, then try it yourself.

Question
Agent
1 is a typical human retina (E₂ = 2°). 0 is a retina that sees equally well everywhere.
The chance that the fovea names an object correctly, a₀. A setting.
Sets the pupil. It does not enter the inference.
Colour only: less pigment looks blue, more looks brown. Not part of the model.

AII: EduActive · Watch, then do

Two short clips, two things to try

These two passages come from the Institute’s livestreams and interviews. Neither is about this page, but each describes what the eye above is doing. Each is two to three minutes. Watch one, then press its button and look for the same thing on the stage.

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

    Before you start

    Scanning as foraging

    An animal searching for food moves its body to where food is likely to be. An eye searching a picture does much the same, except that what it gathers is information. Looking costs little and leaves the picture unchanged, so the eye can scan, go back and scan again.

    Listen for
    Foraging is kind of this concept that links all these different pieces, from an animal physically moving on a landscape, to our sensory modalities, like vision scanning a landscape, to informational landscapes.
    Then try
    Think of the blue discs as the food. Each one shows how much the eye expects to learn by looking there. Predict which quadrant the eye will visit first, and what happens to a disc once its quadrant has been seen.
    In the model equation 3

    What the eye forages for here is epistemic value: the mutual information between the view a saccade would deliver and the scene that is out there. It is one of the two terms of the expected free energy G, and the blue discs draw it for each quadrant. A quadrant that is already known is worth nothing, so the eye does not go back to it.

    The speaker is describing a different study, in which an eye scans patterns on pottery, and is comparing it with ants that forage on foot. The task on this page is the scene-construction task of Mirza et al. (2016): four quadrants, twelve possible scenes and a report at the end. The two share the main point. Looking does not change the scene, so nothing here corresponds to an ant’s pheromone trail.

    Equation 3, epistemic value · Equation 2, expected free energy

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

    While it runs

    Until the scene snaps into place

    You never take in a whole scene at once. You collect a few small samples, one glimpse at a time, and each one shifts your belief about what you are looking at. At some point one explanation fits all the samples together, and the scene seems to snap into place.

    Listen for
    I have a bunch of sparsely sampled data points, and then, given that sequence of data points, like little sensory samples, I suddenly kind of infer something that’s explaining all of them at once.
    Then try
    Now you do the sampling. Guess how many glimpses you will need before you are sure. Look at one quadrant at a time and watch the belief bars beside the stage. Notice the glimpse at which one bar takes over.
    In the model equation 1

    The “latent explanation” is the hidden state s: which of twelve scenes is out there. Each glimpse is an outcome o, and the belief Q(s) is updated by Bayes’ rule after every one. The bars show that belief, and the readout H[Q(s)] is the uncertainty left in it. When you look for yourself, the bars show what an ideal observer of your glimpses would believe.

    The speaker’s examples are reading a sentence and looking at an abstract painting, and the snap is described as it feels to a person. On this page the snap is only arithmetic: the glimpses so far leave one scene far more probable than the rest, and the entropy falls towards zero. The model uses the exact posterior, and it has no account of how recognition feels.

    Equation 1, perception

The quoted lines are taken from the automatic captions, with punctuation added and hesitations removed. The speakers are describing other studies and other examples, 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. Predict the next glimpse. The scene holds a bird and either a cat or some seeds. The eye must decide: flee, feed or wait. Before each saccade, say which quadrant it will go to and why. Then watch. After an empty quadrant, notice where it does not bother to look.
  2. Turn on the information map. Each blue disc is the expected information gain of fixating that quadrant, in nats. Predict what happens to the discs after the next glimpse. The eye always goes to the largest one, and the discs shrink to nothing once the scene is known.
  3. Look for yourself. Now you see what one fixation delivers. Move the pointer, tap a quadrant, or use the Look buttons. Report as soon as you are sure. Guess how many glimpses you will need, then compare your count with the agent's on the same scene.
  4. Remove the epistemic term. Predict what an agent does when information has no value to it. It does not guess early here, because being wrong is costly. Instead every saccade is worth the same to it, so it wanders, and sometimes runs out of moves. Run 200 scenes and compare the rows.
  5. Flatten the acuity. Give the retina the same resolution everywhere. Predict how many saccades the agent will make. With nothing to gain from moving, the map empties and the eye reports at once. Then slide the fall-off back and watch the saccades return.
  6. Change the question. Ask “Is there a cat?” of the same kind of scene. Predict whether the scan path gets shorter or longer. What counts as knowing enough has changed, so on some scenes the eye stops a little sooner. Run 200 scenes under each question to compare. Yarbus saw the same dependence on the question in people looking at a painting.

The mathematics

What is being computed

The agent has a generative model: a description of how its sensations are caused. The hidden state s is which of twelve scenes is out there, together with where the eye is. An outcome o is what one fixation delivers: a view of each quadrant, reliable at the fovea and poor elsewhere. A move u is a saccade to a quadrant or to a report location. All logarithms are natural, so information is in nats.

1 · Perception: updating beliefs after a glimpse F=DKL[Q(s)‖P(s)]−EQ[lnP(o|s)]≥−lnP(o)

The variational free energy F of a belief Q(s) is complexity (how far the belief has moved from the prior P(s)) minus accuracy (how well it explains the glimpse). It can never be less than the surprise, −ln P(o). This model is small enough to use the exact posterior, where the two are equal. Code: observe, using AIF.bayes and AIF.vfe.

2 · Choosing where to look: expected free energy of a move G(u)=DKL[Q(o|u)‖P(o)]⏟risk+EQ(s|u)[H[P(o|s)]]⏟ambiguity=−epistemic value−pragmatic value

G is a cost: the move with the lowest G is taken. P(o) holds the agent's preferences, C: ln P(o) is c for the feedback “right”, −2c for “wrong” and 0 for any view of the scene, less a constant ln Z that makes the probabilities sum to one. Here c = 2, as in the published model. Pragmatic value is the expected log preference. The table beside the stage adds ln Z back so that a look reads as 0. Code: evaluate, checked against AIF.efe.

3 · Epistemic value: the information a glimpse is expected to bring EQ(o|u)[DKL[Q(s|o,u)‖Q(s|u)]]=H[Q(o|u)]−EQ(s|u)[H[P(o|s)]]

This is the mutual information between what the eye would see and what is out there: how uncertain the agent is about the view, less the part of that uncertainty which no state of the world would explain. It is what the blue discs show. A quadrant whose contents are already known, or which could only be seen badly, is worth nothing. Code: the epistemic term of evaluate; mutualInformation recomputes it by brute force.

4 · Why looking helps: acuity falls with eccentricity MAR(E)=MAR0(1+EE2),a(E)=14+(a0−14)·min(1,δMAR(E))β

The minimum angle of resolution, MAR, is the finest detail the eye can resolve at eccentricity E, the angle away from the point of fixation. It grows roughly in a straight line, doubling at E₂. The values MAR₀ = 1 minute of arc and E₂ = 2° are typical, not measured from anyone. The second formula is this page's own, illustrative link between the two models: an object whose telling detail is δ = 1 minute of arc is named correctly with probability a(E), which falls to chance (one in four) in the periphery; β = 2. In active inference terms the precision of the “what” likelihood A falls with eccentricity. The blur on the scene is drawn from the same MAR(E), starting at the edge of a sharp window: the objects are drawn larger than life so that they can be seen, and the window is enlarged with them. Code: mar, reliability, blurLevel.

5 · The drawing: saccade duration and pupil size D=D0+kA,vpeak=1.875AD,d=4.9−3tanh(0.4log10L)

A saccade of amplitude A degrees lasts about D₀ + kA, with typical values D₀ = 21 ms and k = 2.2 ms per degree: larger saccades take longer and are faster, the “main sequence”. The eye here follows a smooth minimum-jerk path, an illustrative choice whose peak velocity is 1.875 A/D. Pupil diameter d in millimetres follows Moon and Spencer's formula for luminance L in candelas per square metre. Neither formula enters the inference. Code: saccade, saccadePos, pupil.

Reading

Where this comes from

We would gain nothing by performing an experiment if we already knew what the results would be with a high degree of confidence.Parr, Pezzulo & Friston (2022), Active Inference, chapter 7, p. 137, on choosing saccades

What is established

Cone density, and with it acuity, falls steeply away from the centre of the fovea (Curcio et al. 1990). The minimum angle of resolution grows roughly linearly with eccentricity (Levi et al. 1985; Strasburger et al. 2011). People therefore move their eyes several times a second, and where they look depends on what they have been asked (Yarbus 1967). Saccade duration and peak velocity rise lawfully with amplitude (Bahill et al. 1975).

The idea that saccades are experiments, chosen to resolve uncertainty about the causes of sensation, was put by Friston et al. (2012). The task on this page is the scene-construction task of Mirza et al. (2016), in which an agent that minimises expected free energy looks at informative quadrants first and reports when it is sure. Parr and Friston (2017, 2018) and Parr et al. (2021) develop the same account for visual search, the anatomy of eye movement and richer scenes.

These are modelling results. The free energy principle is a framework for building such models. This page illustrates it and is not evidence for it.

What this model leaves out

Mirza et al. use a factorised (mean-field) posterior, simulate the neuronal dynamics of belief updating, sample moves from a distribution with precision γ, and let the agent carry on after a wrong report. Here beliefs are exact, the move with the lowest G is always taken, and a trial ends at the first report or after eight moves. The base arrangement of the three scenes is reconstructed from the paper's text.

In the paper nothing is seen away from the fovea. This page adds weak peripheral views so that the acuity curve can be linked to the inference. That link, a(E), is illustrative. Real peripheral vision is limited by crowding and attention as well as by acuity, and none of that is modelled.

The agent plans one move ahead. The question changes when it stops, and so which parts are fixated, but not which glimpse is most informative about the whole scene. Deeper planning would be needed for the question to redirect the first saccade, as it does in people. The objects are drawn larger than life, with the sharp window and the blur scaled to match. Vergence, pursuit, microsaccades, blinks and the pupil's dynamics are not modelled, and the eye is slowed so that its movements can be seen.