Free energy principle

By Wikipedia Contributors

The free energy principle tries to explain how (biological) systems maintain their order (non-equilibrium steady-state) by restricting themselves to a limited number of states.[1] It says that biological systems minimise a free energy functional of their internal states, which entail beliefs about hidden states in their environment. The implicit minimisation of variational free energy is formally related to variational Bayesian methods and was originally introduced by Karl Friston as an explanation for embodied perception in neuroscience,[2] where it is also known as active inference.


The notion that self-organising biological systems – like a cell or brain – can be understood as minimising variational free energy is based upon Helmholtz’s observations on unconscious inference[3] and subsequent treatments in psychology [4] and machine learning.[5] Variational free energy is a function of some outcomes and a probability density over their (hidden) causes. This variational density is defined in relation to a probabilistic model that generates outcomes from causes. In this setting, free energy provides an (upper bound) approximation to Bayesian model evidence.[6] Its minimisation can therefore be used to explain Bayesian inference and learning. When a system actively samples outcomes to minimise free energy, it implicitly performs active inference and maximises the evidence for its (generative) model.

However, free energy is also an upper bound on the self-information (or surprise) of outcomes, where the long-term average of surprise is entropy. This means that if a system acts to minimise free energy, it will implicitly place an upper bound on the entropy of the outcomes – or sensory states – it samples.[7]

Relationship to other theories

Active inference is closely related to the good regulator theorem [8] and related accounts of self-organisation,[9][10] such as self-assembly, pattern formation, autopoiesis[11] and practopoiesis[12]. It addresses the themes considered in cybernetics, synergetics [13] and embodied cognition. Because free energy can be expressed as the expected energy (of outcomes) under the variational density minus its entropy, it is also related to the maximum entropy principle.[14] Finally, because the time average of energy is action, the principle of minimum variational free energy is a principle of least action.


These schematics illustrate the partition of states into internal and hidden or external states that are separated by a Markov blanket – comprising sensory and active states. The lower panel shows this partition as it would be applied to action and perception in the brain; where active and internal states minimise a free energy functional of sensory states. The ensuing self-organisation of internal states then correspond perception, while action couples brain states back to external states. The upper panel shows exactly the same dependencies but rearranged so that the internal states are associated with the intracellular states of a cell, while the sensory states become the surface states of the cell membrane overlying active states (e.g., the actin filaments of the cytoskeleton).

Definition (continuous formulation): Active inference rests on the tuple ( Ω , Ψ , S , A , R , q , p ) {\displaystyle (\Omega ,\Psi ,S,A,R,q,p)} (\Omega,\Psi,S,A,R,q,p),

  • A sample space Ω {\displaystyle \Omega } \Omega – from which random fluctuations ω Ω {\displaystyle \omega \in \Omega } \omega \in \Omega are drawn
  • Hidden or external states Ψ : Ψ × A × Ω R {\displaystyle \Psi :\Psi \times A\times \Omega \to \mathbb {R} } \Psi:\Psi\times A \times \Omega \to \mathbb{R} – that cause sensory states and depend on action
  • Sensory states S : Ψ × A × Ω R {\displaystyle S:\Psi \times A\times \Omega \to \mathbb {R} } S:\Psi \times A \times \Omega \to \mathbb{R} – a probabilistic mapping from action and hidden states
  • Action A : S × R R {\displaystyle A:S\times R\to \mathbb {R} } A:S\times R \to \mathbb{R} – that depends on sensory and internal states
  • Internal states R : R × S R {\displaystyle R:R\times S\to \mathbb {R} } R:R\times S \to \mathbb{R} – that cause action and depend on sensory states
  • Generative density p ( s , ψ | m ) {\displaystyle p(s,\psi |m)} p(s, \psi | m) – over sensory and hidden states under a generative model m {\displaystyle m} m
  • Variational density q ( ψ | μ ) {\displaystyle q(\psi |\mu )} q(\psi | \mu) – over hidden states ψ Ψ {\displaystyle \psi \in \Psi } \psi \in \Psi that is parameterised by internal states μ R {\displaystyle \mu \in R} \mu \in R

Action and perception

