Main

Despite the wealth of empirical data in neuroscience, there are relatively few global theories about how the brain works. A recently proposed free-energy principle for adaptive systems tries to provide a unified account of action, perception and learning. Although this principle has been portrayed as a unified brain theory1, its capacity to unify different perspectives on brain function has yet to be established. This Review attempts to place some key theories within the free-energy framework, in the hope of identifying common themes. I first review the free-energy principle and then deconstruct several global brain theories to show how they all speak to the same underlying idea.

The free-energy principle

The free-energy principle (Box 1) says that any self-organizing system that is at equilibrium with its environment must minimize its free energy2. The principle is essentially a mathematical formulation of how adaptive systems (that is, biological agents, like animals or brains) resist a natural tendency to disorder3,4,5,6. What follows is a non-mathematical treatment of the motivation and implications of the principle. We will see that although the motivation is quite straightforward, the implications are complicated and diverse. This diversity allows the principle to account for many aspects of brain structure and function and lends it the potential to unify different perspectives on how the brain works. In subsequent sections, I discuss how the principle can be applied to neuronal systems as viewed from these perspectives. This Review starts in a rather abstract and technical way but then tries to unpack the basic idea in more familiar terms.

Motivation: resisting a tendency to disorder. The defining characteristic of biological systems is that they maintain their states and form in the face of a constantly changing environment3,4,5,6. From the point of view of the brain, the environment includes both the external and the internal milieu. This maintenance of order is seen at many levels and distinguishes biological from other self-organizing systems; indeed, the physiology of biological systems can be reduced almost entirely to their homeostasis7. More precisely, the repertoire of physiological and sensory states in which an organism can be is limited, and these states define the organism's phenotype. Mathematically, this means that the probability of these (interoceptive and exteroceptive) sensory states must have low entropy; in other words, there is a high probability that a system will be in any of a small number of states, and a low probability that it will be in the remaining states. Entropy is also the average self information or 'surprise'8 (more formally, it is the negative log-probability of an outcome). Here, 'a fish out of water' would be in a surprising state (both emotionally and mathematically). A fish that frequently forsook water would have high entropy. Note that both surprise and entropy depend on the agent: what is surprising for one agent (for example, being out of water) may not be surprising for another. Biological agents must therefore minimize the long-term average of surprise to ensure that their sensory entropy remains low. In other words, biological systems somehow manage to violate the fluctuation theorem, which generalizes the second law of thermodynamics9.

In short, the long-term (distal) imperative — of maintaining states within physiological bounds — translates into a short-term (proximal) avoidance of surprise. Surprise here relates not just to the current state, which cannot be changed, but also to movement from one state to another, which can change. This motion can be complicated and itinerant (wandering) provided that it revisits a small set of states, called a global random attractor10, that are compatible with survival (for example, driving a car within a small margin of error). It is this motion that the free-energy principle optimizes.

So far, all we have said is that biological agents must avoid surprises to ensure that their states remain within physiological bounds (see Supplementary information S1 (box) for a more formal argument). But how do they do this? A system cannot know whether its sensations are surprising and could not avoid them even if it did know. This is where free energy comes in: free energy is an upper bound on surprise, which means that if agents minimize free energy, they implicitly minimize surprise. Crucially, free energy can be evaluated because it is a function of two things to which the agent has access: its sensory states and a recognition density that is encoded by its internal states (for example, neuronal activity and connection strengths). The recognition density is a probabilistic representation of what caused a particular sensation.

This (variational) free-energy construct was introduced into statistical physics to convert difficult probability-density integration problems into easier optimization problems11. It is an information theoretic quantity (like surprise), as opposed to a thermodynamic quantity. Variational free energy has been exploited in machine learning and statistics to solve many inference and learning problems12,13,14. In this setting, surprise is called the (negative) model evidence. This means that minimizing surprise is the same as maximizing the sensory evidence for an agent's existence, if we regard the agent as a model of its world. In the present context, free energy provides the answer to a fundamental question: how do self-organizing adaptive systems avoid surprising states? They can do this by minimizing their free energy. So what does this involve?

Implications: action and perception. Agents can suppress free energy by changing the two things it depends on: they can change sensory input by acting on the world or they can change their recognition density by changing their internal states. This distinction maps nicely onto action and perception (Box 1). One can see what this means in more detail by considering three mathematically equivalent formulations of free energy (see Supplementary information S2 (box) for a mathematical treatment).

The first formulation expresses free energy as energy minus entropy. This formulation is important for three reasons. First, it connects the concept of free energy as used in information theory with concepts used in statistical thermodynamics. Second, it shows that the free energy can be evaluated by an agent because the energy is the surprise about the joint occurrence of sensations and their perceived causes, whereas the entropy is simply that of the agent's own recognition density. Third, it shows that free energy rests on a generative model of the world, which is expressed in terms of the probability of a sensation and its causes occurring together. This means that an agent must have an implicit generative model of how causes conspire to produce sensory data. It is this model that defines both the nature of the agent and the quality of the free-energy bound on surprise.

The second formulation expresses free energy as surprise plus a divergence term. The (perceptual) divergence is just the difference between the recognition density and the conditional density (or posterior density) of the causes of a sensation, given the sensory signals. This conditional density represents the best possible guess about the true causes. The difference between the two densities is always non-negative and free energy is therefore an upper bound on surprise. Thus, minimizing free energy by changing the recognition density (without changing sensory data) reduces the perceptual divergence, so that the recognition density becomes the conditional density and the free energy becomes surprise.

The third formulation expresses free energy as complexity minus accuracy, using terms from the model comparison literature. Complexity is the difference between the recognition density and the prior density on causes; it is also known as Bayesian surprise15 and is the difference between the prior density — which encodes beliefs about the state of the world before sensory data are assimilated — and posterior beliefs, which are encoded by the recognition density. Accuracy is simply the surprise about sensations that are expected under the recognition density. This formulation shows that minimizing free energy by changing sensory data (without changing the recognition density) must increase the accuracy of an agent's predictions. In short, the agent will selectively sample the sensory inputs that it expects. This is known as active inference16. An intuitive example of this process (when it is raised into consciousness) would be feeling our way in darkness: we anticipate what we might touch next and then try to confirm those expectations.

In summary, the free energy rests on a model of how sensory data are generated and on a recognition density on the model's parameters (that is, sensory causes). Free energy can be reduced only by changing the recognition density to change conditional expectations about what is sampled or by changing sensory samples (that is, sensory input) so that they conform to expectations. In what follows, I consider these implications in light of some key theories about the brain.

The Bayesian brain hypothesis

The Bayesian brain hypothesis17 uses Bayesian probability theory to formulate perception as a constructive process based on internal or generative models. The underlying idea is that the brain has a model of the world18,19,20,21,22 that it tries to optimize using sensory inputs23,24,25,26,27,28. This idea is related to analysis by synthesis20 and epistemological automata19. In this view, the brain is an inference machine that actively predicts and explains its sensations18,22,25. Central to this hypothesis is a probabilistic model that can generate predictions, against which sensory samples are tested to update beliefs about their causes. This generative model is decomposed into a likelihood (the probability of sensory data, given their causes) and a prior (the a priori probability of those causes). Perception then becomes the process of inverting the likelihood model (mapping from causes to sensations) to access the posterior probability of the causes, given sensory data (mapping from sensations to causes). This inversion is the same as minimizing the difference between the recognition and posterior densities to suppress free energy. Indeed, the free-energy formulation was developed to finesse the difficult problem of exact inference by converting it into an easier optimization problem11,12,13,14. This has furnished some powerful approximation techniques for model identification and comparison (for example, variational Bayes or ensemble learning29). There are many interesting issues that attend the Bayesian brain hypothesis, which can be illuminated by the free-energy principle; we will focus on two.

The first is the form of the generative model and how it manifests in the brain. One criticism of Bayesian treatments is that they ignore the question of how prior beliefs, which are necessary for inference, are formed27. However, this criticism dissolves with hierarchical generative models, in which the priors themselves are optimized26,28. In hierarchical models, causes in one level generate subordinate causes in a lower level; sensory data per se are generated at the lowest level (Box 2). Minimizing the free energy effectively optimizes empirical priors (that is, the probability of causes at one level, given those in the level above). Crucially, because empirical priors are linked hierarchically, they are informed by sensory data, enabling the brain to optimize its prior expectations online. This optimization makes every level in the hierarchy accountable to the others, furnishing an internally consistent representation of sensory causes at multiple levels of description. Not only do hierarchical models have a key role in statistics (for example, random effects and parametric empirical Bayes models30,31), they may also be used by the brain, given the hierarchical arrangement of cortical sensory areas32,33,34.

