Entropy 2025, 27, 62 8 of 33
divergence between the approximate posterior q(s) and the exact posterior, which is also
sometimes called the perceptual divergence:
DKL[q(s)∥p(s|o)] =∑
s
q(s) ln q(s)
p(s|o) (2)
It is a property of the KL divergence that the two distributions are identical when
DKL[q(s)∥p(s|o)] = 0. Minimising this divergence then corresponds to approximating
the exact posterior p(s|o) with q(s). We cannot evaluate this divergence directly since the
exact posterior is still unknown. We therefore replace the expression of the exact posterior
with the right-hand side of Equation (1). Note that here we use the joint likelihood p(o, s)
notation, fraction rule a
b
c
= a
b ∗ c and logarithmic rule ln(a ∗ b) =ln a + ln b:
∑
s
q(s) ln q(s)
p(o,s)
p(o)
= ∑
s
q(s) ln q(s)
p(o, s) + ln p(o) (3)
We can now rewrite the first term of the right-hand side as the KL divergence of the
approximate posterior from the joint likelihood, which is equal to the expression used in
Equation (2):
DKL[q(s)∥p(s|o)] =DKL[q(s)∥p(o, s)] +ln p(o) (4)
We now define theVFE (F[q(s), o]) as the KL divergence of the approximate posterior from
the joint likelihood. The VFE is only a function of q(s) and o (and the generative model m),
and we can therefore calculate it without knowing the model evidence p(o):
F ≜ DKL[q(s)∥p(o, s)] =∑
s
q(s) ln q(s)
p(o, s) (5)
The probability-weighted sum can be rewritten as an expectation, and the joint likelihood
can be decomposed into a prior and a likelihood:
F ≜ Eq(s)

ln q(s)
p(o, s)

= Eq(s)[ln q(s) − ln p(o|s) − ln p(s)] (6)
We can now combine our definition of VFE with Equation (4):
DKL[q(s)∥p(s|o)] =F[q(s), o] +ln p(o) (7)
Finally, we can reorganise this equation to show that the VFE is the sum of the divergence of
the approximation posterior and exact posterior (if we could perform exact inference, this is
what we would obtain) and the surprise ℑ = −ln(p(o)) (the negative log model evidence):
F[q(s), o] =DKL[q(s)∥p(s|o)]| {z }
Divergence
−ln p(o)| {z }
Surprise
(8)
Since the KL divergence is non-negative, the VFE becomes an upper bound on the surprise:
F[q(s), o] ≥ −ln p(o) (9)
By rearranging the parts of this expression, we can express the VFE as a balance between
the complexity and accuracy, where the accuracy is how well the model predicts observa-
tion, and the complexity is how much the beliefs need to change in order to maintain a
high accuracy: