Quiz: sampling, temperature and the phase transition

Short questions to test your understanding. Try each on paper first, then open the answer. Local field u_p = J\sum_{q \sim p}s_q + h; p(s_p = +1 \mid \text{neighbours}) = 1/(1 + e^{-2u_p/T}); J = 1, h = 0 unless stated.


Q1. Why can a sampler update one pixel without knowing Z?

Compare the two states that differ only in that pixel.

The update only needs the ratio of the probabilities of two states that differ in one pixel, e^{-\Delta E/T}, and Z cancels in a ratio. \Delta E involves only the pixel and its neighbours.


Q2. A pixel’s four neighbours are all +1. At T = 2, what is the probability that the Gibbs sampler sets it to -1?

u_p = 4.

1 - 1/(1 + e^{-4}) = 1/(1 + e^{4}) = 0.018. Rare, but it happens: at T = 2 an aligned region still has a few isolated flipped pixels.


Q3. In Metropolis, a proposed flip raises the energy. Is it always rejected? Why does that matter?

What would the algorithm do if it only went downhill?

No: it is accepted with probability e^{-\Delta E/T}. Without uphill moves the chain would only descend and stop in the nearest local minimum (that is ICM, next unit); with them it visits states in proportion to their Gibbs probability.


Q4. What is detailed balance, in words?

Think of traffic between two states after the chain has run for a long time.

In the long run, the chain moves from state a to state b exactly as often as from b to a: \pi_aP_{ab} = \pi_bP_{ba}. A chain built this way keeps \boldsymbol\pi unchanged, so if it converges at all, it converges to \boldsymbol\pi. Metropolis is built so that this holds for the Gibbs distribution.


Q5. A sampler is started from a noisy image. Why do we throw away the first sweeps, and why are 1000 kept sweeps worth less than 1000 independent samples?

Where does the chain start, and how much does one sweep change?

The start is not a typical state of the distribution; the first sweeps (the burn-in) still remember it. And consecutive states share most pixels: they are strongly correlated, so averages over them converge more slowly than over independent samples.


Q6. Describe a typical state of a large 2D Ising lattice below, at and above T_c \approx 2.27.

Think of domain sizes and of |m|.

Below: one sign dominates, with small islands of the other (|m| near 1). At T_c: clusters of all sizes, a fractal-looking pattern. Above: fine-grained noise with small clusters (m \approx 0).


Q7. Why is a 1D chain never ordered at T > 0, while a 2D lattice is below T_c?

What does it cost to cut a domain in two?

In 1D one disagreeing pair (cost 2J) splits a chain into two domains, and there are many places to put it: at any T > 0 walls appear with a finite density and the signs average out. In 2D a wall around a domain costs energy proportional to its length; below T_c that cost beats the number of ways to draw the wall, and large domains are stable.


Q8. Simulated annealing is cooled too fast (a quench). What typically goes wrong?

What can the lattice still do at very low T?

Domains form everywhere at once and freeze: at low T only downhill flips are accepted, so walls that would need an uphill flip to move stay forever. The result is a local minimum, not the ground state.


Q9. (math) Show that the Metropolis rule satisfies detailed balance for the Gibbs distribution when E_b > E_a and the proposal is symmetric.

P_{ab} = q\,e^{-(E_b - E_a)/T} and P_{ba} = q (downhill is always accepted). Then \pi_aP_{ab} = \frac{e^{-E_a/T}}{Z}q\,e^{-(E_b - E_a)/T} = \frac{e^{-E_b/T}}{Z}q = \pi_bP_{ba}.