Markovian Flow Matching: Accelerating MCMC with Continuous Normalizing Flows

Continuous normalizing flows (CNFs) learn the probability path between a reference distribution and a target distribution by modeling the vector field generating said path using neural networks. Recently, Lipman et al. (2022) introduced a simple and inexpensive method for training CNFs in generative modeling, termed flow matching (FM). In this paper, we repurpose this method for probabilistic inference by incorporating Markovian sampling methods in evaluating the FM objective, and using the learned CNF to improve Monte Carlo sampling. Specifically, we propose an adaptive Markov chain Monte Carlo (MCMC) algorithm, which combines a local Markov transition kernel with a non-local, flow-informed transition kernel, defined using a CNF. This CNF is adapted on-the-fly using samples from the Markov chain, which are used to specify the probability path for the FM objective. Our method also includes an adaptive tempering mechanism that allows the discovery of multiple modes in the target distribution. Under mild assumptions, we establish convergence of our method to a local optimum of the FM objective. We then benchmark our approach on several synthetic and real-world examples, achieving similar performance to other state-of-the-art methods, but often at a significantly lower computational cost.

Paper

References (87)

09Transport meets Variational Inference: Controlled Monte Carlo Diffusions2023

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer Sj6c6/10 · confidence 3/52024-07-02

Summary

The proposed method falls in the wider category of models that integrate MCMC methods with normalizing flows. Specifically, the method expands on the neutra-MCMC model, where the key idea is to run MCMC in a simpler reference space rather than in the (more complicated) target one. The main difference is that previous work uses discrete normalizing flows while the proposed approaches employs the Flow Matching framework and hence relies on a continuous velocity field, which is provided with a continuous Normalizing Flow.

Strengths

- the authors propose an interesting way to use the Flow Matching framework in the context of Flow-enhanced MCMC samplers - I also found interesting the use of a sample-based annealing scheme (which is however not novel). The authors claim it works particularly well for multi-modal distributions, which is definitely a very relevant setting

Weaknesses

- the novelty aspect of the proposed method seem limited to extend current formalism of MCMC - Normalizing Flows (NFs) methods (specifically neutra-MCMC) to the specific architecture of Continuous Normalizing Flows (CNF). However, I don't see a priori why the (continuous) CNF should be preferable discrete NFs (which are even more expressive than CNF [1]) if not because the flow matching objective requires access to the velocity field provided by CNF [1] Perugachi-Diaz et al., Invertible DenseNets with Concatenated LipSwish, NeurIPS 2021

Questions

1. Some work analyzes the performance of methods combining MCMC with NFs methods in terms of (i) how easy is it to sample from multi modal distributions and (ii) scalability with dimensions [1]. They found that neutra-MCMC (similarly to the proposed method) is efficient in multi-modal settings but struggles more in high dimensions, compared to methods that use Flows as proposal for MH. Did you observe a consistent behaviour with their analysis? For instance I would have expected NF-MCMC to perform better in the Log-Gaussian Cox experiment. Or did the proposed method outperform "flow-MCMC" methods also when inflating the dimensions even more? (e.g. in the experiments in Section 5.3 and 5.4) 2. The use of CNF are motivated by the availability of the velocity field, which is required by the Flow Matching objective. However, other neutra-MCMC methods work very well also with discrete NFs. CMF are definitely more expressive than standard discrete flows that are commonly used in the literature (mainly real NVP), but one could also use more powerful discrete NFs like [2]. I was wondering whether the authors could discuss the benefits of the proposed approach compared to neutra-MCMC with discrete NFs. 3. The proposed method uses a hybrid between local and global updates, similarly to [3] (which is cited in the paper). The main difference it the use of a CNF (for the Flow Matching objective) instead of NFs. So I think it would be very relevant to compare the proposed method against [3]. Also the authors of [3] use very naive layers (real NVP, which consist of basic shift and scale transforms), while more flexible layers like [2] might exclude that the difference in performance is to be connected to the expressiveness of the flows. Similarly, the NF-MCMC uses very simple NFs layers (always real NVP). 4. Even though the Flow Matching objective could allow to learn complicated distributions, in the end the authors use a very simple velocity field to transform the conditional distribution. Doesn't this limit the expressiveness of the learnt distribution? 5. In line 218 do the authors mean FAB instead of DDS? [1] Grenioux et al, On Sampling with Approximate Transport Maps, ICML 2023 [2] Perugachi-Diaz et al., Invertible DenseNets with Concatenated LipSwish, NeurIPS 2021 [3] Samsonov, Local-Global MCMC kernels: the best of both worlds, NeurIPS 2022

Rating

6

Confidence

3

Soundness

3

Presentation

3

Contribution

2

Limitations

Limitations are clearly stated.

Reviewer HJhZ5/10 · confidence 4/52024-07-13

Summary

