EUROPA
Theory2006Why life exists· 12 min read

Free energy principle

Living systems persist by minimising "surprise" — constantly predicting their world and acting to match predictions.
Why it matters

An ambitious attempt to unite life, brains and AI under one equation.

You are here in deep time2006
Earth forms
Animals
Dinosaurs end
First humans
Our species
Farming
Industry
4.6 billion years agotoday

Neuroscientist Karl Friston proposes that any self-organising system that maintains a boundary (a "Markov blanket") must behave as if it minimises variational free energy. The principle underpins predictive-processing theories of the brain. Supporters see a theory of life and mind; critics say it is so general that it is hard to test.

In depth

From Wikipedia, CC BY-SA

The free energy principle is a variational principle of self-organization from information physics. Its application to neurobiology suggests that the brain reduces surprise or uncertainty by making predictions based on generative models and uses sensory input to minimize variational free energy or, equivalently, maximize model evidence. This casts perception as Bayesian inference and action-perception cycles as active inference, where sensory feedback refines prediction-guided actions. Wide-ranging applications of the principle have addressed brain function, perception, and action. Its general applicability to living systems has been pursued.

Overview

In biophysics and cognitive science, the free energy principle offers a formal account of the representational capacities of physical systems: that is, why things that exist look as if they track properties of the systems to which they are coupled. It establishes that the dynamics of physical systems minimize surprisal (the negative log probability of some outcome); or equivalently, free energy (its variational upper bound). The principle is used in Bayesian accounts of brain function and some approaches to artificial intelligence; it is formally related to variational Bayesian methods. Karl Friston introduced it as a description of embodied perception-action loops in neuroscience.

The free energy principle models the behavior of one system that is distinct from, but coupled to, another system (e.g., an embedding environment), where the degrees of freedom that implement the interface between the two is cast as a Markov blanket. Formally, the free energy principle says that if a system has a particular partition (i.e., into particles), then subsets of that system track the statistical structure of other subsets (internal and external states or paths).

The free energy principle is based on the Bayesian view of the brain as an inference engine. Under the free energy principle, systems pursue paths of least surprisal, in relation to some predictions furnished by a generative model. This surprisal is quantified by variational free energy and is minimized by continuous — Bayesian belief — updating of predictions, or by changing the world to fulfil predictions. By actively changing the world to bring it closer to the expected state, systems minimize free energy.

The free energy principle is a mathematical truism or method. To attempt to falsify the free energy principle is a category mistake, akin to trying to falsify calculus by making empirical observations. In a 2018 interview, Friston explained the implications:

I think it is useful to make a fundamental distinction at this point — that we can appeal to later.

The distinction is between a state and process theory; i.e., the difference between a normative principle that things may or may not conform to, and a process theory or hypothesis about how that principle is realized. Under this distinction, the free energy principle stands in stark distinction to things like predictive coding and the Bayesian brain hypothesis. This is because the free energy principle is what it is — a principle. Like Hamilton's principle of stationary action, it cannot be falsified. It cannot be disproven. In fact, there's not much you can do with it, unless you ask whether measurable systems conform to the principle. On the other hand, hypotheses that the brain performs some form of Bayesian inference or predictive coding are what they are — hypotheses. These hypotheses may or may not be supported by empirical evidence.

There are many examples of empirical evidence for these hypotheses.

Background

The notion that self-organizing biological systems — like a cell or brain — can be understood as minimizing variational free energy is based upon Helmholtz's work on unconscious inference and subsequent treatments in psychology and machine learning. Variational free energy is a functional of observations and a probability density over their hidden causes. This variational density is defined in relation to a probabilistic model that generates predicted observations from hypothesized causes. In this setting, free energy provides an approximation to Bayesian model evidence. Therefore, its minimization can be seen as a Bayesian inference process. When a system actively makes observations to minimize free energy, it implicitly performs active inference and maximizes the evidence for its model of the world.

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

### Relationship to other theories

Active inference is closely related to the good regulator theorem and related accounts of self-organization, such as self-assembly, pattern formation, autopoiesis and practopoiesis. It addresses the themes considered in cybernetics, synergetics and embodied cognition. Because variational free energy can be expressed as the expected energy of observations under the variational density minus its entropy, it is dual to the maximum entropy principle. Finally, because the time average of energy is action, the principle of minimum variational free energy is a principle of least action. Active inference — allowing for scale invariance — has also been applied in other domains. For instance, it has been applied to sociology, linguistics and communication, semiotics, and epidemiology, among others.

Negative free energy is formally equivalent to the evidence lower bound, which is commonly used in machine learning to train generative models, such as variational autoencoders.

