Module 2 produced messages. This lecture reads them: variable and factor beliefs, an exact product formula for on a tree, the Bethe free entropy that continues that formula off the tree, and the iterative algorithm used on loopy graphs. The zero-temperature limit is min-sum — Bellman dynamic programming run as if every neighbourhood were a tree.

Marginals from messages

Once the messages of Theorem 2.2 are known, the marginal at a variable is its field times all the incoming factor beliefs:

The pair (or higher) marginal on a factor is

On a tree both are exact after one leaves-to-root sweep. The same formulae will be used on loopy graphs; they then define the BP beliefs, not the true marginals.

The partition function as a product

Rooting at gave . We want a form in the normalized messages that does not depend on the root. Define three local partition functions:

Theorem 3.1 (Product formula for Z).

On a tree,

Adding a variable node multiplies by ; adding a factor multiplies it by ; every edge is then counted twice — once from each end — so each must be divided out once.

The Bethe free entropy

Taking the logarithm of defines the Bethe free entropy

On a tree this equals , by Theorem 3.1. On a general graph one still defines by , evaluated at a fixed point of Theorem 2.2. Three facts make this the central object of the subject:

  1. BP fixed points are exactly the stationary points of under the message normalizations (Homework, and the collapsed argument below).
  2. When BP has several fixed points, the physically correct one is the global maximizer of (minimizer of the free energy).
  3. is asymptotically exact on locally tree-like graphs in the replica-symmetric phase.

The tension between (1) and (2) — BP finds a stationary point, but not necessarily the global one — is taken up at the end of Module 4.

Loopy BP

On a tree, Theorem 2.2 is a definition, not an iteration: sweep once from leaves to root. On a graph with loops there is no leaf to start from, so the same equations are turned into a fixed-point iteration. Initialize all messages, then update them repeatedly (in parallel, or in random sequential order) until they stop changing:

Typical initializations: (i) the prior ; (ii) the prior plus a small random perturbation; (iii) fully random; (iv) planted, , biased toward a known configuration.

The iteration need not converge, and when it does it may reach different fixed points from different initializations. Two practical controls:

  • Damping. Replace a parallel update by . Undamped parallel BP oscillates on antiferromagnets and frustrated loops; damping or sequential updates often restore convergence.
  • -annealing. At large a cold start rarely converges. Run BP as the inner loop of a geometric schedule, reusing the previous fixed point.

When local neighbourhoods are tree-like and correlations decay, the loopy iteration nonetheless returns asymptotically exact marginals and free entropy — that is Figure 1.4 plus decaying correlations.

The gadget below runs pairwise Ising BP on a path (a tree: exact after one sweep) versus a 4-cycle (a loop: approximate, and able to oscillate). Exact marginals are the 16-configuration brute force.

Optimization: max-product and min-sum

For optimization we care about , where concentrates on minimizers of . Writing every message in the log domain, and , and using , the sum-product rules become the min-sum (also called max-product) equations

Here , , and the messages are min-marginals: is the minimum energy of the amputated subtree above with fixed.

On a tree this computes and a minimizer exactly — it is Bellman’s dynamic-programming recursion, or the Viterbi algorithm, written on the factor graph. On loopy graphs it is the workhorse of LP decoding and of the survey-propagation family.

Note 3.1 (One idea, two failures).

Min-sum is Bellman DP run on the interaction graph as if every neighbourhood were a tree: per sweep, and wrong once per short cycle. Two contract differences with local search are easy to miss. First, message passing produces beliefs, not incumbents: at no point does it hold a configuration whose energy could be reported. Turning beliefs into an assignment is a separate step (decimation, reinforcement, rounding). Second, exact contraction of the same factors — variable elimination in a good order — is the same recursion made exact, at cost . Every method between BP and exact inference picks a point between those poles.

Raise in the gadget above to watch sum-product concentrate onto min-sum: the beliefs sharpen into decisions, and on the cycle they can start to disagree with the true MAP.

Other routes to the same equations

The tree recursion explains why BP is exact on trees. Three other derivations explain what it optimizes, how to average it over a random ensemble, and when it breaks. They produce the same fixed-point equations. Details are collapsed; we will not need the algebra in Module 4.

Next: BP for combinatorial optimization.