---
title: 'Flow-Matching MCMC: Adaptive Global Sampling'
url: https://www.emergentmind.com/topics/flow-matching-markov-chain-monte-carlo-fm-mcmc
type: topic
---

# Flow-Matching MCMC: Adaptive Global Sampling

Searching arXiv for papers on Flow-Matching MCMC and closely related methods.
Flow-Matching Markov Chain Monte Carlo (FM-MCMC) denotes a class of hybrid samplers that embed a flow-matching-trained continuous normalizing flow within a Markov chain Monte Carlo procedure, so that a learned transport supplies non-local proposals while MCMC preserves exact target invariance. In the formulation introduced in "Markovian Flow Matching: Accelerating MCMC with Continuous Normalizing Flows" [2405.14392], the target is an unnormalized density $\pi(x)=\hat\pi(x)/Z$, the flow is adapted on-the-fly from samples produced by the chain, and the resulting sampler combines a local Markov transition kernel with a non-local, flow-informed transition kernel. The method is motivated by the inefficiency of conventional local samplers on high-dimensional, rugged, and especially multimodal targets, and by the possibility of using flow matching as a comparatively inexpensive way to learn global transport structure [2405.14392].

## 1. Formal setting and defining construction

In FM-MCMC, a time-dependent vector field $v_t$ defines a continuous normalizing flow $\phi_t$ through the ODE
$$
\frac{\mathrm{d}}{\mathrm{d}t}\phi_t(x)=v_t(\phi_t(x)),\qquad \phi_0(x)=x,
$$
with induced probability path $p_t=[\phi_t]_\sharp p_0$. Along this path, the instantaneous change-of-variables formula is
$$
\log p_t(x_t)=\log p_0(x)-\int_0^t \nabla\cdot v_s(x_s)\,\mathrm{d}s, \qquad x_s:=\phi_s(x).
$$
The distinctive move made by FM-MCMC is not to use the CNF as a standalone approximate generator, but to use it inside an MCMC kernel as a learned proposal mechanism. In the primary formulation, the sampler alternates a local kernel $Q$ with a non-local flow-informed kernel $P$, and the combined transition is written as
$$
R:=P\circ Q,
$$
or explicitly,
$$
R(x,\mathrm{d}y;\pi,\theta)=\int Q(x,\mathrm{d}z;\pi)\,P(z,\mathrm{d}y;\pi,\theta).
$$
Operationally, the algorithm performs $k_Q$ local steps with $Q$ and then one flow-informed step with $P$ [2405.14392].

This construction places FM-MCMC between two established paradigms. It is not standard MCMC, because the proposal mechanism is learned rather than fixed or hand-designed. It is also not a pure flow sampler, because every global proposal is Metropolized. A plausible implication is that FM-MCMC should be understood less as a replacement for MCMC than as an adaptive transport-enhanced MCMC architecture.

## 2. Flow matching objective and conditional probability paths

