§17.5 The challenge of mixing between separated modes
MCMC’s central weakness is slow mixing slow mixing When successive Markov-chain samples stay highly correlated and fail to visit modes in proportion to probability; the chain gets stuck in one mode instead of exploring. defined in ch. 17 — open in glossary . Ideally successive samples would be independent and visit regions of in proportion to their probability. Instead — especially in high dimensions — they become strongly correlated. A Gibbs chain behaves like noisy hill-climbing on probability (noisy gradient descent on energy): it takes small steps that mostly lower the energy, so once it finds a mode mode (of a distribution) A region of high probability / low energy (e.g. a connected manifold of similar images) around which a Markov chain tends to random-walk. defined in ch. 17 — open in glossary (a region of low energy — say, a connected manifold of images of one object) it random-walks within that mode and only rarely escapes.
Whether it can escape is governed by the energy barrier energy barrier A region of low probability / high energy separating two modes; transitions across a high barrier are exponentially unlikely, causing slow mixing. defined in ch. 17 — open in glossary between modes: crossing a barrier of height is exponentially unlikely in . When high- probability modes are separated by wide low-probability valleys — exactly the structure of a distribution with one manifold per class — the chain stays put far longer than it should. See all three regimes of the book’s figure 17.1, and use the temperature slider to break out of the trapped case:
Two modes separated by an energy barrier: at β = 1 the chain gets stuck in one mode (few or no switches). Lower β to temper — the peaks flatten and it starts hopping between modes.
Worked example — why Gibbs won’t flip a sign
Take a two-variable EBM with and : a strong belief (large ) that and share a sign. A Gibbs update of given draws from . For that is ; for , . So with , almost certainly stays — and symmetrically stays given . Both all- and all- are equally probable under the model, yet a one-variable-at-a-time chain almost never flips between them. The two modes are effectively disconnected.
The problem is sharpest for latent-variable models, where we alternate sampling and . Good mixing wants to have high entropy (so can wander); a useful representation wants to carry high mutual information with (so it pins down). These pull in opposite directions — the sharper a Boltzmann machine’s learned distribution, the worse it mixes:
§17.5.1 Tempering to mix between modes
If the peaks are too sharp, flatten them. Energy-based models make this trivial: add an inverse-temperature to the energy.
Tempering an energy-based model (eqs 17.25–17.26)
| the reciprocal temperature, β = 1/T (a physics inheritance). Models are trained and used at β = 1 | scalar > 0 | |
| colder: the distribution sharpens toward its modes, becoming deterministic as β → ∞ | sharper | |
| hotter: the peaks flatten and valleys fill in; as β → 0 the distribution becomes uniform — trivially easy to mix. This is what tempering exploits | flatter |
Tempering tempering Flattening a distribution via p_β(x)∝exp(−βE(x)) with β<1 (β=1/temperature) so a chain can mix between modes more easily; e.g. tempered transitions, parallel tempering. defined in ch. 17 — open in glossary mixes between the modes of by drawing samples at , then relating them back to . Two schemes — tempered transitions and parallel tempering parallel tempering Running many chains at different temperatures simultaneously and stochastically swapping states, so high-temperature chains that mix freely feed the temperature-1 chain. defined in ch. 17 — open in glossary — differ in how the temperatures are arranged:
| Method | How it mixes | |
|---|---|---|
| Tempered transitions | tempered transitions (one chain) | temporarily heat up to jump modes, then cool back to β = 1 |
| Parallel tempering | parallel tempering (many chains) | chains at many temperatures swap states; hot chains feed the cold one |
Tempering helps but has not cracked the problem: there are critical temperatures around which the temperature must be changed very slowly for tempering to work, which is expensive.
§17.5.2 Depth may help mixing
There is a structural fix hinted at by representation learning. If encodes too precisely, sampling barely moves and mixing fails. But make a deep representation and the chain in -space can mix more easily: autoencoders and RBMs tend to produce a marginal over that is more uniform and more unimodal than the data distribution over — plausibly because minimizing reconstruction error while using all of representation space spreads the training examples out, well-separated, in -space. Bengio et al. (2013a) found that deeper stacks yield top-level marginals that are more spread out, with smaller gaps between the regions for different modes (classes), so Gibbs sampling in that higher space mixes faster between modes. How best to exploit this remains open.
Despite the mixing difficulty, Monte Carlo methods are often the best tool available — and they are the primary weapon against the intractable partition function of undirected models, the subject of chapter 18.
Check yourself — mixing, tempering & depth
1.Why does a Gibbs chain get stuck in one mode of a multi-modal distribution?
2.In the EBM E(a,b) = −w·ab with a,b ∈ {−1,+1} and large w, why won't Gibbs flip the signs?
3.How does tempering, p_β(x) ∝ exp(−βE(x)), make mixing easier?
4.In a latent-variable model, why is there a tension between mixing and representation quality?
5.Predict the outcome — in MixingLab you pick 'separated modes', run at β = 1, then drop β to 0.4 and run again. What changes?