Sampling Data with Chains of Forward-Backward Diffusion Steps

Hyunmo Kang, Noam Itzhak Levi, Corinna Elena Wegner, Daniel J. Korchinski, Matthieu WyartarXiv 2026

TL;DR

This paper introduces U-turn Markov chains (UTMC), a method that leverages local forward-backward diffusion steps to sample from learned data manifolds. The authors discover that small local steps cause the sampler to break ergodicity and get trapped in fragmented pockets of the data space, while larger noise steps restore ergodicity but trigger a counterintuitive "layer-ordering inversion" where high-level semantic features relax faster than low-level details.

What Problem Does This Paper Address?

Sampling from high-dimensional, multimodal distributions—like natural images or text—is a monumental challenge in machine learning. Data typically concentrates on complex, low-dimensional manifolds separated by vast regions of near-zero probability. While classical Markov chain Monte Carlo (MCMC) methods get trapped by these barriers, modern diffusion models excel at generating data globally by starting from pure noise.

However, standard diffusion models aren't designed for local exploration around a specific region of interest, nor can they easily sample from energy-modified targets (e.g., generating text with a specific sentiment or images with specific attributes). This paper addresses how to use diffusion models as local proposal mechanisms for MCMC sampling and explores the fundamental geometric and physical constraints governing how these chains mix and lose memory of their initial states.

Methods

The authors introduce and analyze U-turn Markov chains (UTMC) through both theoretical modeling and empirical probing:

  • U-turn Proposals: A single U-turn step takes a clean data point $x$, stochastically corrupts it by adding noise or masking tokens (the forward step), and then reconstructs a new sample $x'$ using a trained diffusion model (the reverse step). The magnitude of the perturbation is controlled by the noise fraction ($\rho$).
  • Metropolis-Hastings (MH) Steering: The authors prove that for an exact diffusion model, the U-turn kernel satisfies detailed balance. This allows UTMC to be paired with an MH correction to sample from biased target distributions of the form $P_H(x) \propto P(x)e^{-H(x)}$, where $H(x)$ is a user-defined energy function encoding desired attributes.
  • Random Hierarchy Model (RHM): To make the physics tractable, the authors utilize the RHM—a synthetic context-free grammar with a fixed tree topology. They use exact Belief Propagation (BP) as a Bayes-optimal denoiser to isolate the true data geometry from neural network approximation errors.
  • Layer-wise Activation Probing: To track how different levels of abstraction relax in real-world data, the authors measure the decorrelation of hidden representations at various depths of pre-trained models along the U-turn chain.
Figure 1: Left: A single U-turn move first corrupts a sample by adding noise or masking part of the input, then reconstructs it using a trained diffusion model. The U-turn magnitude controls the size of the perturbation. Middle: Iterating U-turn moves defines a Markov chain on the learned data distribution, allowing us to study whether the chain is ergodic. Right: Schematic of the Random Hierarchy Model, where visible tokens are generated from a hierarchy of latent variables through recursive production rules. This synthetic model provides a controlled setting for analyzing ergodicity and layer-wise relaxation.

Datasets

The study evaluates its predictions across three distinct domains:

  1. Synthetic Data: Hierarchical sequences generated via the Random Hierarchy Model (RHM).
  2. Natural Language: The Dolma dataset, using the LLaDA 7B MoE model as the masked diffusion language model and Mistral 7B residual-stream activations as the feature probe.
  3. Natural Images: ImageNet, using a pre-trained $256 \times 256$ guided-diffusion model and a pre-trained ConvNeXt-Base classifier as the visual feature probe.

Key Insights and Ideas

  • The Percolation Transition: When U-turn steps are minimal (small $\rho$), the chain moves along a local connectivity graph. If the underlying grammar or data structure is highly constrained (sparse), this graph fragments into isolated components. The sampler becomes non-ergodic, trapped forever in a local neighborhood of its initial state.
  • The Layer-Ordering Inversion: The most striking finding is how feature hierarchy dictates relaxation speed. In the local, non-ergodic regime, low-level features (pixels, individual tokens) change rapidly, while high-level features (semantics, abstract concepts) remain frozen. However, when the perturbation magnitude $\rho$ crosses a critical threshold, this behavior completely flips: deep semantic layers lose memory and relax faster than the shallow, low-level layers.
  • Universality of Data Geometry: This phase transition and relaxation inversion are not unique to synthetic models. The exact same dynamical signatures are observed empirically in both natural language and natural images, suggesting that hierarchical compositionality is a universal trait governing how diffusion models learn data manifolds.
Figure 3: Left: Dynamics of the RHM with L = 4, s = 2, f = 0.125 < fper. For these parameters, minimal UTMC is non-ergodic, but UTMC with larger U-turn steps progressively reduce the long- time plateau. Right: Phase diagram for s = 2, L = 8, showing the late-time plateau normalized by the standard deviation of the overlap between independent random pairs. Light pink regions are statistically indistinguishable from the ergodic baseline, while blue regions retain memory of the initial state. The black curve marks the inversion of layer-wise relaxation ordering. The values fper and finv are theoretical predictions for minimal UTMC with ρ = 1/d.

Key Results

  • Critical Slowing Down: In the synthetic RHM, the authors analytically predict and numerically verify a sharp peak in relaxation time near the percolation threshold ($f_{per} \approx 1/s$), a classic hallmark of phase transitions.
  • Text Relaxation: For minimal text U-turns ($\rho = 0.01$), mixing is incredibly slow, and deeper Mistral layers retain initial text memory significantly longer. When masking is increased to $\rho \ge 0.8$, the layer ordering sharply inverts, matching the theoretical phase diagram.
  • Image Relaxation: Similarly, on ImageNet, small noise fractions ($\rho = 0.1$) show early visual layers drifting rapidly while deep layers remain highly correlated. The integrated ordering gap inverts at a noise fraction of $\rho^* \approx 0.54$ (or $\rho^* \approx 0.68$ for a single-step diagnostic).

Limitations and Future Work

  • Denoising Error Accumulation: A major limitation with real-world models is that approximation errors accumulate over long U-turn trajectories. In text, this causes the generation quality to degrade, leading to an explosion in perplexity after roughly 300 cumulative masked tokens.
  • Simplistic Synthetic Assumptions: The RHM assumes a perfectly regular tree structure and uniform production rules. Real language features heavy-tailed (Zipf) distributions, context-dependent rules, and recursive grammar structures.
  • The Sampling Trade-off: The phase diagram reveals a challenging trade-off for practical applications: small steps explore locally but get trapped in isolated components, while large steps mix globally but lack the fine-grained resolution needed for delicate optimization or steering via $H(x)$. Developing methods to bridge this gap is a vital direction for future research.

Summary updated

BibTeX
@misc{kang2026sampling,
  author = {Hyunmo Kang and Noam Itzhak Levi and Corinna Elena Wegner and Daniel J. Korchinski and Matthieu Wyart},
  title = {{Sampling Data with Chains of Forward-Backward Diffusion Steps}},
  year = {2026},
  eprint = {2605.27006},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.27006},
}
Figure