Action and perception

Active inference applies the techniques of approximate Bayesian inference to infer the causes of sensory data under a generative model of how those data are caused and then uses these inferences to guide action. Bayes' rule characterizes the probabilistically optimal inversion of such a causal model, but applying it is typically computationally intractable, leading to the use of approximate methods. In active inference, the leading class of such approximate methods are variational methods, for both practical and theoretical reasons: practical, as they often lead to simple inference procedures; and theoretical, because they are related to underlying physical principles.

These variational methods proceed by minimizing an upper bound on the divergence between the Bayes-optimal inference (or posterior) and its approximation. This upper bound is the free energy. We can characterize perception as the minimization of the free energy with respect to inbound sensory information, and action as the minimization of the same free energy with respect to outbound action. This dual optimization is characteristic of active inference. The free energy principle underlies the hypothesis that all systems — which perceive and act — can be characterized in this way.

To apply the Bayesian mechanics of active inference, a generative model must be specified, and this typically involves a collection of probability density functions which together characterize the causal model. One such specification is as follows.

Definition: Active inference rests on the tuple (Ω,Ψ,S,A,R,q,p),

A sample space Ω from which random fluctuations ω∈Ω are drawn

Hidden states Ψ:A×Ω→ℝ – that cause sensory states and depend on action

Sensory states S:Ψ×A×Ω→ℝ – a mapping from action and hidden states

Action A:S×R→ℝ – that depends on sensory and internal states

Internal states R:S×Ω→ℝ – that cause action and depend on sensory states

Generative model p(s,ψ|m) – over sensory and hidden states, under a generative model, m

Variational density qμ(ψ) over hidden states ψ∈Ψ that is parameterized by internal states μ∈R

### Action and perception

The objective is to maximize model evidence p(s|m) or minimize surprise −log⁡p(s|m). This generally involves an intractable marginalization over hidden states, so surprise is replaced with an upper variational free energy bound. This means that internal states must also minimize free energy, because free energy is a function of sensory and internal states (i.e., the sufficient statistics of the variational density):

a(t)=argmina{F(s(a),μ)}

μ(t)=argminμ{F(s(a),μ)}

F(s,μ)⏟free−energy=Eq[−log⁡p(s,ψ|m)]⏟energy−H[qμ(ψ)]⏟entropy=−log⁡p(s|m)⏟surprise+DKL[qμ(ψ)||p(ψ|s,m)]⏟divergence≥−log⁡p(s|m)⏟surprise

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

### Self-organization

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

limT→∞1T∫0TF(s(t),μ(t))dt⏟free-action≥limT→∞1T∫0T−log⁡p(s(t)∣m)⏟surprisedt=H[p(s∣m)]

This is because 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 (in closed systems with detailed balance) and fluctuation theorems (in open systems with non-equilibrium steady state solutions).

### Bayesian inference

All Bayesian inference can be cast in terms of free energy minimization. When free energy is minimized with respect to internal states, the Kullback–Leibler divergence between the variational and posterior density over hidden states is minimized. This corresponds to approximate Bayesian inference — when the form of the variational density is fixed — and exact Bayesian inference, otherwise. Free energy minimization 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,μ)⏟free-energy=DKL[qμ(ψ)∥p(ψ∣m)]⏟complexity−Eq[log⁡p(s∣ψ,m)]⏟accuracy

Models with minimum free energy provide an accurate explanation of data, under complexity costs; cf. Occam's razor and more formal treatments of computational costs. 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 observed data).

### Thermodynamics

Variational free energy is an information-theoretic functional and is distinct from thermodynamic (Helmholtz) free energy. 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 minimized (because accuracy can be neglected). At this point, the system is at equilibrium and internal states minimize Helmholtz free energy, by the principle of minimum energy.

### Information theory

Free energy minimization is equivalent to maximizing the mutual information between sensory states and internal states that parameterize the variational density. This relates free energy minimization to the principle of minimum redundancy.

Neuroscience

Free energy minimization provides a useful way to formulate normative (Bayes optimal) models of inference and learning under uncertainty and therefore subscribes to the Bayesian brain hypothesis. The neuronal processes described by free energy minimization depend on the nature of hidden states: Ψ=X×Θ×Π that can comprise time-dependent variables, time-invariant parameters and the precision (i.e., inverse variance or temperature) of random fluctuations. Minimizing variables, parameters, and precision correspond to inference, learning, and the encoding of uncertainty (i.e., attention), respectively.

### Perceptual inference and categorization

