8.7 The free-energy principle, honestly

Karl Friston’s free-energy principle (FEP) is the most ambitious framework in this space. It claims that any self-organizing system that maintains its existence over time must, mathematically, minimize a quantity called variational free energy, which approximates the negative log-evidence of its sensory observations under its generative model. Under the FEP, perception, action, learning, and even biological homeostasis are all special cases of free-energy minimization.

The variational free energy can be written, for a system with hidden states θ\theta and observations SS and a generative model p(θ,S)p(\theta, S) and a recognition distribution q(θ)q(\theta), as

F=Eq[logq(θ)]Eq[logp(θ,S)]=KL(q(θ)p(θS))logp(S).F = \mathbb{E}_q[\log q(\theta)] - \mathbb{E}_q[\log p(\theta, S)] = \mathrm{KL}\bigl(q(\theta) \,\Vert\, p(\theta | S)\bigr) - \log p(S).
Derivation: variational free energy as a bound on negative log-evidence

Suppose we want to compute the log-evidence logp(S)\log p(S) for our observations SS under a generative model p(θ,S)=p(Sθ)p(θ)p(\theta, S) = p(S|\theta) p(\theta). This is the quantity we’d like to maximize — it tells us how well our model explains the data.

Computing logp(S)=logp(θ,S)dθ\log p(S) = \log \int p(\theta, S) d\theta exactly requires integrating over all hidden states θ\theta, which is intractable.

Introduce an approximate posterior q(θ)q(\theta), our best current guess at p(θS)p(\theta|S). Multiply and divide inside the integral by q(θ)q(\theta):

logp(S)=logq(θ)p(θ,S)q(θ)dθ=logEq ⁣[p(θ,S)q(θ)].\log p(S) = \log \int q(\theta) \cdot \frac{p(\theta, S)}{q(\theta)} d\theta = \log \mathbb{E}_q\!\left[\frac{p(\theta, S)}{q(\theta)}\right].

By Jensen’s inequality (log is concave), logE[X]E[logX]\log \mathbb{E}[X] \geq \mathbb{E}[\log X]:

logp(S)Eq ⁣[logp(θ,S)q(θ)]=Eq[logp(θ,S)]Eq[logq(θ)].\log p(S) \geq \mathbb{E}_q\!\left[\log \frac{p(\theta, S)}{q(\theta)}\right] = \mathbb{E}_q[\log p(\theta, S)] - \mathbb{E}_q[\log q(\theta)].

This lower bound is the evidence lower bound (ELBO). The variational free energy is its negative:

F=ELBO=Eq[logq(θ)]Eq[logp(θ,S)].F = -\text{ELBO} = \mathbb{E}_q[\log q(\theta)] - \mathbb{E}_q[\log p(\theta, S)].

Then FF is an upper bound on negative log-evidence: Flogp(S)F \geq -\log p(S), with equality when q(θ)=p(θS)q(\theta) = p(\theta|S).

Equivalently, FF can be rewritten as

F=KL(q(θ)p(θS))logp(S),F = \mathrm{KL}\bigl(q(\theta)\, \Vert\, p(\theta|S)\bigr) - \log p(S),

making it the Kullback-Leibler divergence between the approximate and true posteriors, minus log-evidence. Minimizing FF does two things: (i) brings qq closer to the true posterior, (ii) maximizes log-evidence (model fit).

In the FEP, the brain is hypothesized to perform inference and learning by minimizing variational free energy. Perception minimizes FF over qq (refining the posterior); action minimizes FF over observations SS (changing the world to match predictions). ∎

The first term is the Kullback-Leibler divergence between the recognition distribution and the true posterior — a measure of how good the brain’s approximation is. The second term is the negative log-evidence. Minimizing FF is mathematically equivalent to (a) bringing the recognition distribution closer to the true posterior, and (b) maximizing the evidence the model has for its observations.

This is, with the right interpretation, a perfectly reasonable framework. It contains predictive coding as a special case (a Gaussian approximation under particular assumptions). It is also the subject of substantial criticism, ranging from claims of unfalsifiability (Bowers & Davis 2012, in Psychological Bulletin) to concerns about how the principle is operationalized in different contexts. I will not adjudicate this controversy here. The principle is productive — it has generated useful predictions and useful theory — and it is also not yet a settled brain theory in the way that, say, the wave equation is a settled equation. Treat it as a research program, not a result.