Mean-Field Approximation
Pretend every hidden variable decides on its own, ignoring the others, so a tangled joint posterior becomes a product of simple pieces you can update one at a time.
Why Does This Exist?
Posteriors couple everything to everything. In a mixture model the cluster assignment of point 7 depends on the means, which depend on all the other assignments. In an Ising model each spin feels its neighbours. Exact inference sums over every joint configuration, and that sum has one term per combination: 2 hidden bits is 4 terms, 100 bits is about terms. Nobody sums that.
Expectation-maximization dodges the sum when the exact conditional over the hidden variables is available in closed form. Often it is not. Mean-field variational inference is the fallback with a guarantee: pick the closest distribution inside a tractable family, where closeness is KL divergence, and climb a lower bound instead of the true evidence. This page teaches the family and the coordinate climb. The bound itself is background in Bayesian inference.
The one idea you need first
For any distribution over hidden variables , . The ELBO is computable without the true posterior, and pushing it up pushes toward the posterior. Mean-field is the choice of which family to push inside.
Think of It Like This
A seating chart decided by independent ballots
A wedding planner must seat 100 guests with tangled friendships. The exact solution considers every seating at once. The mean-field planner does something humbler: each guest independently picks a table distribution, ignoring what any specific other guest does, and only responding to the average behaviour of the rest.
Round by round, guest 1 updates against the current averages of guests 2 through 100, then guest 2 updates, and so on. Nobody ever reasons about a joint seating. The plan converges to tables that are good on average, but it can never represent "Alice and Bob must sit together or both leave": that statement is about correlation, and independent ballots cannot say it.
Where the analogy stops: real mean-field factors are distributions with parameters, and the update is an exact expectation under the other factors, not a vote.
How It Actually Works
Write the hidden variables as and restrict to factorize:
In plain words: each hidden piece gets its own distribution, and the joint is their product. No correlations survive: under , learning tells you nothing about . That is the whole approximation, and everything good and bad about mean-field flows from it.
Holding all factors except fixed, the ELBO is maximized by
where means all factors except . In plain words: set factor from the average log-joint, averaging over everyone else's current beliefs. Cycling is coordinate-ascent variational inference (CAVI). Each step raises the ELBO, so the procedure converges to a local optimum of the bound, exactly like EM converges to a local optimum of likelihood.
Worked example
Two binary variables with joint table , , , . Use and start both at .
Fix and update factor 1. The log-odds under the optimal is the averaged log-ratio:
Substituting : . So .
One coordinate step moved the first factor from to , leaning toward 1 because three of the four table entries by mass favour . Continuing to alternate settles near . The true marginals are and : close on means, while the true correlation between the variables is silently dropped, which is the next section's warning.
Watch Out For
Trusting the reported uncertainty
Mean-field posteriors are systematically overconfident. Because cannot represent correlation, it picks one mode and reports that mode's width as the whole uncertainty, exactly like variational inference under-reports in the Bayesian inference page. A mean-field logistic regression can report 99 percent confidence on weights whose true posterior spans a wide correlated ridge.
Symptom: decisions that need calibrated uncertainty (active learning, bandits, safety checks) fail while point predictions look fine. Fix: read only the means from mean-field, and get uncertainty from MCMC, a full-rank Gaussian, or at least a structured factorization that keeps the important correlations.
Strong coupling stalls or flips the coordinate updates
When variables are tightly coupled, updating one at a time crawls: each factor's optimum barely moves given the others, so CAVI takes tiny steps along a narrow valley. Worse, with symmetric multimodality (two equally good explanations), the initialization decides the mode and the updates never visit the other.
Symptom: different random starts land on qualitatively different factorizations with similar ELBOs. Fix: run several starts and keep the best bound, consider damping the updates, and if two variables are nearly locked together, merge them into one joint factor (structured mean-field) instead of factorizing across the lock.
The Quick Version
- Mean-field replaces with a product , deleting all correlations by construction.
- Each factor updates from the averaged log-joint under the other factors, and cycling them (CAVI) climbs the ELBO to a local optimum.
- On the worked table, one update moves from 0.50 to 0.71, near the true marginal 0.70.
- Means are usually decent; variances and correlations are not: expect overconfidence.
- Strongly coupled variables need joint factors, multiple starts, or a richer family.