The second issue is the form of the recognition density that is encoded by physical attributes of the brain, such as synaptic activity, efficacy and gain. In general, any density is encoded by its sufficient statistics (for example, the mean and variance of a Gaussian form). The way the brain encodes these statistics places important constraints on the sorts of schemes that underlie recognition: they range from free-form schemes (for example, particle filtering26 and probabilistic population codes35,36,37,38), which use a vast number of sufficient statistics, to simpler forms, which make stronger assumptions about the shape of the recognition density, so that it can be encoded with a small number of sufficient statistics. The simplest assumed form is Gaussian, which requires only the conditional mean or expectation — this is known as the Laplace assumption39, under which the free energy is just the difference between the model's predictions and the sensations or representations that are predicted. Minimizing free energy then corresponds to explaining away prediction errors. This is known as predictive coding and has become a popular framework for understanding neuronal message passing among different levels of cortical hierarchies40. In this scheme, prediction error units compare conditional expectations with top-down predictions to elaborate a prediction error. This prediction error is passed forward to drive the units in the level above that encode conditional expectations which optimize top-down predictions to explain away (reduce) prediction error in the level below. Here, explaining away just means countering excitatory bottom-up inputs to a prediction error neuron with inhibitory synaptic inputs that are driven by top-down predictions (see Box 2 and Refs 41, 42 for detailed discussion). The reciprocal exchange of bottom-up prediction errors and top-down predictions proceeds until prediction error is minimized at all levels and conditional expectations are optimized. This scheme has been invoked to explain many features of early visual responses40,43 and provides a plausible account of repetition suppression and mismatch responses in electrophysiology44. Figure 1 provides an example of perceptual categorization that uses this scheme.

Figure 1: Birdsongs and perceptual categorization.
figure 1

a | The generative model of birdsong used in this simulation comprises a Lorenz attractor with two control parameters (or causal states) (v1,v2), which, in turn, delivers two control parameters (not shown) to a synthetic syrinx to produce 'chirps' that were modulated in amplitude and frequency (an example is shown as a sonogram). The chirps were then presented as a stimulus to a synthetic bird to see whether it could infer the underlying causal states and thereby categorize the song. This entails minimizing free energy by changing the internal representation (μv1v2) of the control parameters. Examples of this perceptual inference or categorization are shown below. b | Three simulated songs are shown in sonogram format. Each comprises a series of chirps, the frequency and number of which fall progressively from song a to song c, as a causal state (known as the Raleigh number; v1 in part a) is decreased. c | The graph on the left depicts the conditional expectations (μv1v2) of the causal states, shown as a function of peristimulus time for the three songs. It shows that the causes are identified after around 600 ms with high conditional precision (90% confidence intervals are shown in grey). The graph on the right shows the conditional density on the causes shortly before the end of the peristimulus time (that is, the dotted line in the left panel). The blue dots correspond to conditional expectations and the grey areas correspond to the 90% conditional confidence regions. Note that these encompass the true values (red dots) of (v1,v2) that were used to generate the songs. These results illustrate the nature of perceptual categorization under the inference scheme in Box 2: here, recognition corresponds to mapping from a continuously changing and chaotic sensory input to a fixed point in perceptual space. Figure is reproduced, with permission, from Ref. 130 © (2009) Elsevier.

Message passing of this sort is consistent with functional asymmetries in real cortical hierarchies45, where forward connections (which convey prediction errors) are driving and backwards connections (which model the nonlinear generation of sensory input) have both driving and modulatory characteristics46. This asymmetrical message passing is also a characteristic feature of adaptive resonance theory47,48, which has formal similarities to predictive coding.

In summary, the theme underlying the Bayesian brain and predictive coding is that the brain is an inference engine that is trying to optimize probabilistic representations of what caused its sensory input. This optimization can be finessed using a (variational free-energy) bound on surprise. In short, the free-energy principle entails the Bayesian brain hypothesis and can be implemented by the many schemes considered in this field. Almost invariably, these involve some form of message passing or belief propagation among brain areas or units. This allows us to connect the free-energy principle to another principled approach to sensory processing, namely information theory.

The principle of efficient coding

The principle of efficient coding suggests that the brain optimizes the mutual information (that is, the mutual predictability) between the sensorium and its internal representation, under constraints on the efficiency of those representations. This line of thinking was articulated by Barlow49 in terms of a redundancy reduction principle (or principle of efficient coding) and formalized later in terms of the infomax principle50. It has been applied in machine learning51, leading to methods like independent component analysis52, and in neurobiology, contributing to an understanding of the nature of neuronal responses53,54,55,56. This principle is extremely effective in predicting the empirical characteristics of classical receptive fields53 and provides a principled explanation for sparse coding55 and the segregation of processing streams in visual hierarchies57. It has been extended to cover dynamics and motion trajectories58,59 and even used to infer the metabolic constraints on neuronal processing60.

At its simplest, the infomax principle says that neuronal activity should encode sensory information in an efficient and parsimonious fashion. It considers the mapping between one set of variables (sensory states) and another (variables representing those states). At first glance, this seems to preclude a probabilistic representation, because this would involve mapping between sensory states and a probability density. However, the infomax principle can be applied to the sufficient statistics of a recognition density. In this context, the infomax principle becomes a special case of the free-energy principle, which arises when we ignore uncertainty in probabilistic representations (and when there is no action); see Supplementary information S3 (box) for mathematical details). This is easy to see by noting that sensory signals are generated by causes. This means that it is sufficient to represent the causes to predict these signals. More formally, the infomax principle can be understood in terms of the decomposition of free energy into complexity and accuracy: mutual information is optimized when conditional expectations maximize accuracy (or minimize prediction error), and efficiency is assured by minimizing complexity. This ensures that no excessive parameters are applied in the generative model and leads to a parsimonious representation of sensory data that conforms to prior constraints on their causes. Interestingly, advanced model-optimization techniques use free-energy optimization to eliminate redundant model parameters61, suggesting that free-energy optimization might provide a nice explanation for the synaptic pruning and homeostasis that take place in the brain during neurodevelopment62 and sleep63.

The infomax principle pertains to a forward mapping from sensory input to representations. How does this square with optimizing generative models, which map from causes to sensory inputs? These perspectives can be reconciled by noting that all recognition schemes based on infomax can be cast as optimizing the parameters of a generative model64. For example, in sparse coding models55, the implicit priors posit independent causes that are sampled from a heavy-tailed or sparse distribution42. The fact that these models predict empirically observed receptive fields so well suggests that we are endowed with (or acquire) prior expectations that the causes of our sensations are largely independent and sparse.

In summary, the principle of efficient coding says that the brain should optimize the mutual information between its sensory signals and some parsimonious neuronal representations. This is the same as optimizing the parameters of a generative model to maximize the accuracy of predictions, under complexity constraints. Both are mandated by the free-energy principle, which can be regarded as a probabilistic generalization of the infomax principle. We now turn to more biologically inspired ideas about brain function that focus on neuronal dynamics and plasticity. This takes us deeper into neurobiological mechanisms and the implementation of the theoretical principles outlined above.

The cell assembly and correlation theory

The cell assembly theory was proposed by Hebb65 and entails Hebbian — or associative — plasticity, which is a cornerstone of use-dependent or experience-dependent plasticity66, the correlation theory of von de Malsburg67,68and other formal refinements to Hebbian plasticity per se69. The cell assembly theory posits that groups of interconnected neurons are formed through a strengthening of synaptic connections that depends on correlated pre- and postsynaptic activity; that is, 'cells that fire together wire together'. This enables the brain to distil statistical regularities from the sensorium. The correlation theory considers the selective enabling of synaptic efficacy and its plasticity (also known as metaplasticity70) by fast synchronous activity induced by different perceptual attributes of the same object (for example, a red bus in motion). This resolves a putative deficiency of classical plasticity, which cannot ascribe a presynaptic input to a particular cause (for example, redness) in the world67. The correlation theory underpins theoretical treatments of synchronized brain activity and its role in associating or binding attributes to specific objects or causes68,71. Another important field that rests on associative plasticity is the use of attractor networks as models of memory formation and retrieval72,73,74. So how do correlations and associative plasticity figure in the free-energy formulation?

