Entropy 2025, 27, 62 4 of 33
Core Concepts
AIF Active inference is a formal framework for modelling behaviour and cog-
nition. Perception and action are cast as minimising free energy—the VFE
and EFE, respectively—given a generative model of the environment.
VFE The variational free energy F quantifies how well a generative model
explains incoming sensory observations. It can be rewritten as the negative
log model evidence (called surprise) upper-bounded by the divergence
from the optimal posterior p(s|o). Perception as inference is accomplished
by selecting the approximate posterior q(s) with the lowest associated
VFE.
F[q(s), o] ≜ DKL[q(s)∥p(o, s)] =DKL[q(s)∥p(s|o)]| {z }
Divergence
−ln p(o)| {z }
Surprise
EFE The expected free energy G quantifies the expected future free energy
under an action policy π. It consists of an information gain term and a
pragmatic value term that provide a natural balance between exploratory
and goal-seeking behaviour. Action as inference is accomplished by select-
ing the action policy with the lowest associated EFE.
Gπ = −Eq(˜o,˜s|π)[ln q(˜s|˜o, π) − ln q(˜s|π)]
| {z }
Information gain
−Eq(˜o|π)[ln p(˜o|C)]
| {z }
Pragmatic value
Generative
model
The generative model is an agent’s formal assumptions about the structure
and dynamics of its environment, based on which perceptual and active
inferences are carried out. Many types of generative models exist that are
suitable for different environments and tasks.
POMDP The Partially Observable Markov Decision Process is a type of flexible
generative model that is widely used in the AIF literature. In discrete time
and usually a discrete state space, this model type is parametrised to fit a
given task by a set matrices containing probability distributions.
2. Active Inference with POMDPs
In this section, we briefly describe the core concepts of AIF and POMDPs. This
should familiarise the reader with the vernacular used in the later sections regarding
the functionalities of the package. While various extensions, such as structure learning,
which enables an agent to learn the structure or shape of its environment through model
comparison [44–47], or hierarchical and temporally deep POMDPs [48,49], are relevant for
future work, describing these in detail is beyond the scope of this foundational paper.
At the core of AIF lies the minimisation of a variational free energy upper bound on
surprise for perception, as well as action. This is motivated by the free energy principle[4–8],
which states that self-organising systems can be described as minimising the variational
free energy of their sensory states. The minimisation of free energy generally takes two