Free energy minimization formalizes the notion of unconscious inference in perception and provides a normative (Bayesian) theory of neuronal processing. The associated process theory of neuronal dynamics is based on minimizing free energy through gradient descent. This corresponds to generalized Bayesian filtering (where ~ denotes a variable in generalized coordinates of motion and D is a derivative matrix operator):

μ~˙=Dμ~−∂μF(s,μ)|μ=μ~

Usually, the generative models that define free energy are nonlinear and hierarchical (like cortical hierarchies in the brain). Special cases of generalized filtering include Kalman filtering, which is formally equivalent to predictive coding; 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 that is consistent with the anatomy and physiology of sensory and motor systems.

### Perceptual learning and memory

In predictive coding, optimizing model parameters through a gradient descent on the time or path integral of free energy reduces to associative or Hebbian plasticity and can be associated with synaptic plasticity in the brain.

### Perceptual precision, attention and salience

Optimizing the precision parameters corresponds to optimizing the gain of prediction errors (cf., Kalman gain). In neuronally plausible implementations of predictive coding, this corresponds to optimizing the excitability of superficial pyramidal cells and has been interpreted in terms of attentional gain.

Yahya et al. applied the free energy principle to propose a computational model for template matching in covert selective visual attention that relies on SAIM. The deployment of attention — as precision weighting — can be conditioned on the inferred context, leading to nuanced distinctions between attentional gain and salience. Salience is usually associated with epistemic affordances — and expected information gain — as scored by expected free energy.

Active inference

When gradient descent is applied to action a˙=−∂aF(s,μ~), 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 — to movement trajectories.

Active inference under discrete models usually considers decision-making under uncertainty in terms of selecting actions from policies that minimize expected free energy. While variational free energy measures the fit between an agent's generative model and current sensory data, expected free energy (EFE) evaluates future outcomes under different possible action policies. In this setting, future outcomes become random variables and expected free energy as an expectation under the posterior predictive density qμ(ψ∣a), conditioned on action:

E(a,μ)⏟EFE=DKL[qμ(ψ∣a)∥p(ψ∣m)]⏟risk−Eq[log⁡p(s∣ψ,m)]⏟ambiguity

### Dual Formulations of EFE

Expected free energy can be decomposed in two equivalent ways, revealing how it balances the imperatives for motivated behavior:

1. Risk and Ambiguity

Risk (Kullback-Leibler divergence): The difference between the agent's predicted future and its prior preferences or goals (what it expects versus what it prefers).

Ambiguity: The uncertainty in the mapping from hidden states to observations (how noisy or unclear sensory input will be).

2. Extrinsic and Intrinsic Value

Extrinsic Value (Pragmatic Value): Fulfilling goals and seeking expected rewards. Mathematically, this aligns with expected utility in Bayesian decision theory.

Intrinsic Value (Epistemic Value): Information gain or curiosity. This drives the agent to resolve uncertainty and explore. This aligns with optimal Bayesian design.

Expected free energy naturally dissolves the exploration-exploitation dilemma — without ad-hoc bonuses — under one objective function. When removing prior preferences, active inference reduces to Bayesian optimal design (maximizing information gain or curiosity). Removing, epistemic value reduces to classical Bayesian decision theory (maximizing expected utility).

### 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. 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 that are specified with scalar V(x) and vector W(x) value functions of state space (cf., the Helmholtz decomposition). Here, Γ is the amplitude of random fluctuations and cost is c(x)=f⋅∇V+∇⋅Γ⋅V. The priors over flow p(x~∣m) induce a prior over states p(x∣m)=exp⁡(V(x)) that is the solution to the appropriate forward Kolmogorov equations. In contrast, optimal control optimizes the flow, given a cost function, under the assumption that W=0 (i.e., the flow is curl free or has detailed balance). Usually, this entails solving backward Kolmogorov equations.

### 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 policies, control sequences that minimize variational free energy lead to high utility states, in the spirit of control as inference or expected free energy in the spirit of planning as inference.

Neurobiologically, neuromodulators such as dopamine are considered to report the precision of prediction errors by modulating the gain of principal cells encoding prediction error. This is closely related to — but formally distinct from — the role of dopamine in reporting prediction errors per se and related computational accounts. In discrete formulations dopamine has been associated with the precision of Bayesian beliefs over policies.

### Cognitive neuroscience

Active inference has been used to address a range of issues in cognitive neuroscience, brain function and neuropsychiatry, including action observation, mirror neurons, saccades and visual search, eye movements, sleep, illusions, attention, action selection, consciousness, hysteria and psychosis. Explanations of [in]action in active inference often depend on the idea that the brain has 'stubborn predictions' that it cannot update, leading to actions that cause these predictions to come true.

Read on Wikipedia