Active Inference InstituteSimulations

The ArcadeThree gamesPlay, or watch the agent

The Active Inference Arcade

A game is a small world. Part of it is hidden from you, there are things you want, and you have to choose before you know enough. That is exactly the situation active inference is about: an agent that holds beliefs about what it cannot see, prefers some outcomes to others, and acts on both.

Each game here can be played by you or by an active inference agent, on the same levels, with the agent's beliefs drawn on the screen as it plays.

Beliefs and curiosity

Forage

Look before you leap: beliefs about what you cannot see, and what looking is worth.

Play

Prediction

Rally

You hit the ball where you predict it will be.

Play

Planning

Hill

Sometimes the way to the goal starts by going away from it.

Play

The colour code

How to read the overlays

The three games share one screen language. The world itself is drawn in white. What the agent thinks and wants is drawn over it in colour, always with the same meaning.

The mathematics

One quantity behind all three

In each game the agent scores every plan it could follow by its expected free energy, and favours the plans that score lowest. A plan is written π, an outcome it expects to observe o, and a hidden state of the world s. Q is what the agent believes; C is what it prefers.

Expected free energy of a plan G(π)=−EQ[lnC(o)]⏟−pragmatic value−EQ(o∣π)DKL[Q(s∣o,π)‖Q(s∣π)]⏟epistemic value

The first part is small when a plan leads to what the agent wants. The second part is large when a plan is expected to teach the agent something. Wanting and finding out are two parts of one number, which is why the same agent both pursues goals and looks around. The line under the equation is computed from the Forage miniature at the top of this page; each game shows all of its terms live.

Reading

Where this comes from

What is established

Expected free energy and its split into pragmatic and epistemic value are set out by Friston and colleagues (2015) and in the textbook by Parr, Pezzulo and Friston (2022). Games have been used to study the framework since Friston, Daunizeau and Kiebel (2009) had an agent drive a car up a hill; Tschantz and colleagues (2020) and Fountas and colleagues (2020) built agents of this kind for control and game-like tasks. Kagan and colleagues (2022) connected living neurons in a dish to a simulated bat-and-ball game and reported that their play improved, an experiment they interpret with the free energy principle.

What these games leave out

The games are illustrations. They are small, the agents are given the rules of their worlds, and the preferences are set by hand. They show how the framework works on a problem you can see whole. They are not evidence that brains, animals or cells work this way. The three screens on this page are miniatures that play themselves; the full models, with their tests and their limits, are on each game's page.