The learning component is based on flow matching. The classical objective is
$$
\mathcal{L}(\theta;\pi) = \mathbb{E}_{t\sim \mathcal{U}(0,1)} \mathbb{E}_{x\sim p_t} \left[\|v_t^\theta(x)-v_t(x)\|_2^2\right],
$$
but because the target vector field is unavailable, the method uses the conditional flow matching objective
$$
\mathcal{J}(\theta;\pi) = \mathbb{E}_{t\sim\mathcal{U}(0,1)} \mathbb{E}_{x_1\sim\pi} \mathbb{E}_{x\sim p_t(\cdot|x_1)} \left[\|v_t^\theta(x)-v_t(x|x_1)\|_2^2\right].
$$
For the conditional path, the paper uses the optimal-transport path from Lipman et al., with
$$
m_t(x_1)=t x_1,\qquad s_t(x_1)=1-(1-\sigma_{\min})t,
$$
so that
$$
p_t(x|x_1)=\mathcal N\!\left(x\mid m_t(x_1),s_t(x_1)^2 I_d\right),
$$
and
$$
v_t(x|x_1)=\frac{x_1-(1-\sigma_{\min})x}{1-(1-\sigma_{\min})t}.
$$
Equivalently,
$$
\phi_t(x|x_1)=(1-(1-\sigma_{\min})t)x+t x_1.
$$
This yields the Monte Carlo estimator
$$
\mathcal{J}(\theta;\{x^i(k)\}_{i=1}^N,\sigma_{\min}) = \frac1N\sum_{i=1}^N \left\| v_{t_i}^\theta\!\big(\phi_{t_i}(x_0^i\mid x^i(k))\big) - v_{t_i}\!\big(\phi_{t_i}(x_0^i\mid x^i(k))\mid x^i(k)\big) \right\|_2^2,
$$
where $x_0^i\overset{\mathrm{i.i.d.}{\sim}p_0$ and $t_i\sim\mathcal U(0,1)$ [2405.14392].

The defining feature here is that the conditional targets $x_1\sim\pi$ are not assumed to be available as i.i.d. samples beforehand. Instead, the chain itself produces the samples used to train the flow. This gives FM-MCMC its adaptive, self-referential character: the MCMC component supplies pseudo-target samples, and those samples in turn refine the proposal flow [2405.14392].

## 3. Hybrid transition kernels and exactness through Metropolization

The local transition kernel $Q$ is a standard gradient-based MCMC kernel. In the reported experiments it is MALA:
$$
Q(x,\mathrm{d}y;\pi)=\alpha(x,y)\,q(\mathrm{d}y|x)+(1-b(x))\delta_x(\mathrm{d}y),
$$
with proposal density
$$
q(\mathrm{d}y|x)\propto \exp\!\left( -\frac{1}{4\tau}\|y-x-\tau\nabla\log\pi(x)\|^2 \right)\mathrm{d}y,
$$
and acceptance probability
$$
\alpha(x,y)=\min\left\{1,\frac{\pi(y)q(x|y)}{\pi(x)q(y|x)}\right\}.
$$
The non-local kernel $P$ is a flow-informed random-walk Metropolis-Hastings kernel:
$$
P(x,\mathrm{d}y;\pi,\theta) = \alpha(x,y)\,\rho_\theta(\mathrm{d}y|x)+(1-b(x))\delta_x(\mathrm{d}y),
$$
where $\rho_\theta(\mathrm{d}y|x)$ is induced by mapping the current state backward through the learned flow to reference space, perturbing there with a Gaussian random walk, and mapping forward again. Concretely,
$$
x_0=x+\int_1^0 v_t^\theta(\phi_t^\theta(x))\,\mathrm{d}t, \qquad y_0\sim \mathcal N(x_0,\sigma_{\mathrm{opt}}^2 I), \qquad y=y_0+\int_0^1 v_t^\theta(\phi_t^\theta(y_0))\,\mathrm{d}t.
$$
The Metropolis-Hastings acceptance probability is
$$
\alpha(x,y)=\min\left\{1,\frac{\pi(y)\rho_\theta(x|y)}{\pi(x)\rho_\theta(y|x)}\right\}.
$$
The appendix also gives the optimal proposal scale
$$
\sigma_{\mathrm{opt}}=\frac{2.38}{\sqrt d}.
$$
A corresponding pullback relation is
$$
\log [\phi_1^\theta]^\sharp \pi(x_0) = \log \pi(\phi_1^\theta(x_0)) - \int_1^0 \nabla\cdot v_t^\theta(\phi_t^\theta(x_0))\,\mathrm{d}t.
$$
These formulas show how the learned CNF supplies non-local proposals without sacrificing exact invariance of the target [2405.14392].

This hybridization is the central reason FM-MCMC differs from direct flow-based generation. The flow is not trusted unconditionally; it is embedded in a correction mechanism. That design choice also situates FM-MCMC alongside earlier flow-plus-MCMC hybrids, including "MetFlow: A New Efficient Method for Bridging the Gap between Markov Chain Monte Carlo and Variational Inference" [2002.12253], where proposals are obtained using normalizing flows inside a Metropolis-Hastings framework.

## 4. Adaptive training, tempering, and theoretical guarantees

FM-MCMC is fully sequential. At iteration $k$, after generating particles $x_k^i$ using the current kernel, the flow parameters are updated by
$$
\theta_k=\theta_{k-1}+\varepsilon_k \nabla_\theta \mathcal{J}\!\left(\theta_{k-1}\mid \{x_k^i\}_{i=1}^N,\sigma_{\min}\right).
$$
The particle system is therefore both the sampling state and the training dataset. In the theoretical analysis, the chain distribution at iteration $k$ is written as
$$
\mu_k := \mu_0 R^k(\cdot,\cdot;\pi,\theta),
$$
and the FM objective is estimated with $\mu_k$ in place of $\pi$:
$$
\mathcal{J}(\theta;\mu_k) = \mathbb{E}_{t\sim\mathcal U(0,1)} \mathbb{E}_{x_1\sim \mu_k} \mathbb{E}_{x\sim p_t(\cdot|x_1)} \left[\|v_t^\theta(x)-v_t(x|x_1)\|_2^2\right].
$$
To address mode discovery in strongly multimodal settings, the method introduces adaptive tempering. For Bayesian targets of the form
$$
\pi(x)\propto \mathcal L(\mathcal D|x)\pi_0(x),
$$
it targets annealed distributions
$$
\eta_t(x)\propto \mathcal L(\mathcal D|x)^{\beta_t}\pi_0(x), \qquad 0=\beta_0<\beta_1<\cdots<\beta_T=1.
$$
The next temperature is chosen by fixing an ESS fraction $\alpha$ of the particle count $N$:
$$
\beta_t = \inf\left\{ \beta_{t-1}<\beta\le 1: \frac{ \left[\frac1N\sum_{i=1}^N w_i^{\beta_{t-1}(\beta)}\right]^2 }{ \frac1N\sum_{i=1}^N \left(w_i^{\beta_{t-1}(\beta)}\right)^2 } =\alpha \right\},
$$
with
$$
w_i^{\beta_{t-1}(\beta)}=\mathcal L(\mathcal D|x)^{\beta-\beta_{t-1}}.
$$
Empirically, this mechanism is reported as essential for discovering separated modes [2405.14392].

The main theoretical guarantee is a stochastic approximation convergence result. If the step sizes satisfy the Robbins-Monro conditions
$$
\sum_{k=1}^\infty \varepsilon_k=\infty, \qquad \sum_{k=1}^\infty \varepsilon_k^2<\infty,
$$
and the stated regularity assumptions hold, then
$$
\theta_k \to \theta^* \quad \text{a.s. as } k\to\infty,
$$
where $\theta^*$ is a local minimum of $\mathcal J$ [2405.14392]. The paper explicitly notes that this is not a global optimality guarantee, because the FM objective is nonconvex. A common misconception is that the flow-learning component removes the usual nonconvexity issues of neural transport; the stated result does not support that interpretation.

## 5. Empirical behavior, metrics, and observed trade-offs

The reported empirical evaluation covers two synthetic and two real-world tasks: a 4-mode 2D Gaussian mixture, a 16-mode Gaussian mixture, a 64-dimensional Allen-Cahn field system, and a log-Gaussian Cox point process on a $40\times 40$ grid with latent dimension $d\approx 1600$ [2405.14392]. The paper uses Maximum Mean Discrepancy, Kernel Stein Discrepancy with inverse multiquadratic kernel
$$
k(x,x')=(1+\|x-x'\|^2)^\beta,\qquad \beta=-\tfrac12,
$$
Monte Carlo estimates of $\mathbb E_{[\phi_1]_\# p_0}\log\pi$, and wall-clock runtime.

For the 4-mode Gaussian mixture, MFM and DDS are reported as the only methods that recover all separated modes, while NF-MCMC struggles more. For the 16-mode mixture, MFM captures the full target distribution, while DDS can slightly outperform it in MMD but at much higher runtime. For the Allen-Cahn field system, adaptive tempering is described as crucial: it prevents collapse to a single mode and allows the sampler to find both global minima. On that problem, MFM is reported to be significantly faster than DDS, FAB, and NF-MCMC, often by about $10\text{–}25\times$, while still producing strong sample quality. For the log-Gaussian Cox process, DDS achieves the best approximation quality by a small margin, but MFM is competitive and faster than DDS and FAB [2405.14392].

These observations define the method’s empirical profile. Its strengths are strong computational efficiency, improved global exploration over purely local MCMC, the ability to handle multimodal problems via tempering, and adaptive training directly from chain samples. Its limitations are also explicit: the FM objective is nonconvex, no non-asymptotic rates are given, and performance can depend significantly on architecture and hyperparameters. In some cases DDS can outperform MFM in pure sample quality, though often at much higher cost [2405.14392].

## 6. Relation to adjacent flow–MCMC hybrids

FM-MCMC belongs to a broader family of methods that combine transport maps with Monte Carlo correction, but the details of that combination vary substantially.

"Annealed Langevin Monte Carlo for Flow ODE Sampling" [2604.20052] is closely related but not identical. There, the method is a two-stage procedure: an annealed Langevin chain first produces weighted particles across intermediate distributions, and those particles are then used to estimate the velocity field of a probability-flow ODE derived from stochastic interpolants. The reweighting is central and Jarzynski/AIS-like, with accumulated log-weight
$$
A_k = A_{k-1} + V_{k-1}(X_{k-1}) - V_k(X_k) + \log \frac{\nu_k(X_k,X_{k-1})}{\mu_k(X_{k-1},X_k)},\qquad A_0=0,
$$
and estimator identity
$$
\mathbb E_k[f(X_k)] = \frac{\mathbb E[f(X_k)e^{A_k}]}{\mathbb E[e^{A_k}]}.
$$
The paper proves an $\mathcal O(1/n)$ mean-squared error bound for the resulting velocity-field estimator and shows strong performance on multimodal targets. The data explicitly characterize this work as a strongly related supporting reference rather than the canonical source for FM-MCMC [2604.20052].

"Sampling via Föllmer Flow" [2311.03660] offers another adjacent pattern: a deterministic Gaussian-to-target ODE transport, Euler discretization, Monte Carlo approximation of the velocity, and a warm-start strategy for existing MCMC methods. Its hybrid scheme is explicitly predictor-corrector in spirit: the flow predicts a mode-covering initialization, and MCMC corrects and refines the samples. This is conceptually close to FM-MCMC, but it does not learn a flow-matching model from data in the modern neural sense [2311.03660].

"MetFlow" [2002.12253] predates flow matching as the organizing principle, but it also couples learned flow-based transformations with Metropolis-Hastings accept/reject steps. Its marginal after $K$ transitions becomes a mixture over many accept/reject flow paths, which the paper emphasizes as a source of expressivity. Relative to FM-MCMC, this suggests an earlier line of hybridization in which exactness comes from Metropolization and flexibility from learned invertible proposals [2002.12253].

## 7. Extensions, domain-specific variants, and scope of the term

The term FM-MCMC is also used more loosely to describe methods that position flow matching as an alternative to, or replacement for, conventional Markov chains in particular application domains. "Flow Matching at Scale: A Machine Learning Framework for Efficient Large-Size Sampling of Many-Body Systems" [2508.15318] proposes a Flow-Matching-based sampler for the 2D XY model that learns a continuous, temperature-conditioned transport map from Gaussian noise to equilibrium configurations. The interpolation path is
$$
\mathbf{x}_t = t\; \mathbf{x}_1 + (1-t)\;\mathbf{x}_0, \qquad t\in[0,1],
$$
the probability-flow ODE is
$$
\frac{d \mathbf{x}_t}{dt} = \mathbf{u_t}(\mathbf{x}_t),
$$
and the training objective is a mean-squared regression on vector fields. In that work, the learned ODE is used as a deterministic sampler trained from MCMC data but then employed to bypass Markov-chain autocorrelation. The paper frames this as a practical alternative to conventional MCMC rather than as an MCMC kernel with Metropolized flow proposals [2508.15318].

That distinction matters for terminology. In the strict sense established by [2405.14392], FM-MCMC refers to an algorithm in which flow matching trains a CNF that is embedded inside a valid MCMC chain. In the broader sense used across adjacent literature, the label can also refer to flow-based transport methods designed to assist, warm-start, stabilize, or replace Markov chains. A plausible implication is that the term currently names both a specific algorithmic construction and a wider design pattern centered on combining learned transport with Monte Carlo robustness.

Within that broader landscape, the most stable technical core is the following: a reference distribution is transported along a learned or analytically derived flow; the transport is either corrected, refined, or complemented by Markovian updates; and multimodality is handled through non-local proposals, annealing, or importance reweighting rather than by relying exclusively on local random-walk dynamics [2405.14392].

Source: https://www.emergentmind.com/topics/flow-matching-markov-chain-monte-carlo-fm-mcmc