Hitherto, we have considered only inference on states of the world that cause sensory signals, whereby conditional expectations about states are encoded by synaptic activity. However, the causes covered by the recognition density are not restricted to time-varying states (for example, the motion of an object in the visual field): they also include time-invariant regularities that endow the world with causal structure (for example, objects fall with constant acceleration). These regularities are parameters of the generative model and have to be inferred by the brain — in other words, the conditional expectations of these parameters that may be encoded by synaptic efficacy (these are μθ in Box 2) have to be optimized. This corresponds to optimizing connection strengths in the brain — that is, plasticity that underlines learning. So what form would this learning take? It transpires that a gradient descent on free energy (that is, changing connections to reduce free energy) is formally identical to Hebbian plasticity28,42 (Box 2). This is because the parameters of the generative model determine how expected states (synaptic activity) are mixed to form predictions. Put simply, when the presynaptic predictions and postsynaptic prediction errors are highly correlated, the connection strength increases, so that predictions can suppress prediction errors more efficiently.

In short, the formation of cell assemblies reflects the encoding of causal regularities. This is just a restatement of cell assembly theory in the context of a specific implementation (predictive coding) of the free-energy principle. It should be acknowledged that the learning rule in predictive coding is really a delta rule, which rests on Hebbian mechanisms; however, Hebb's wider notions of cell assemblies were formulated from a non-statistical perspective. Modern reformulations suggest that both inference on states (that is, perception) and inference on parameters (that is, learning) minimize free energy (that is, minimize prediction error) and serve to bound surprising exchanges with the world. So what about synchronization and the selective enabling of synapses?

Biased competition and attention

Causal regularities encoded by synaptic efficacy control the deterministic evolution of states in the world. However, stochastic (that is, random) fluctuations in these states play an important part in generating sensory data. Their amplitude is usually represented as precision (or inverse variance), which encodes the reliability of prediction errors. Precision is important, especially in hierarchical schemes, because it controls the relative influence of bottom-up prediction errors and top-down predictions. So how is precision encoded in the brain? In predictive coding, precision modulates the amplitude of prediction errors (these are μγ in Box 2), so that prediction errors with high precision have a greater impact on units that encode conditional expectations. This means that precision corresponds to the synaptic gain of prediction error units. The most obvious candidates for controlling gain (and implicitly encoding precision) are classical neuromodulators like dopamine and acetylcholine, which provides a nice link to theories of attention and uncertainty75,76,77. Another candidate is fast synchronized presynaptic input that lowers effective postsynaptic membrane time constants and increases synchronous gain78. This fits comfortably with the correlation theory and speaks to recent ideas about the role of synchronous activity in mediating attentional gain79,80.

In summary, the optimization of expected precision in terms of synaptic gain links attention to synaptic gain and synchronization. This link is central to theories of attentional gain and biased competition80,81,82,83,84,85, particularly in the context of neuromodulation86,87. The theories considered so far have dealt only with perception. However, from the point of view of the free-energy principle, perception just makes free energy a good proxy for surprise. To actually reduce surprise we need to act. In the next section, we retain a focus on cell assemblies but move to the selection and reinforcement of stimulus–response links.

Neural Darwinism and value learning

In the theory of neuronal group selection88, the emergence of neuronal assemblies is considered in the light of selective pressure. The theory has four elements: epigenetic mechanisms create a primary repertoire of neuronal connections, which are refined by experience-dependent plasticity to produce a secondary repertoire of neuronal groups. These are selected and maintained through reentrant signalling among neuronal groups. As in cell assembly theory, plasticity rests on correlated pre- and postsynaptic activity, but here it is modulated by value. Value is signalled by ascending neuromodulatory transmitter systems and controls which neuronal groups are selected and which are not. The beauty of neural Darwinism is that it nests distinct selective processes within each other. In other words, it eschews a single unit of selection and exploits the notion of meta-selection (the selection of selective mechanisms; for example, see Ref. 89). In this context, (neuronal) value confers evolutionary value (that is, adaptive fitness) by selecting neuronal groups that meditate adaptive stimulus–stimulus associations and stimulus–response links. The capacity of value to do this is assured by natural selection, in the sense that neuronal value systems are themselves subject to selective pressure.

This theory, particularly value-dependent learning90, has deep connections with reinforcement learning and related approaches in engineering (see below), such as dynamic programming and temporal difference models91,92. This is because neuronal value systems reinforce connections to themselves, thereby enabling the brain to label a sensory state as valuable if, and only if, it leads to another valuable state. This ensures that agents move through a succession of states that have acquired value to access states (rewards) with genetically specified innate value. In short, the brain maximizes value, which may be reflected in the discharge of value systems (for example, dopaminergic systems92,93,94,95,96). So how does this relate to the optimization of free energy?

The answer is simple: value is inversely proportional to surprise, in the sense that the probability of a phenotype being in a particular state increases with the value of that state. Furthermore, the evolutionary value of a phenotype is the negative surprise averaged over all the states it experiences, which is simply its negative entropy. Indeed, the whole point of minimizing free energy (and implicitly entropy) is to ensure that agents spend most of their time in a small number of valuable states. This means that free energy is the complement of value, and its long-term average is the complement of adaptive fitness (also known as free fitness in evolutionary biology97). But how do agents know what is valuable? In other words, how does one generation tell the next which states have value (that is, are unsurprising)? Value or surprise is determined by the form of an agent's generative model and its implicit priors — these specify the value of sensory states and, crucially, are heritable through genetic and epigenetic mechanisms. This means that prior expectations (that is, the primary repertoire) can prescribe a small number of attractive states with innate value. In turn, this enables natural selection to optimize prior expectations and ensure they are consistent with the agent's phenotype. Put simply, valuable states are just the states that the agent expects to frequent. These expectations are constrained by the form of its generative model, which is specified genetically and fulfilled behaviourally, under active inference.

It is important to appreciate that prior expectations include not just what will be sampled from the world but also how the world is sampled. This means that natural selection may equip agents with the prior expectation that they will explore their environment until states with innate value are encountered. We will look at this more closely in the next section, where priors on motion through state space are cast in terms of policies in reinforcement learning.

Both neural Darwinism and the free-energy principle try to understand somatic changes in an individual in the context of evolution: neural Darwinism appeals to selective processes, whereas the free energy formulation considers the optimization of ensemble or population dynamics in terms of entropy and surprise. The key theme that emerges here is that (heritable) prior expectations can label things as innately valuable (unsurprising); but how can simply labelling states engender adaptive behaviour? In the next section, we return to reinforcement learning and related formulations of action that try to explain adaptive behaviour purely in terms of labels or cost functions.

Optimal control theory and game theory

Value is central to theories of brain function that are based on reinforcement learning and optimum control. The basic notion that underpins these treatments is that the brain optimizes value, which is expected reward or utility (or its complement — expected loss or cost). This is seen in behavioural psychology as reinforcement learning98, in computational neuroscience and machine learning as variants of dynamic programming such as temporal difference learning99,100,101, and in economics as expected utility theory102. The notion of an expected reward or cost is crucial here; this is the cost expected over future states, given a particular policy that prescribes action or choices. A policy specifies the states to which an agent will move from any given state ('motion through state space in continuous time'). This policy has to access sparse rewarding states using a cost function, which only labels states as costly or not. The problem of how the policy is optimized is formalized in optimal control theory as the Bellman equation and its variants99 (see Supplementary information S4 (box)), which express value as a function of the optimal policy and a cost function. If one can solve the Bellman equation, one can associate each sensory state with a value and optimize the policy by ensuring that the next state is the most valuable of the available states. In general, it is impossible to solve the Bellman equation exactly, but several approximations exist, ranging from simple Rescorla–Wagner models98 to more comprehensive formulations like Q-learning100. Cost also has a key role in Bayesian decision theory, in which optimal decisions minimize expected cost in the context of uncertainty about outcomes; this is central to optimal decision theory (game theory) and behavioural economics102,103,104.