A method called Markovian flow matching (MFM) for training neural ODEs (continuous normalizing flows) by flow matching to sample from distributions given as unnormalized density functions is proposed. The method obtains samples on which to perform FM training by an MCMC procedure that alternates two kinds of kernels: Metropolis-adjusted Langevin in the target space (as has been done in past work) and Gaussian proposals in the latent space, i.e., the pullback of the target by the learned ODE. An annealing scheme is additionally used. MFM is evaluated on toy low-dimensional tasks, a synthetic density from statistical physics, and a high-dimensional data-derived density (log-Gaussian Cox process).

Strengths

- The idea to do MCMC in the latent space of a CNF by pullback along the flow map is original, as far as I know. - There are two general families methods for training continuous-time models to sample Boltzmann densities: using maximum likelihood on (possibly reweighted) approximate samples (e.g., FAB and the proposed MFM) and using distribution-matching objectives (e.g., DDS, PIS), as well as hybrid approaches. - It's interesting to see progress on making methods of the first kind efficient, and to see them combined with CNFs. In the past, e.g., in [Tong et al. "Improving and generalizing flow-based generative models", D.2], FM has been used with MCMC, but only in the target space. - No serious problems with the writing, including the global structure of the paper and the exposition of preliminaries.

Weaknesses

- Some math bugs (imprecise exposition): - L72: $v_t$ being **any** time-dependent vector field does not imply existence of a diffeomorphic flow map (even if it is continuous in $t$, if that is how we interpret "runs continuously in the unit interval"). One also needs integrability conditions. - L75: $p_0$ has to be strictly positive for the path to take values in $\mathbb{R}^+$ and for the discussion the discussion that follows to make sense. - Comparison with SDE models: Approximate (MCMC) samples can also be used to train diffusion models (neural SDEs): - First, this could be done either by minimising a variational bound on the log-likelihood, similar to what is done here for CNFs -- is it possible to do such a comparison? At present the SDE baseline (DDS) is not using MCMC, only "on-policy" forward exploration. - Second, methods such as that in [Sendera et al. "Improved off-policy training of diffusion samplers"] use MCMC on the target density to obtain samples for training with a distribution-matching, not maximum-likelihood, objective. - The main weakness is that the experiments are not very comprehensive or convincing: - The 2D GMMs are toy problems; all methods, including DDS, should find the modes when appropriately tuned on such problems, and so it is hard to draw any conclusions from the results. - On the field system, MFM, although much faster than FAB, is performing **much** worse in the metrics used. - On LGCP: - The use of this task for benchmarking samplers of Boltzmann densities is questionable in the first place, since there is no known ground truth (even the exact normalising constant is diagreed upon) -- see, for example, the aforementioned [Sendera et al., B.1] for a discussion of inconsistent or irreproducible evaluation in past work on this dataset. - Why use the nonstandard metric (KSD)? Most past work has used estimates of the log-partition function, which here is reported in the appendix. - On that more standard metric, MFM is significantly underperforming (Table 8). - On both the field system and LGCP, how are we to know if the proposed method is useful on this problem without a point of comparison? I would strongly suggest a long-run HMC, MALA, and SMC (for example, run for the same wall time as the shortest and longest of the ML methods evaluated) as baselines. - I would also strongly suggest evaluations on a more comprehensive set of benchmarks that are common in past work on samplers of Boltzmann densities (as in the FAB and DDS papers, among others).

Questions

Minor: - L25: You probably want to specify "a new sample $y$" and in the subsequent lines clarify that the "mild conditions" are also needed for the target to be the *only* stationary distribution. - L77: Dash between "change" and "of" instead of hyphen. - L86: Wrong placement of parentheses. - L246: I do not believe [78] introduced this parametrisation -- it was in [80] (and possibly in earlier work as well). - I don't understand equation (18), which involves $x_{65}$ in the first sum although the dimensionality is 64. Is there is mistake, or should the indices be interpreted modulo $d$? - L308: Typo in "comparable".

Rating

5

Confidence

4

Soundness

3

Presentation

3

Contribution

2

Limitations

Yes

Reviewer eFeW7/10 · confidence 4/52024-07-15

Summary

The authors propose a novel method for incorporating flow matching with MCMC; entailing constructing a Markov kernel as a mixture of regular MCMC step and flow step (from data space (\pi_1) to prior (\pi_0, typically Gaussian) and back with some added noise. The flow guarantees a likelihood and can hence be used for accept/ reject corrections. In this sampling setting, one does not have access to samples from the data and hence the flow is trained from MCMC samples jointly within sampling.

Strengths

I think the authors did a great job on this paper: - The method is simple and well explained - Experiments are thorough with appropriate baselines including recent DDS, good performance and code is available - The authors clearly articulate limitations, which I appreciate - Prior and related work is discussed and not hidden

Weaknesses

I worry how long it takes the flow network to converge. Simulating the flow back and forward to generate samples at regular frequency during training could be quite slow if involving a large number of network evaluations for the flow. And if the MCMC locally does not mix then the flow will not see many samples. I understand tempering may help resolve this but at what cost? Similarly, I imagine the samples from the flow could be quite far from the target distribution if the flow was not pre-trained or initialized to be close to some nearby distribution. The idea itself is quite straightforward. This is not necessarily a weakness in itself, I am surprised something similar has not been considered which am unaware of. I understand there are many similar schemes that are cited using non-local Markov updates with normalizing flows (discrete), just not using flow matching (e.g. https://arxiv.org/abs/2105.12603) and other works from the same authors. I appreciate the authors have discussed and cited these. This however limits the novelty of the methodological contribution slightly in my opinion. Minor presentation: - I struggle to understand from Figure what the ground truth samples should look like. I assume like the samples from the author's method. It would help readers to show the density to know what the ground truth should be, similar to the other experiments. - Similarly Table 2, show in bold the top performing items to help readers Some other relevant works using diffusion / flow for sampling: - Target score matching, Bortoli et al 2024 https://arxiv.org/abs/2402.08667 - Iterated Denoising Energy Matching for Sampling from Boltzmann Densities, Akhound-Sadegh et al 2024 and although cited the work of Phillips et al 2024 (already cited) could be used as a baseline given code is available (also in jax) - CRAFT and AFT (Annealed flow transport Monte Carlo, 2021) may also be good baselines to include, code is available in jax for those too.

Questions

My understanding is that the flow update pushes samples into a simpler prior / latent type space then back to the data space. Is it possible to include Markov transitions in the prior space i.e. in the simpler (Gaussian) distribution, which are easier and encourage non local updates (in data space)? The addition of Gaussian noise is a bit like this I suppose but has anything else been considered? Does this actually require flow matching? I feel any diffusion model would also have be usable here, it can be trained in the same way and one can use the probability flow ODE to have tractable likelihoods and if needed similar to flow matching. There are many similarities between the two models, especially for Gaussian marginal, but diffusions seem to be better performing generative models still, see e.g. Lipman 2022 (cited) vs Karras 2022 (https://arxiv.org/abs/2206.00364) in terms of generative performance. If just using Langevin dynamics without accept/reject correction then the added stochasticity of diffusion samplers may also help, plus the benefit of Langevin dynamics corrector steps along the diffusion paths could possibly be used (Song 2021).

Rating

7

Confidence

4

Soundness

4

Presentation

4

Contribution

3

Limitations

See weaknesses.

Reviewer YCu17/10 · confidence 3/52024-07-17

Summary

This paper aims to use continuous normalizing flows (CNFs) to define the proposal distribution in a MCMC framework. While the use of flow models for MCMC proposals is not entirely new, this paper introduces an interesting training procedure that iteratively updates the learned CNF model while performing MCMC. Existing works either (i) make use of an importance weighted training objective, or (ii) first perform long-run MCMC to obtain high-quality samples. Instead, this work makes use of the Flow Matching training objective to fit to its current MCMC samples, where samples are obtained from a MCMC involving the CNF itself.

Strengths

- Overall, I feel this paper is a combination of good solid ideas that individually are not entirely new, but packaged in a way that makes sense. - The writing is also clear and to the point. - Experiments seem to be carried out on some standard benchmark potential functions. - The paper repeatedly mentions that the proposed method is favorable to competing neural MCMC approaches based on wallclock time, being significantly faster in some cases.

Weaknesses

- I feel the set of experiments is "too standard". Given that Bayesian inference is such a long field, it would be make a paper much stronger if it can show meaningful improvement on real unsolved problems where exploration is key. - There is a need to add ablation experiments that provide better intuition regarding what benefit the flow-informed Markov transition is doing.

Questions

Generally, while the proposed MCMC algorithm as a whole makes sense, it is composed of multiple components. In order to better understand each proposed component, it would be good to have ablation experiments analyzing the behavior of each component. - Given that there is a series of local MCMC updates, it would be good to compare against MCMC with just the Q transition kernel. This can help answer what exactly is the change in improvement from including a flow-informed transition kernel. - I think what would be really interesting is a plot of the acceptance rate between the P (flow-informed) and Q (local) kernels. I would imagine that at the beginning P has poor acceptance rates because the CNF is poorly trained, while after the MCMC chain is run for long enough times, its acceptance rates are much higher. Meanwhile, the acceptance rate of Q should be constant but perhaps lower than the acceptance rate of P? Regardless, it would be interesting to see such a plot to better understand the behavior of the proposed algorithm. - If you turn off the annealing, how much worse does the approach perform? ### Minor comments - The likelihood notation L(D|x) when discussing annealing (Eq 16) is not used anywhere else (and also not used in the experiments since they directly define pi(x). I felt this to be confusing because as it is currently written, it may seem that the annealing trick is restricted to only Bayesian inference settings. I would imagine the annealing simply takes L(x) = pi(x) / pi_0(x) for some pi_0(x). It might be good to clarify this? - There are 3 instances of "NeutraMCMC" which should probably be "Neural MCMC" ?

Rating

7

Confidence

3

Soundness

3

Presentation

4

Contribution

3

Limitations

The paper is written clearly with objective analyses, with no excessive beautification of the proposed method. It's nice.

Reviewer HJhZ2024-08-12

Thank you for the clarifications.

Reviewer Sj6c2024-08-14

I would like to thank the authors for their clarifications and for providing additional evaluation of their method. I have adjusted my score to reflect these changes.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC