At high temperature, the lattice forgets quickly.

One spin points up. Its neighbor points down. A few more flips and the picture looks different. There is no large object to preserve.

At low temperature, the lattice also has a simple kind of memory. Almost everything agrees with everything else. The magnet is mostly up or mostly down, and a single rebellious spin is usually swallowed by its neighbors.

The strange place is between.

At the critical point, the model is full of domains that are too large to be called noise and too fragile to be called phases. A local Monte Carlo update still proposes one spin flip at a time. The state, however, is no longer made of isolated spins in the way the algorithm hopes. It is made of correlated patches.

The sampler has the wrong hand size.

The Smallest Serious Magnet

The two-dimensional ferromagnetic Ising model puts a spin (\sigma_i\in{-1,+1}) on each site of a lattice. Neighboring spins prefer to agree. With no external field and with (J=k_B=1), the energy is

\[H(\sigma)=-\sum_{\langle i,j\rangle}\sigma_i\sigma_j.\]

At temperature (T), a configuration has probability proportional to

\[\exp(-H(\sigma)/T).\]

This is a tiny definition with a large afterlife. Duminil-Copin’s survey calls the Ising model a cornerstone of statistical mechanics and emphasizes the nearest-neighbor ferromagnetic lattice model as the classical case.1

The square-lattice model at zero field is unusually generous: it has exact answers. Onsager computed the free energy in 1944.2 C. N. Yang later computed the spontaneous magnetization.3 In the units above, the critical temperature is

\[T_c=\frac{2}{\log(1+\sqrt{2})} \approx 2.269185.\]

Below that temperature, the infinite-volume spontaneous magnetization is

\[m_\infty(T)= \left(1-\sinh^{-4}(2/T)\right)^{1/8}, \qquad T<T_c,\]

and it is zero at and above (T_c).

That formula is not just a curve. It is a warning about limits.

In a finite box with no magnetic field, the distribution is symmetric. The lattice can be mostly up, mostly down, or wandering between them. The spontaneous magnetization appears only after taking the thermodynamic limit in the right way. The browser lab below keeps the box finite on purpose, because finite boxes show the computational symptom vividly: memory.

The Local Move

The Metropolis update is beautifully direct.4

  1. Pick a spin.
  2. Compute the energy change (\Delta H) if it flips.
  3. Accept the flip with probability (\min(1,\exp(-\Delta H/T))).

For the Ising model, flipping one spin only asks about its four neighbors, so the move is cheap. That cheapness is why it is tempting to equate “many updates” with “many independent samples.”

Near (T_c), that equation breaks.

A proposed flip at the boundary of a domain may be accepted, but the domain is still there. A flip inside a large aligned patch is usually rejected or quickly undone by its neighborhood. The chain moves, yet a macroscopic feature keeps appearing in the mirror.

This is critical slowing down: the correlation length grows, and local dynamics need more time to decorrelate large-scale observables.

The problem is not that Metropolis is invalid. It targets the right distribution. The problem is that “right distribution eventually” is a weaker promise than “fresh information soon.”

The Cluster Move

Swendsen and Wang introduced a cluster approach for spin systems in 1987, and Wolff introduced a single-cluster version in 1989.56

The Wolff move changes the unit of motion:

  1. Pick a seed spin.
  2. Add same-aligned neighbors to its cluster with probability (p=1-\exp(-2/T)).
  3. Continue growing through newly added sites.
  4. Flip the whole cluster.

At high temperature, clusters are small. At low temperature, clusters can be huge. Near the critical point, the algorithm often grabs a correlated object whose size is comparable to the thing the local sampler was failing to move.

This is the lovely part. The algorithm does not merely accelerate the same one-spin story. It changes the vocabulary of the Markov chain so that its proposal can speak in domains.

A Finite Box With Two Memories

The lab uses a (48\times48) periodic square lattice by default. Both samplers start from the same initial spins and use the same touched-spin budget:

one Metropolis sweep = N proposed one-spin flips
one Wolff cluster    = however many spins the cluster touched

This is not a perfect cost model. A real implementation has queues, random number costs, memory traffic, and cache behavior. It is a useful normalization for the question here: if both methods are allowed to touch roughly the same number of spins, which one forgets the large-scale state faster?

The default temperature is T=2.27, just above the exact critical temperature. For the deterministic seed in the lab, the summary is:

T_c                  2.269185
T / T_c              1.00
Metropolis |m|       0.501
Wolff |m|            0.677
mean Wolff cluster   30.7% of the lattice
Metropolis accept    25.1%
|m| half-life        27 samples for Metropolis, 1 for Wolff
sign flips           1 for Metropolis, 43 for Wolff

Do not read the two final magnetizations as thermodynamic measurements. This is a small finite lattice, a short trace, and one seed. The thing to read is the memory. The local chain keeps the absolute magnetization correlated over many sample points. The cluster chain changes sign repeatedly because a large domain can be flipped as a unit.

The phase transition is not just a property of the model. It is also a stress test for the sampler’s proposal geometry.

The exact curve is the infinite-volume spontaneous magnetization. The two lattices are finite simulations with periodic boundaries, so sign changes and rounded transitions are expected rather than bugs.

What Changes When You Move the Temperature

Lower the temperature to around 1.6 and choose the all-plus start.

Metropolis becomes emotionally conservative. Almost every spin agrees with its neighbors, so many proposed flips are rejected. Wolff clusters, meanwhile, are often most of the lattice. A cluster flip changes the sign of the magnetization without changing the fact that the lattice is highly ordered. That is not a failure to preserve the physics. In zero field, the two signs are equally valid.

Raise the temperature to around 3.2 and choose the stripe start.

Both samplers forget quickly because the model itself has short-range correlations. Wolff clusters shrink. The fancy move loses its dramatic advantage because there is no large critical object to grab.

The interesting region is the one in between. Near (T_c), the model produces large, irregular domains, and the local proposal has to erode them from the edge. The cluster proposal can flip a whole connected patch. The difference is not merely speed. It is a difference in what each algorithm treats as a plausible elementary motion.

Detailed Balance Is Not Enough

It is easy to say “both chains are correct” and move on. That is true, but it misses the practical question.

For a Monte Carlo estimate, the price is not the number of states printed to a file. The price is the number of effectively independent states. A chain can have the right stationary distribution and still spend a long time walking through similar configurations.

This distinction shows up everywhere:

  • in Bayesian posteriors with funnels or ridges;
  • in protein and spin-glass energy landscapes;
  • in game-tree search when rollouts share the same early choices;
  • in finance simulations where rare regimes are sticky.

The Ising model is useful because the failure mode is visible. You can watch large black and white domains persist under local moves, and then watch a cluster update flip one.

The toy magnet is doing a serious pedagogical job.

A Caveat About the Word “Cluster”

The Wolff cluster is not an arbitrary connected component of equal spins. It is a random bond cluster. Same-aligned neighbors are linked with probability

\[p=1-\exp(-2/T),\]

and the resulting connected component is flipped. That probability is tuned to the Ising Boltzmann distribution. If you simply found every neighboring equal spin and flipped the whole component, you would not have the same Markov chain.

The move is nonlocal, but not casual. It earns its freedom by matching the statistical mechanics.

That is the broader lesson I like from cluster methods. Good proposals are not just larger proposals. They are larger proposals that respect the structure of the target distribution.

The Research Taste

When an algorithm slows down, I want to ask what object it is trying to move.

For Metropolis on an ordinary high-temperature Ising lattice, the object is almost a spin. For Metropolis near (T_c), the object is a domain, but the algorithm still holds tweezers. Wolff gives it a hand.

That sentence transfers.

If a sampler for a neural-network posterior changes one scalar weight at a time, but the posterior really moves along coordinated feature directions, the sampler has the wrong hand size. If a database optimizer changes one join order locally while the cost surface is organized by broad access patterns, the search has the wrong hand size. If a reinforcement-learning agent treats each action as local while the game has long tactical motifs, the planner may be making the same category error.

Criticality is a clean place to see the principle because the model tells the truth visually: when correlations grow, local motion becomes sticky.

The right move is not always a cluster flip.

But it is often a move that knows what a cluster is.

  1. Hugo Duminil-Copin, “The Ising model: a simple case study in statistical physics”, International Mathematical Union, 2022. PDF

  2. Lars Onsager, “Crystal Statistics. I. A Two-Dimensional Model with an Order-Disorder Transition”, Physical Review 65, 117-149, 1944. DOI

  3. C. N. Yang, “The Spontaneous Magnetization of a Two-Dimensional Ising Model”, Physical Review 85, 808-816, 1952. DOI; PDF

  4. Nicholas Metropolis, Arianna W. Rosenbluth, Marshall N. Rosenbluth, Augusta H. Teller, and Edward Teller, “Equation of State Calculations by Fast Computing Machines”, Journal of Chemical Physics 21, 1087-1092, 1953. PDF

  5. Robert H. Swendsen and Jian-Sheng Wang, “Nonuniversal critical dynamics in Monte Carlo simulations”, Physical Review Letters 58, 86-88, 1987. DOI

  6. Ulli Wolff, “Collective Monte Carlo Updating for Spin Systems”, Physical Review Letters 62, 361-364, 1989. DOI; PDF