So what does free energy bring to the table? If one assumes that the optimal policy performs a gradient ascent on value, then it is easy to show that value is inversely proportional to surprise (see Supplementary information S4 (box)). This means that free energy is (an upper bound on) expected cost, which makes sense as optimal control theory assumes that action minimizes expected cost, whereas the free-energy principle states that it minimizes free energy. This is important because it explains why agents must minimize expected cost. Furthermore, free energy provides a quantitative and seamless connection between the cost functions of reinforcement learning and value in evolutionary biology. Finally, the dynamical perspective provides a mechanistic insight into how policies are specified in the brain: according to the principle of optimality99 cost is the rate of change of value (see Supplementary information S4 (box)), which depends on changes in sensory states. This suggests that optimal policies can be prescribed by prior expectations about the motion of sensory states. Put simply, priors induce a fixed-point attractor, and when the states arrive at the fixed point, value will stop changing and cost will be minimized. A simple example is shown in Fig. 2, in which a cued arm movement is simulated using only prior expectations that the arm will be drawn to a fixed point (the target). This figure illustrates how computational motor control105,106,107,108,109 can be formulated in terms of priors and the suppression of sensory prediction errors (K.J.F., J. Daunizeau, J. Kilner and S.J. Kiebel, unpublished observations). More generally, it shows how rewards and goals can be considered as prior expectations that an action is obliged to fulfil16 (see also Ref. 110). It also suggests how natural selection could optimize behaviour through the genetic specification of inheritable or innate priors that constrain the learning of empirical priors (Box 2) and subsequent goal-directed action.

Figure 2: A demonstration of cued reaching movements.
figure 2

The lower right part of the figure shows a motor plant, comprising a two-jointed arm with two hidden states, each of which corresponds to a particular angular position of the two joints; the current position of the finger (red circle) is the sum of the vectors describing the location of each joint. Here, causal states in the world are the position and brightness of the target (green circle). The arm obeys Newtonian mechanics, specified in terms of angular inertia and friction. The left part of the figure illustrates that the brain senses hidden states directly in terms of proprioceptive input (S prop) that signals the angular positions (x1,x2) of the joints and indirectly through seeing the location of the finger in space (J1,J2). In addition, through visual input (S visual) the agent senses the target location (v1,v2) and brightness (v3). Sensory prediction errors are passed to higher brain levels to optimize the conditional expectations of hidden states (that is, the angular position of the joints) and causal (that is, target) states. The ensuing predictions are sent back to suppress sensory prediction errors. At the same time, sensory prediction errors are also trying to suppress themselves by changing sensory input through action. The grey and black lines denote reciprocal message passing among neuronal populations that encode prediction error and conditional expectations; this architecture is the same as that depicted in Box 2. The blue lines represent descending motor control signals from sensory prediction-error units. The agent's generative model included priors on the motion of hidden states that effectively engage an invisible elastic band between the finger and target (when the target is illuminated). This induces a prior expectation that the finger will be drawn to the target, when cued appropriately. The insert shows the ensuing movement trajectory caused by action. The red circles indicate the initial and final positions of the finger, which reaches the target (green circle) quickly and smoothly; the blue line is the simulated trajectory.

It should be noted that just expecting to be attracted to some states may not be sufficient to attain those states. This is because one may have to approach attractors vicariously through other states (for example, to avoid obstacles) or conform to physical constraints on action. These are some of the more difficult problems of accessing distal rewards that reinforcement learning and optimum control contend with. In these circumstances, an examination of the density dynamics, on which the free-energy principle is based, suggests that it is sufficient to keep moving until an a priori attractor is encountered (see Supplementary information S5 (box)). This entails destroying unexpected (costly) fixed points in the environment by making them unstable (like shifting to a new position when sitting uncomfortably). Mathematically, this means adopting a policy that ensures a positive divergence in costly states (intuitively, this is like being pushed through a liquid with negative viscosity or friction). See Fig. 3 for a solution to the classical mountain car problem using a simple prior that induces this sort of policy. This prior is on motion through state space (that is, changes in states) and enforces exploration until an attractive state is found. Priors of this sort may provide a principled way to understand the exploration–exploitation trade-off111,112,113 and related issues in evolutionary biology114. The implicit use of priors to induce dynamical instability also provides a key connection to dynamical systems theory approaches to the brain that emphasize the importance of itinerant dynamics, metastability, self-organized criticality and winner-less competition115,116,117,118,119,120,121,122,123. These dynamical phenomena have a key role in synergetic and autopoietic accounts of adaptive behaviour5,124,125.