The objective is to maximise model evidence p ( s | m ) {\displaystyle p(s|m)} p(s|m) or minimise surprise log p ( s | m ) {\displaystyle -\log p(s|m)} -\log p(s|m) . This generally involves an intractable marginalisation over hidden states, so surprise is replaced with an upper variational free energy bound.[5] However, this means that internal states must also minimise free energy, because free energy is a functional of sensory and internal states:

a ( t ) = a r g m i n a { F ( s ( t ) , μ ( t ) ) } {\displaystyle a(t)={\underset {a}{\operatorname {arg\,min} }}\{F(s(t),\mu (t))\}}   a(t) = \underset{a}{\operatorname{arg\,min}}   \{ F(s(t),\mu(t)) \}
μ ( t ) = a r g m i n μ { F ( s ( t ) , μ ) ) } {\displaystyle \mu (t)={\underset {\mu }{\operatorname {arg\,min} }}\{F(s(t),\mu ))\}} \mu(t) = \underset{\mu}{\operatorname{arg\,min}} \{ F(s(t),\mu)) \}
F ( s , μ ) f r e e e n e r g y = E q [ log p ( s , ψ m ) ] e n e r g y H [ q ( ψ | μ ) ] e n t r o p y = log p ( s | m ) s u r p r i s e + D K L [ q ( ψ | μ ) p ( ψ s , m ) ] d i v e r g e n c e log p ( s | m ) s u r p r i s e {\displaystyle {\underset {\mathrm {free-energy} }{\underbrace {F(s,\mu )} }}={\underset {\mathrm {energy} }{\underbrace {E_{q}[-\log p(s,\psi \mid m)]} }}-{\underset {\mathrm {entropy} }{\underbrace {H[q(\psi |\mu )]} }}={\underset {\mathrm {surprise} }{\underbrace {-\log p(s|m)} }}+{\underset {\mathrm {divergence} }{\underbrace {D_{\mathrm {KL} }[q(\psi |\mu )\|p(\psi \mid s,m)]} }}\geq {\underset {\mathrm {surprise} }{\underbrace {-\log p(s|m)} }}} {\displaystyle {\underset {\mathrm {free-energy} }{\underbrace {F(s,\mu )} }}={\underset {\mathrm {energy} }{\underbrace {E_{q}[-\log p(s,\psi \mid m)]} }}-{\underset {\mathrm {entropy} }{\underbrace {H[q(\psi |\mu )]} }}={\underset {\mathrm {surprise} }{\underbrace {-\log p(s|m)} }}+{\underset {\mathrm {divergence} }{\underbrace {D_{\mathrm {KL} }[q(\psi |\mu )\|p(\psi \mid s,m)]} }}\geq {\underset {\mathrm {surprise} }{\underbrace {-\log p(s|m)} }}}

This induces a dual minimisation with respect to action and internal states that correspond to action and perception respectively.

Free energy minimisation

Free energy minimisation and self-organisation

Free energy minimisation has been proposed as a hallmark of self-organising systems, when cast as random dynamical systems.[15] This formulation rests on a Markov blanket (comprising action and sensory states) that separates internal and external states. If internal states and action minimise free energy, then they place an upper bound on the entropy of sensory states

lim T 1 T 0 T F ( s ( t ) , μ ( t ) ) d t f r e e a c t i o n lim T 1 T 0 T log p ( s ( t ) | m ) s u r p r i s e d t = H [ p ( s | m ) ] {\displaystyle \lim _{T\to \infty }{\frac {1}{T}}{\underset {\mathrm {free-action} }{\underbrace {\int _{0}^{T}F(s(t),\mu (t))dt} }}\geq \lim _{T\to \infty }{\frac {1}{T}}\int _{0}^{T}{\underset {\mathrm {surprise} }{\underbrace {-\log p(s(t)|m)} }}dt=H[p(s|m)]} {\displaystyle \lim _{T\to \infty }{\frac {1}{T}}{\underset {\mathrm {free-action} }{\underbrace {\int _{0}^{T}F(s(t),\mu (t))dt} }}\geq \lim _{T\to \infty }{\frac {1}{T}}\int _{0}^{T}{\underset {\mathrm {surprise} }{\underbrace {-\log p(s(t)|m)} }}dt=H[p(s|m)]}

This is because – under ergodic assumptions – the long-term average of surprise is entropy. This bound resists a natural tendency to disorder – of the sort associated with the second law of thermodynamics and the fluctuation theorem.

Free energy minimisation and Bayesian inference

All Bayesian inference can be cast in terms of free energy minimisation; e.g.,.[16] When free energy is minimised with respect to internal states, the Kullback–Leibler divergence between the variational and posterior density over hidden states is minimised. This corresponds to approximate Bayesian inference – when the form of the variational density is fixed – and exact Bayesian inference otherwise. Free energy minimisation therefore provides a generic description of Bayesian inference and filtering (e.g., Kalman filtering). It is also used in Bayesian model selection, where free energy can be usefully decomposed into complexity and accuracy:

F ( s , μ ) f r e e e n e r g y = D K L [ q ( ψ | μ ) p ( ψ | m ) ] c o m p l e x i t y E q [ log p ( s | ψ , m ) ] a c c u r a c y {\displaystyle {\underset {\mathrm {free-energy} }{\underbrace {F(s,\mu )} }}={\underset {\mathrm {complexity} }{\underbrace {D_{\mathrm {KL} }[q(\psi |\mu )\|p(\psi |m)]} }}-{\underset {\mathrm {accuracy} }{\underbrace {E_{q}[\log p(s|\psi ,m)]} }}} {\displaystyle {\underset {\mathrm {free-energy} }{\underbrace {F(s,\mu )} }}={\underset {\mathrm {complexity} }{\underbrace {D_{\mathrm {KL} }[q(\psi |\mu )\|p(\psi |m)]} }}-{\underset {\mathrm {accuracy} }{\underbrace {E_{q}[\log p(s|\psi ,m)]} }}}

