Belief Propagation and Message Passing
Belief propagation computes exact probabilities in a graphical model without ever building the full joint distribution, by having each node pass small summary 'messages' to its neighbors and combining incoming messages into an updated belief — the same message-passing idea graph neural networks later borrowed.
Prerequisites: Bayesian Networks and Joint Factorization, D-Separation and Reading Independence Off a Graph
Given a Bayesian network factored into small local pieces, a natural next question is: what is the probability of some variable of interest, given evidence observed elsewhere in the network? Multiplying out the full joint distribution and marginalizing directly is exactly the astronomically large computation the factorization was supposed to avoid. Belief propagation solves this without ever forming the full joint: each node sends small "messages" — compact summaries of what it currently believes — to its neighbors, each node updates its own belief from the messages it receives, and after one pass through the graph every node holds the exact marginal probability it would have gotten from grinding through the whole joint distribution.
The analogy: passing a rumor down a line, but honestly
Imagine a line of people, each only able to talk to their immediate neighbors, trying to collectively figure out the probability of some event based on clues each person individually holds. Instead of everyone shouting their raw clue to everyone else (impossible in a large crowd), each person combines their own clue with whatever summary message their neighbor just handed them, then passes an updated summary further down the line. By the time a summary has traveled from one end of the line to the other and back, everyone holds a belief that correctly reflects everyone's clues combined — without any single person ever having heard every clue directly. Belief propagation is this process formalized: a message is a compact function (not the raw data), passed link by link, that mathematically guarantees the same exact answer as if everything had been computed jointly.
The message and belief update rules
A message from node to a neighboring node summarizes everything knows, excluding what it just heard from itself (to avoid double-counting):
In words: to tell what it believes about 's possible values, node takes its own local evidence , combines it with the compatibility function linking and , multiplies in every message has received from its other neighbors (everyone except , since already knows its own message), and sums out 's own possible values — the result is a function of alone, exactly the summary needs. Once every message has been passed, a node's final belief is the product of all incoming messages and its own local evidence:
In words: node 's final belief about its own value is proportional to its own evidence times every incoming message, combining everything the rest of the graph told it into one normalized probability.
Worked example 1: a 3-node chain by hand
Take the rain-train-late chain from Bayesian network factorization, with the same numbers: , , , , . To find with no evidence observed: the message from to is just 's marginal folded through the conditional, . This becomes 's belief: (so ). The message from to : . So — computed by passing two small messages down the chain, never touching a joint table over all three variables at once.
Worked example 2: updating the belief after evidence arrives
Now suppose you directly observe (you know for a fact the train was delayed). 's belief is now fixed at rather than the computed , and it sends a fresh message forward: . 's belief updates immediately to — a large jump up from the unconditional , computed simply by replacing one message with the new evidence and re-propagating, without recomputing anything about or re-deriving the whole joint distribution from scratch.
Each belief-propagation message is a function of one node's possible values, combined and squashed the same general way the curve above combines an input into a bounded probability-like output.
Belief propagation computes exact marginal probabilities by passing compact messages along a graph's edges and combining incoming messages at each node — it gets the same answer as brute-force joint-distribution marginalization, at a fraction of the computational cost, and updates cleanly when new evidence is observed.
What this means in practice
Exact belief propagation as described here is guaranteed correct only on graphs without cycles (trees, or chain-like structures); on graphs with loops, the same message-passing rules are still applied anyway — called loopy belief propagation — and while no longer exact, it converges to good approximations in practice and underlies decoding algorithms in communications (turbo codes, LDPC codes) as well as inference in financial graphical models like credit contagion networks. The message-passing idea itself was later generalized and borrowed directly by message-passing neural networks and GNNs, which replace belief propagation's exact probabilistic messages with learned vector messages — the algorithmic skeleton is the same.
Practice
- Recompute if instead , keeping all conditional probabilities the same.
- Explain in one sentence why belief propagation is only guaranteed exact on a graph with no cycles.
- After observing instead of , recompute 's updated belief.
The common confusion is assuming loopy belief propagation (running the same message-passing rules on a graph that has cycles) gives exact answers just because it usually gives reasonable answers in practice. On a graph with cycles, a message can circulate back around and get counted more than once, so the result is an approximation with no general correctness guarantee — it can even fail to converge at all on some graphs. Whether a given graph is a tree (exact) or has cycles (approximate at best) needs to be checked before trusting belief propagation's output as exact.
Related concepts
Practice in interviews
Further reading
- Pearl, Probabilistic Reasoning in Intelligent Systems (1988)
- Yedidia, Freeman & Weiss, Understanding Belief Propagation and Its Generalizations (2003)