Active inference [
1,
2,
3], under the Free Energy Principle [
4,
5,
6,
7,
8] has been proposed as a formal framework generally applicable for modeling living and adaptive systems, across spatial and temporal scales of description [
9]. From this perspective, perception, learning, action, and cognition in general can be described as approximate Bayesian inference driven by a single optimization process, contingent on a generative model of the environment. Crucially, a system can be considered to do active inference once it maintains a causal boundary - a Markov blanket. It has been suggested that collectives of agents individually performing active inference can maintain such a boundary, leading to a hierarchy of nested simultaneous processes of active inference [
10,
11]. This potential for nested applicability underwrites much of active inference’s ubiquity, and several simulation studies have investigated the emergent processes which ensue. Despite this, very few studies have been able analytically to relate the generative model of a group-level active inference process to the generative models of the individual agents [
12]. Here we propose a method for doing this, based on a kind of cognitive modelling inspired by computational psychiatry. In the following, we briefly introduce active inference and the Free Energy Principle, focusing on how it has been applied to multi-agent and multi-scale contexts. We then demonstrate our approach in a simple case, showing how emergent group-level active inference processes have non-trivial relations to their constituent parts. Finally, we discuss the applicability of this approach more broadly.
1.1. Active Inference and the Free Energy Principle
The Free Energy Principle [
4,
5,
6,
7,
8] is the claim that any system that maintains a stable boundary - formalized as a Markov blanket - can be described as minimizing the variational free energy of its sensory states. A Markov blanket is a set of states that renders states internal to it conditionally independent of external states. Blanket states are further divided into sensory states, which affect — but are not affected by — the internal states, and active states, which affect — but are not affected by — external states. The ensuing separation of internal and external states by blanket states (i.e., conditional independence) is statistical, and not necessarily also causal [
13]. In state space formulations, the Free Energy Principle has additionally rested on the assumption that the system is at a non-equilibrium steady state, which is unnecessary in path-integral formulations [
8,
14]. Maintaining a Markov blanket can be shown to imply a minimization of a negative log-probability (i.e., potential energy or self-information) - called the surprise
ℑ - of the sensory states, given a generative model, that is, one of how states in the environment generate those states. Surprise is not computable in most cases of interest but can be approximated by a variational free energy upper bound; minimization of surprise then becomes feasible by minimizing the variational free energy. Minimizing variational free energy is equivalent to performing variational (approximate) Bayesian inference, which enables a description of systems that maintain Markov blankets as engaging in active inference (viz., self evidencing).
Active inference is the Free Energy Principle applied to perception, learning, and action. Here, perception is viewed as variational inference on the state of the environment, given sensory states and a generative model, which can itself be updated by Bayesian parameter learning and Bayesian model selection (viz., structure learning). Here, inference corresponds to optimizing a posterior distribution (with an assumed functional form) that has the lowest associated variational free energy given the sensory inputs, which can be shown to be the variational posterior that best approximates the true Bayesian posterior given the constraints imposed on its functional form (e.g., Gaussianity). Actions (or often policies - sequences of actions, with some specified temporal depth) are then selected that minimize the expected free energy; namely, the expectation of the free energy under predicted sensory outcomes, given those actions. This affords a view of action selection as a type of (planning as) inference. Perception and action thus constitute the two possible ways of minimizing free energy: by changing one’s expectations, and by changing the world (and thereby the sensory observations). Active inference models come equipped with a preference prior - a prior expectation for the types of sensory states the agent is likely to encounter. The preference prior is usually immutable, which means that the only way to minimize free energy is to act such that the prior is most likely to be realized, and that it therefore encodes the preferred observations of the agent. Technically, these preferred states in general constitute the attracting states of the agent’s dynamics; namely, the kind of states that are characteristic of the agent at hand.
Active inference can be applied as a behavioural model irrespective of the Free Energy Principle. It has been applied in a variety of fields, either to understand or to build adaptive systems, including theoretical neurobiology and neuroscience [
15], cognitive science and computational psychiatry [
16,
17], robotics and machine learning [
18], and philosophy of mind [
19,
20], and it generalizes a variety of related approaches, like reinforcement learning, KL-control or expected utility maximization [
1,
21]. Whether active inference is used to model observed systems or build artificial ones, in order to apply it in any specific context, the first task is to specify a generative model, which provides the constraints that a resulting (active) inference process obeys (i.e., specifies the attracting set of states that characterize the agent). Many types of generative models are used in active inference, including continuous as well as discrete state-space models, and models made for specific contexts as well as more generally applicable models. Here, we speifically employ a widely used discrete state space model, the Partially Observable Markov Decision Process (POMDP) (see
Section 2.1 for a full description).
Active inference under the Free Energy Principle is sometimes presented as taking place in nested Markov blanket structures, where smaller agents compose larger-scale blankets that become agents in their own right [
10,
22]. These group-agents can then in turn be part of even larger-scale blanket structures - like cells forming organs, which in turn form human bodies and eventually human collectives. In this view, an obvious question to ask is how the active inference agents at higher levels relate to the activity and interactions of the smaller-scale agents that constitute them. We here demonstrate a method for investigating exactly this, based on cognitive modelling. In the following section, we preface the introduction of this method with an overview of the literature to date of active inference in multi-agents settings.
1.2. Multi-Agent and Collective Active Inference
Active Inference has since it’s inception been applied to “social” contexts; that is, contexts where multiple agents interact (e.g., [
23,
24]). Work on multi-agent active inference traditionally unfolds on one or more of three scales of description: a
within-agent scale, where the focus is to investigate what kinds of generative models are appropriate for interacting with environments containing other agents; a
between-agent scale, where the focus is to understand how interactions between multiple agents — ranging in number from dyads to whole populations — mutually shape their behavioural and belief dynamics over time; and a
group-as-agent scale, where a collective of agents forms an emergent group that possesses a Markov blanket of its own, and which therefore instantiates an active inference agent in its own right. Work has been done on all three scales, but we are not aware of any work that manages to reconstruct the generative model of an emergent group-level agent, or to compare it with the dynamics of its constituent agents at the two lower levels. In the following, we give a brief overview of the literature on multi-agent active inference across the three levels, and proceed to describe how the work presented here complements previous work with a method for accessing the generative models of group-level agents.
A number of theoretical points have been made regarding the types of generative models that must be held by social agents to function. It has been pointed out, for example, that the main statistical regularities in the environment - the parts that are most important to represent properly in a generative model - are social, specifically regarding other agents’ expectations for one’s own behaviour [
25,
26]. These expectations, which determine the most appropriate way to act in a given situation, can be inferred by attending to socially constructed cues (or “cultural affordances”) in the environment [
27] - cues that provide (and are created to provide) what has been called “deontic value” in being informative about obligatory social rules [
28].
It is possible to make inferences about the actions of others by selecting among explicit models of the mental processes underlying their behaviour [
29], and let it affect one’s behaviour in collaborative tasks [
30] - or even to use recursive Theory of Mind models where the level of recursion has to be explicitly limited [
31,
32]. This allows for explicit perspective-taking, and for interacting with agents different from oneself, but is a complex and computationally costly process that may often not be necessary for coordination. It is argued that humans have an evolved prior preferences for interacting with others whom they are mentally aligned with, that is, with whom they have similar expectations about the shared environment [
33] - “shared protentions” in Husserlian terminology [
34] - which facilitates communication and coordination in its own right. This is built on canonical simulation work showing that agents can, if they have similar generative models (also called a “shared narrative”), make inferences about each others’ mental states without needing to explicitly model the (infinitely recursive) mutual perspective-taking of the interaction [
24], and that these linked active inference agents reach a free energy minimum over time by aligning their generative models [
35]. The resulting generalized synchrony - if it is successfully instantiated, which is not always the case [
36] - allows agents to communicate their beliefs about the environment to each other [
37], and acquire a shared language that allows them to combine knowledge from complementary perspectives (a type of distributed intelligence called “federated inference”) to, for example, track a moving target (in order to hide from it) [
38]. This type of generalized synchrony of strategies and belief states can also underpin the coordination of goal-oriented joint action for dyads [
39] and teams of agents [
40], or be a mechanism determining behaviour in competitive games like the prisoner’s dilemma [
41]. On a multi-agent population level, the emergence of generalized synchrony - and the preference for being aligned with interlocutors - is observed in
in vivo neurons [
42,
43,
44], and can be a mechanism for implementing cumulative culture [
45,
46] which can also lead to separate echo-chamber-like epistemic communities that maintain highly precise and difficult-to-change beliefs [
47].
The work mentioned above provides important clues for how successful social interaction can be underpinned by active inference - for biological as well as artificial and mixed intelligence systems [
48]. It does not, however, engage directly with the proposed multi-scale nature of active inference, because it remains at a within- and between-agent level of description. There is also a strand of work regarding how a collective of (potentially active inference) agents can form an emergent whole with a Markov blanket of its own - which then, of course, can be considered an active inference agent in its own right. The canonical work here is a ’primordial soup’ simulation, where it is shown that a system maintaining a Markov blanket leads to the system’s internal states carrying information about external states as they come to minimize a variational free energy functional of the blanket states, and therefore model the environment [
23]. One way to establish this type of boundary (as in the case of organic morphogenesis) is for the members of the collective to be equipped with a prior expectation of being part of such a structure [
49], with cells creating and maintaining the larger structure (as well as differentiating into different roles, or cell types) in the process of reducing free energy [
50]. These types of maintained Markov blanket structures can be nested within each other [
22], in ways that are found in the brain [
51], and which can be related to mental phenomena like the psychopathology of the emergent human mind [
52]. There is also work on emergent Markov blankets not related to the brain, and which does not rely on having explicit prior expectations for being in a specific larger structure. Joint free energy minimization can be a mechanism for ant-like agents collectively solving a T-maze [
53], or for the self-organization of collective motion, whereby single particles can collectively synchronize their movements by only maintaining a goal prior over simple metrics like relative distance to neighbours [
54]. Dyads of agents moving to target locations are designed to form collectives that could be considered to perform Bayesian inference, relative to certain sensory states [
55], and certain parameter regimes of spin-glass systems can be analytically related to a collective of active inference agents, whose joint actions implement Bayesian inference at a higher level (namely, via a form of sampling-based inference) [
12].
The above work engages with how collectives of agents can come to form larger-scale Markov blanket structures, how they come to solve tasks as a group, and how to relate the dynamics of the agents — forming the internal states of the collective — to Bayesian inference happening at the collective level, all implying that there is an active inference process instantiated at the collective or group level. Despite this, previous studies never explicitly model the inversion of the emergent group’s generative model and corresponding action selection, and therefore never consider generative models at multiple levels simultaneously. That is, they largely address inference at within- and between-agent levels, only hinting at group-level active inference proper. The main exception here is the spin glass simulation work by Heins and colleagues [
12], where a group-level generative model is analytically related to the activity of constituent agents, although in a way limited to a relatively specific context, and without direct relation to an environment. Fully engaging with a multi-scale active inference account — and the particularly interesting question how the dynamics of the constituent agents relate to the group-level active inference process (for example in the case of psychopathology [
52]) — should entail relating the generative models at the different levels to each other (since they define the active inference process), and to the environment.
There are various reasons why this has not been addressed. Firstly, there is not always a well-defined environment to act on and be influenced by
per se (as with the vacuous environment of self-organizing cells [
49] and cooperating dyads [
55]), or there might not be easily differentiated internal and blanket states (as with the collaborative ants [
53], emergent fish school [
54] or jointly vigilant girls hiding from their mother [
38]) to implement the inference. A more important reason, however, is probably the fact that the generative model of the group-level agent is difficult to access. As opposed to the generative models of the constituent agents, which are specified by the modellers and therefore known, the generative model of the group is emergent and
a priori unknown. This means it has to be reconstructed in order to be compared to the constituent agents, which is not a trivial task. There do, however, exist some standard methods for attempting to reconstruct unknown generative models of systems. One such approach comes from cognitive modelling, a field where the primary task is to infer on the unknown generative models underlying observable behaviour, often of human subjects. From the perspective of active inference, observable behaviour is simply the blanket states of the system. This fits well with cognitive and behavioural modelling, where a Markov blanket-like structure is usually assumed. Here, we use this approach to make inferences about the generative model of a group-level agent. This group-level agent comprises a set of agents set in a Markov blanket structure (we here do not engage with
how the agents come to be structured in a Markov blanket. Instead, for simplicity, we assume that this process has taken place) and with a simple internal structure and external environment. This lets us use the same generative model structure for the individual agents and the group-level agent. After confirming that the proposed method works for this specific simulation, we go on to make preliminary investigations of the relations between group- and individual-level generative models. The approach we present here should be applicable in many contexts, including when boundaries are dynamically established, or when internal structures and external environments are more complex.