Active inference — observe → infer → plan → act
A 2-state, 2-obs, 2-action agent runs the canonical FEP loop: observe the environment, update its posterior over hidden states by minimising variational free energy (VFE), score each candidate policy by expected free energy (EFE), pick the lower-EFE action, transition. The blue posterior bars are the agent's current belief; the green EFE bar is the chosen policy; "swap" beats "stay" when the agent learns it's in state 0 and prefers state 1's observation. Every step is a closed-form categorical update — no model fires.
About this exhibit
The Free Energy Principle (Friston, 2010) frames perception and action as a single closed-loop optimisation: minimise variational free energy on incoming observations to maintain an accurate posterior over hidden states, and pick actions that minimise the expected free energy of future trajectories. The substrate ships the discrete-time variant (per arXiv 2410.00240) as a deterministic, categorical, closed-form primitive — no autograd, no RNG, no model weights.
The two energies you see on the page:
- Variational free energy (VFE) — the surprise the agent reports on each observation given its prior belief. Higher when the prior was confident and wrong; lower when the prior matched.
- Expected free energy (EFE) — the score of each candidate policy. Sums ambiguity (entropy of predicted observations) and pragmatic value (alignment with the preferred observation distribution). Lower is better.
Both are reported in nats. The receipt's joule cost is the substrate envelope over the underlying ~10² FMAs per step; scales as O(n_states · n_actions^horizon).