Models with minimum free energy provide an accurate explanation of data, under complexity costs (c.f., Occam's razor and more formal treatments of computational costs [17]). Here, complexity is the divergence between the variational density and prior beliefs about hidden states (i.e., the effective degrees of freedom used to explain the data).

Free energy minimisation and thermodynamics

Variational free energy is an information theoretic functional and is distinct from thermodynamic (Helmholtz) free energy.[18] However, the complexity term of variational free energy shares the same fixed point as Helmholtz free energy (under the assumption the system is thermodynamically closed but not isolated). This is because if sensory perturbations are suspended (for a suitably long period of time), complexity is minimised (because accuracy can be neglected). At this point, the system is at equilibrium and internal states minimise Helmholtz free energy, by the principle of minimum energy.[19]

Free energy minimisation and information theory

Free energy minimisation is equivalent to maximising the mutual information between sensory states and internal states that parameterise the variational density (for a fixed entropy variational density).[7] This relates free energy minimization to the principle of minimum redundancy [20] and related treatments using information theory to describe optimal behaviour.[21][22]

Free energy minimisation in neuroscience

Free energy minimisation provides a useful way to formulate normative (Bayes optimal) models of neuronal inference and learning under uncertainty [23] and therefore subscribes to the Bayesian brain hypothesis.[24] The neuronal processes described by free energy minimisation depend on the nature of hidden states: Ψ = X × Θ × Π {\displaystyle \Psi =X\times \Theta \times \Pi }  \Psi = X \times \Theta \times \Pi that can comprise time dependent variables, time invariant parameters and the precision (inverse variance or temperature) of random fluctuations. Minimising variables, parameters and precision corresponds to inference, learning and the encoding of uncertainty, respectively:

Perceptual inference and categorisation

Free energy minimisation formalises the notion of unconscious inference in perception [3][5] and provides a normative (Bayesian) theory of neuronal processing. The associated process theory of neuronal dynamics is based on minimising free energy through gradient descent. This corresponds to generalised Bayesian filtering (where ~ denotes a variable in generalised coordinates of motion and D {\displaystyle D} D is a derivative matrix operator):[25]

μ ~ ˙ = D μ ~ μ ~ F ( s , μ ~ ) {\displaystyle {\dot {\tilde {\mu }}}=D{\tilde {\mu }}-\partial _{\tilde {\mu }}F(s,{\tilde {\mu }})} \dot{\tilde{\mu}} = D \tilde{\mu} - \partial_{\tilde{\mu}} F(s,\tilde{\mu})

Usually, the generative models that define free energy are non-linear and hierarchical (like cortical hierarchies in the brain). Special cases of generalised filtering include Kalman filtering, which is formally equivalent to predictive coding [26] – a popular metaphor for message passing in the brain. Under hierarchical models, predictive coding involves the recurrent exchange of ascending (bottom-up) prediction errors and descending (top-down) predictions [27] that is consistent with the anatomy and physiology of sensory [28] and motor systems.[29]

Perceptual learning and memory

In predictive coding, optimising model parameters through a gradient ascent on the time integral of free energy (free action) reduces to associative or Hebbian plasticity and is associated with synaptic plasticity in the brain.

Perceptual precision, attention and salience

Optimising the precision parameters corresponds to optimising the gain of prediction errors (c.f., Kalman gain). In neuronally plausible implementations of predictive coding,[27] this corresponds to optimising the excitability superficial pyramidal cells and has been interpreted in terms of attentional gain.[30]

Active inference

When gradient descent is applied to action a ˙ = a F ( s , μ ~ ) {\displaystyle {\dot {a}}=-\partial _{a}F(s,{\tilde {\mu }})}  \dot{a} = -\partial_aF(s,\tilde{\mu}) , motor control can be understood in terms of classical reflex arcs that are engaged by descending (corticospinal) predictions. This provides a formalism that generalizes the equilibrium point solution – to the degrees of freedom problem [31] – to movement trajectories.

Active inference and optimal control

Active inference is related to optimal control by replacing value or cost-to-go functions with prior beliefs about state transitions or flow.[32] This exploits the close connection between Bayesian filtering and the solution to the Bellman equation. However, active inference starts with (priors over) flow f = Γ V + × W {\displaystyle f=\Gamma \cdot \nabla V+\nabla \times W}  f = \Gamma \cdot \nabla V + \nabla \times W that are specified with scalar V ( x ) {\displaystyle V(x)} V(x) and vector W ( x ) {\displaystyle W(x)}  W(x) value functions of state space (c.f., the Helmholtz decomposition). Here, Γ {\displaystyle \Gamma } \Gamma is the amplitude of random fluctuations and cost is c ( x ) = f V + Γ V {\displaystyle c(x)=f\cdot \nabla V+\nabla \cdot \Gamma \cdot V}  c(x) = f \cdot \nabla V + \nabla \cdot \Gamma \cdot V. The priors over flow p ( x ~ | m ) {\displaystyle p({\tilde {x}}|m)}  p(\tilde{x}|m) induce a prior over states p ( x | m ) = exp ( V ( x ) ) {\displaystyle p(x|m)=\exp(V(x))}  p(x|m) = \exp (V(x)) that is the solution to the appropriate forward Kolmogorov equations.[33] In contrast, optimal control optimises the flow, given a cost function, under the assumption that W = 0 {\displaystyle W=0}  W = 0 (i.e., the flow is curl free or has detailed balance). Usually, this entails solving backward Kolmogorov equations.[34]

Active inference and optimal decision (game) theory

Optimal decision problems (usually formulated as partially observable Markov decision processes) are treated within active inference by absorbing utility functions into prior beliefs. In this setting, states that have a high utility (low cost) are states an agent expects to occupy. By equipping the generative model with hidden states that model control, policies (control sequences) that minimise variational free energy lead to high utility states.[35]

Neurobiologically, neuromodulators like dopamine are considered to report the precision of prediction errors by modulating the gain of principal cells encoding prediction error.[36] This is closely related to – but formally distinct from – the role of dopamine in reporting prediction errors per se [37] and related computational accounts.[38]

Active inference and cognitive neuroscience

Active inference has been used to address a range of issues in cognitive neuroscience, brain function and neuropsychiatry, including: action observation,[39] mirror neurons,[40] saccades and visual search,[41] eye movements,[42] sleep,[43] illusions,[44] attention,[30] action selection,[36] hysteria [45] and psychosis.[46]

See also


  1. ^ Ashby, W. R. (1962). Principles of the self-organizing Principles of Self-Organization: Transactions of the University of Illinois Symposium, H. Von Foerster and G. W. Zopf, Jr. (eds.), Pergamon Press: London, UK, pp. 255–278.
  2. ^ Friston, K., Kilner, J., & Harrison, L. (2006). A free energy principle for the brain. J Physiol Paris. , 100 (1–3), 70–87.
  3. ^ a b Helmholtz, H. (1866/1962). Concerning the perceptions in general. In Treatise on physiological optics (J. Southall, Trans., 3rd ed., Vol. III). New York: Dover.
  4. ^ Gregory, R. L. (1980). Perceptions as hypotheses. Phil Trans R Soc Lond B. , 290, 181–197.
  5. ^ a b c Dayan, P., Hinton, G. E., & Neal, R. (1995). The Helmholtz machine. Neural Computation , 7, 889–904.
  6. ^ Beal, M. J. (2003). Variational Algorithms for Approximate Bayesian Inference. PhD. Thesis, University College London.
  7. ^ a b Friston, K. (2012). A Free Energy Principle for Biological Systems. Entropy , 14, 2100–2121.
  8. ^ Conant, R. C., & Ashby, R. W. (1970). Every Good Regulator of a system must be a model of that system. Int. J. Systems Sci. , 1 (2), 89–97.
  9. ^ Kauffman, S. (1993). The Origins of Order: Self-Organization and Selection in Evolution. Oxford: Oxford University Press.
  10. ^ Nicolis, G., & Prigogine, I. (1977). Self-organization in non-equilibrium systems. New York: John Wiley.
  11. ^ Maturana, H. R., & Varela, F. (1980). Autopoiesis: the organization of the living. In V. F. Maturana HR (Ed.), Autopoiesis and Cognition. Dordrecht, Netherlands: Reidel.
  12. ^ Nikolić, D. (2015). Practopoiesis: Or how life fosters a mind. Journal of theoretical biology, 373, 40-61.
  13. ^ Haken, H. (1983). Synergetics: An introduction. Non-equilibrium phase transition and self-organisation in physics, chemistry and biology (3rd ed.). Berlin: Springer Verlag.
  14. ^ Jaynes, E. T. (1957). Information Theory and Statistical Mechanics. Physical Review Series II , 106 (4), 620–30.
  15. ^ Crauel, H., & Flandoli, F. (1994). Attractors for random dynamical systems. Probab Theory Relat Fields , 100, 365–393.
  16. ^ Roweis, S., & Ghahramani, Z. (1999). A unifying review of linear Gaussian models. Neural Computat. , 11 (2), 305–45. doi:10.1162/089976699300016674
  17. ^ Ortega, P. A., & Braun, D. A. (2012). Thermodynamics as a theory of decision-making with information processing costs. Proceedings of the Royal Society A, vol. 469, no. 2153 (20120683) .
  18. ^ Evans, D. J. (2003). A non-equilibrium free energy theorem for deterministic systems. Molecular Physics , 101, 15551–4.
  19. ^ Jarzynski, C. (1997). Nonequilibrium equality for free energy differences. Phys. Rev. Lett., 78, 2690.
  20. ^ Barlow, H. (1961). Possible principles underlying the transformations of sensory messages. In W. Rosenblith (Ed.), Sensory Communication (pp. 217-34). Cambridge, MA: MIT Press.
  21. ^ Linsker, R. (1990). Perceptual neural organization: some approaches based on network models and information theory. Annu Rev Neurosci. , 13, 257–81.
  22. ^ Bialek, W., Nemenman, I., & Tishby, N. (2001). Predictability, complexity, and learning. Neural Computat., 13 (11), 2409–63.
  23. ^ Friston, K. (2010). The free-energy principle: a unified brain theory? Nat Rev Neurosci. , 11 (2), 127–38.
  24. ^ Knill, D. C., & Pouget, A. (2004). The Bayesian brain: the role of uncertainty in neural coding and computation. Trends Neurosci. , 27 (12), 712–9.
  25. ^ Friston, K., Stephan, K., Li, B., & Daunizeau, J. (2010). Generalised Filtering. Mathematical Problems in Engineering , vol., 2010, 621670
  26. ^ Rao, R. P., & Ballard, D. H. (1999). Predictive coding in the visual cortex: a functional interpretation of some extra-classical receptive-field effects. Nat Neurosci. , 2 (1), 79–87.
  27. ^ a b Mumford, D. (1992). On the computational architecture of the neocortex. II. Biol. Cybern. , 66, 241–51.
  28. ^ Bastos, A. M., Usrey, W. M., Adams, R. A., Mangun, G. R., Fries, P., & Friston, K. J. (2012). Canonical microcircuits for predictive coding. Neuron , 76 (4), 695–711.
  29. ^ Adams, R. A., Shipp, S., & Friston, K. J. (2013). Predictions not commands: active inference in the motor system. Brain Struct Funct. , 218 (3), 611–43
  30. ^ a b Feldman, H., & Friston, K. J. (2010). Attention, uncertainty, and free-energy. Frontiers in Human Neuroscience , 4, 215.
  31. ^ Feldman, A. G., & Levin, M. F. (1995). The origin and use of positional frames of reference in motor control. Behav Brain Sci. , 18, 723–806.
  32. ^ Friston, K., (2011). What is optimal about motor control?. Neuron, 72(3), 488–98.
  33. ^ Friston, K., & Ao, P. (2012). Free-energy, value and attractors. Computational and mathematical methods in medicine, 2012, 937860.
  34. ^ Kappen, H., (2005). Path integrals and symmetry breaking for optimal control theory. Journal of Statistical Mechanics: Theory and Experiment, 11, p. P11011.
  35. ^ Friston, K., Samothrakis, S. & Montague, R., (2012). Active inference and agency: optimal control without cost functions. Biol. Cybernetics, 106(8–9), 523–41.
  36. ^ a b Friston, K. J. Shiner T, FitzGerald T, Galea JM, Adams R, Brown H, Dolan RJ, Moran R, Stephan KE, Bestmann S. (2012). Dopamine, affordance and active inference. PLoS Comput. Biol., 8(1), p. e1002327.
  37. ^ Fiorillo, C. D., Tobler, P. N. & Schultz, W., (2003). Discrete coding of reward probability and uncertainty by dopamine neurons. Science, 299(5614), 1898–902.
  38. ^ Frank, M. J., (2005). Dynamic dopamine modulation in the basal ganglia: a neurocomputational account of cognitive deficits in medicated and nonmedicated Parkinsonism. J Cogn Neurosci., Jan, 1, 51–72.
  39. ^ Friston, K., Mattout, J. & Kilner, J., (2011). Action understanding and active inference. Biol Cybern., 104, 137–160.
  40. ^ Kilner, J. M., Friston, K. J. & Frith, C. D., (2007). Predictive coding: an account of the mirror neuron system. Cogn Process., 8(3), pp. 159–66.
  41. ^ Friston, K., Adams, R. A., Perrinet, L. & Breakspear, M., (2012). Perceptions as hypotheses: saccades as experiments. Front Psychol., 3, 151.
  42. ^ Perrinet L, Adams R, Friston, K. Active inference, eye movements and oculomotor delays. Biological Cybernetics, 108(6):777-801, 2014.
  43. ^ Hobson, J. A. & Friston, K. J., (2012). Waking and dreaming consciousness: Neurobiological and functional considerations. Prog Neurobiol, 98(1), pp. 82–98.
  44. ^ Brown, H., & Friston, K. J. (2012). Free-energy and illusions: the cornsweet effect. Front Psychol , 3, 43.
  45. ^ Edwards, M. J., Adams, R. A., Brown, H., Pareés, I., & Friston, K. J. (2012). A Bayesian account of 'hysteria'. Brain , 135(Pt 11):3495–512.
  46. ^ Adams RA, Perrinet LU, Friston K. (2012). Smooth pursuit and visual occlusion: active inference and oculomotor control in schizophrenia. PLoS One. , 12;7(10):e47502

External links