Hands-on demonstrations of the Free Energy Principle and Active Inference, built as companions to the foundational textbook. Learn by doing, adjust parameters, watch systems adapt, and build intuition for how adaptive behaviour emerges from first principles.
Foundation Text
The definitive guide to the Free Energy Principle and Active Inference framework. These simulations follow the textbook's progression, from the thermodynamic foundations of self-organisation through generative models, belief updating, and policy selection in partially observable environments.
View at MIT PressLearn by Doing
Each simulation pairs interactive demonstrations with direct quotations from the textbook, step-by-step tutorials, and comprehensive glossaries of key concepts.

Watch particles self-organise from chaos into a living system. Toggle between entropy-maximising dissipation and free-energy-minimising life to see the fundamental difference the FEP describes. Includes a faithful recreation of Figure 3.3, a comprehensive glossary, real-time variational free energy computation, and commentary from Virtual Karl Friston.

A step-by-step tutorial demonstrating how the brain resolves ambiguous sensory data through Bayesian inference. Adjust prior beliefs and likelihoods to see how perception emerges from the interplay between expectation and observation: two hypotheses, one ambiguous stimulus, and the mathematics of how we decide what we see.

You control the environment; the fish minimises surprise. Drop food, introduce predators, and reshape the world to see prediction confidence, prediction error, and belief updating unfold in real time. The only Active Inference demo where the learner has agency over the agent's world rather than its parameters. With commentary from Virtual Karl Friston.

Every fish minimises its own free energy, yet the school self-organises into a higher-order agent with its own Markov blanket. Split schools to create two autonomous group-level agents, merge them back, and introduce predators to watch collective coherence rupture and reform. Narrated by Daniel Friedman with commentary grounded in precision-weighted coupling and generalised synchrony.

An eight-step guided tutorial that walks through the entire Active Inference cycle. Starting from a fish's generative model and its beliefs about the world, you progress through prediction error, variational free energy, prior preferences, policy evaluation, counterfactual reasoning, and expected free energy, building up the full framework one concept at a time.

A tree that grows by minimising free energy. Each branch tip maintains a generative model, resolving prediction error through perception (updating beliefs about light) or action (growing toward it). Adjust precision and prior preferences to explore the explore–exploit trade-off. Demonstrates that Active Inference is a principle of self-organisation, not only a theory of cognition.

An ant colony where each ant minimises expected free energy through stigmergic foraging. Pheromone trails form a shared generative model externalised into the environment — niche construction in action. Soldiers and foragers demonstrate that the same algorithm produces different behaviour when prior preferences change. Features a live nest interior webcam, sensory field heatmaps, collaboration networks showing generalised synchrony, and narration by Daniel Friedman. Inspired by Friedman, Tschantz, Ramstead, Friston & Constant (2021).

Scale a complete graph from one agent to 150 and watch Markov blankets proliferate quadratically. Each agent accumulates evidence toward belief updates; each edge is a statistical boundary mediating prediction errors between them. As the network grows, collective autonomy overtakes individual autonomy, blanket-mediated coupling drives synchronisation cascades, and Dunbar’s number emerges as the point where agents can no longer sustain meaningful individuality within the ensemble.

The canonical Active Inference demonstration. Watch an agent navigate a T-maze by evaluating policies through Expected Free Energy, balancing the epistemic value of information-seeking against the pragmatic value of reward. Adjust precision and epistemic weighting in real time to see how planning under uncertainty unfolds in a partially observable environment.

Visualise how Markov blankets nest within one another, from cells to organs to organisms. This simulation demonstrates the recursive structure of self-organisation, where each level maintains its own statistical boundary while participating in the dynamics of the whole.

Zoom into a single harvester ant’s brain and watch its behaviour change as you adjust four neurotransmitter channels. Dopamine, serotonin, octopamine, and tyramine each implement a distinct precision channel — policy confidence, homeostatic caution, motor readiness, and baseline gain. Recreates the key finding from Friedman et al. (2018) iScience (DOI: 10.1016/j.isci.2018.09.001): pharmacological dopamine boosts increase foraging activity, with low-DA colonies responding more strongly — exactly as precision-weighting predicts. Features a live neural network inset and narration by Daniel Friedman.

An interactive quiz about how branching growth expresses precision, prior preferences, hierarchical inference, and bounded rationality. Tune the tree’s model of light and moisture, then check how your choices alter the generative model across branches and roots.
Open Science
These simulations are open-source educational tools developed for the Active Inference Institute. We welcome contributions, corrections, and ideas for new demonstrations.