Figure 3: Solving the mountain car problem with prior expectations.
figure 3

a | How paradoxical but adaptive behaviour (for example, moving away from a target to ensure that it is secured later) emerges from simple priors on the motion of hidden states in the world. Shown is the landscape or potential energy function (with a minimum at position x = −0.5) that exerts forces on a mountain car. The car is shown at the target position on the hill at x =1, indicated by the red circle. The equations of motion of the car are shown below the plot. Crucially, at x = 0 the force on the car cannot be overcome by the agent, because a squashing function −1≤σ≤1 is applied to action to prevent it being greater than 1. This means that the agent can access the target only by starting halfway up the left hill to gain enough momentum to carry it up the other side. b | The results of active inference under priors that destabilize fixed points outside the target domain. The priors are encoded in a cost function c(x) (top left), which acts like negative friction. When 'friction' is negative the car expects to go faster (see Supplementary information S5 (box) for details). The inferred hidden states (upper right: position in blue, velocity in green and negative dissipation in red) show that the car explores its landscape until it encounters the target, and that friction then increases (that is, cost decreases) dramatically to prevent the car from escaping the target (by falling down the hill). The ensuing trajectory is shown in blue (bottom left). The paler lines provide exemplar trajectories from other trials, with different starting positions. In the real world, friction is constant. However, the car 'expects' friction to change as it changes position, thus enforcing exploration or exploitation. These expectations are fulfilled by action (lower right).

In summary, optimal control and decision (game) theory start with the notion of cost or utility and try to construct value functions of states, which subsequently guide action. The free-energy formulation starts with a free-energy bound on the value of states, which is specified by priors on the motion of hidden environmental states. These priors can incorporate any cost function to ensure that costly states are avoided. States with minimum cost can be set (by learning or evolution) in terms of prior expectations about motion and the attractors that ensue. In this view, the problem of finding sparse rewards in the environment is nature's solution to the problem of how to minimize the entropy (average surprise or free energy) of an agent's states: by ensuring they occupy a small set of attracting (that is, rewarding) states.

Conclusions and future directions

Although contrived to highlight commonalities, this Review suggests that many global theories of brain function can be united under a Helmholtzian perceptive of the brain as a generative model of the world it inhabits18,20,21,25 (Fig. 4); notable examples include the integration of the Bayesian brain and computational motor control theory, the objective functions shared by predictive coding and the infomax principle, hierarchical inference and theories of attention, the embedding of perception in natural selection and the link between optimum control and more exotic phenomena in dynamical systems theory. The constant theme in all these theories is that the brain optimizes a (free-energy) bound on surprise or its complement, value. This manifests as perception (so as to change predictions) or action (so as to change the sensations that are predicted). Crucially, these predictions depend on prior expectations (that furnish policies), which are optimized at different (somatic and evolutionary) timescales and define what is valuable.

Figure 4: The free-energy principle and other theories.
figure 4

Some of the theoretical constructs considered in this Review and how they relate to the free-energy principle (centre). The variables are described in Boxes 1,2 and a full explanation of the equations can be found in the Supplementary information S1–S4 (boxes).

What does the free-energy principle portend for the future? If its main contribution is to integrate established theories, then the answer is probably 'not a lot'. Conversely, it may provide a framework in which current debates could be resolved, for example whether dopamine encodes reward prediction error or surprise126,127 — this is particularly important for understanding conditions like addiction, Parkinson's disease and schizophrenia. Indeed, the free-energy formulation has already been used to explain the positive symptoms of schizophrenia in terms of false inference128. The free-energy formulation could also provide new approaches to old problems that might call for a reappraisal of conventional notions, particularly in reinforcement learning and motor control.

If the arguments underlying the free-energy principle hold, then the real challenge is to understand how it manifests in the brain. This speaks to a greater appreciation of hierarchical message passing41, the functional role of specific neurons and microcircuits and the dynamics they support (for example, what is the relationship between predictive coding, attention and dynamic coordination in the brain?129). Beyond neuroscience, many exciting applications in engineering, robotics, embodied cognition and evolutionary biology suggest themselves; although fanciful, it is not difficult to imagine building little free-energy machines that garner and model sensory information (like our children) to maximize the evidence for their own existence.