arXiv:2610.01034stat.MLOct 2026

Manuscript Offprint

arXiv:2610.01034

Posterior sampling by source-space MCMC via prior-based few-step transport maps

Hoang Phuc Hau Luu, Marcelo Hartmann, Zhongjian Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Bayesian inference increasingly uses informative but implicit priors represented only by samples, such as historical ensembles, simulator outputs, and pretrained generative models. The same computational problem appears in the test-time guidance task (generalized Bayes), where an explicit positive weight, e.g., an exponentiated reward, tilts an implicit prior. We develop a framework for source-space generalized Bayesian inference that combines inexpensive few-step prior transports with posterior stability guarantees. Specifically, we represent the prior using a one- or few-step improved MeanFlow (iMF) map and perform posterior sampling in its Gaussian source space. We establish Wasserstein error bounds between the exact and learned posteriors in terms of the joint population iMF and auxiliary-velocity loss, decomposed into training suboptimality and model-class approximation error. In the iMF source space, we adopt parallel tempering with preconditioned Crank–Nicolson updates and introduce a hybrid variant that incorporates split Hamiltonian Monte Carlo to improve sampling efficiency. Synthetic experiments show that the proposed framework can approximate posterior distributions accurately and efficiently, while CLIP-guided ImageNet experiments demonstrate its ability to steer a pretrained iMF image prior toward text-specified preferences.

1 Introduction

Bayesian inference combines prior knowledge with observations to characterize uncertainty about unknown quantities (Stuart, 2010). In many applications, however, prior information is available through samples, e.g., historical ensembles, simulator outputs, or pretrained generative models rather than an explicit density (Patel & Oberai, 2019; Chung et al., 2023; Lunz et al., 2018). Such prior samples can represent complex structures that are difficult to encode analytically, but their densities and scores are not directly available for posterior Markov chain Monte-Carlo (MCMC).

Formally, let x∈Rdxx \in \mathbb{R}^{d_x} be an unknown with prior π0\pi_0 available only through i.i.d. samples, and let yy denote observations or a task specification. We encompass Bayesian and generalized Bayesian inference through the generalized posterior

πy(dx)=Zy−1ℓy(x)π0(dx),Zy=∫ℓy(x)π0(dx),(1)\pi^{y}(\mathrm{d}x)=Z_{y}^{-1}\ell_{y}(x)\pi_{0}(\mathrm{d}x),\qquad Z_{y}=\int\ell_{y}(x)\pi_{0}(\mathrm{d}x), \tag{1}

where ℓy\ell_y is an analytically given nonnegative weight and 0<Zy<∞0 < Z_y < \infty. Standard Bayesian inference takes ℓy(x)=p(y∣x)\ell_y(x) = p(y|x), while generalized Bayes (Bissiri et al., 2016) uses ℓy(x)=\ell_y(x) =

*Division of Mathematical Sciences, School of Physical and Mathematical Sciences, Nanyang Technological University, Singapore. hoangph.luu@ntu.edu.sg

†^{\dagger}Department of Computer Science, Faculty of Science, University of Helsinki, Finland. marcelo.hartmann@helsinki.fi

‡^{\ddagger}Division of Mathematical Sciences, School of Physical and Mathematical Sciences, Nanyang Technological University, Singapore. zhongjian.wang@ntu.edu.sg (Corresponding)

exp⁡(−τLy(x))\exp(-\tau L_y(x)) for a task loss LyL_y and τ>0\tau > 0. Reward guidance (Korbak et al., 2022) fits the same formulation with ℓy(x)=exp⁡(τRy(x))\ell_y(x) = \exp(\tau R_y(x)), favoring samples with larger reward RyR_y. For example, yy may be a text prompt, with Ry(x)=CLIP(x,y)R_y(x) = \text{CLIP}(x, y) measuring the cosine similarity between the CLIP embeddings of image xx and prompt yy (Radford et al., 2021). Henceforth, we use ℓy\ell_y for either a likelihood or a general weight and refer to πy\pi^y simply as the posterior.

An approach is to learn the data-space prior score by denoising score matching (DSM) (Vincent, 2011) and combine it with the gradient of an analytic log-likelihood or reward to construct Langevin or Hamiltonian dynamics. These samplers are typically unadjusted because a learned score alone does not provide the density ratios needed for Metropolis correction. Moreover, sharp variation in the score near complex data manifolds can produce stiff dynamics, requiring small integration steps.

Another approach is to first learn a deterministic generator Sθ:Rdz→RdxS_\theta : \mathbb{R}^{d_z} \to \mathbb{R}^{d_x} satisfying (Sθ)#γ≈π0(S_\theta)_\# \gamma \approx \pi_0, where γ=N(0,I)\gamma = \mathcal{N}(0, I) denotes the source distribution, Rdz\mathbb{R}^{d_z} is called the source space and #\# denotes the pushforward. Under the learned model SθS_\theta, the complex data-space prior is represented by the simple Gaussian reference measure γ\gamma. The corresponding learned posterior in the source space is

νθy(dz)∝ℓy(Sθ(z))γ(dz).(2)\nu_{\theta}^{y}(\mathrm{d}z)\propto\ell_{y}(S_{\theta}(z))\gamma(\mathrm{d}z). \tag{2}

We sample from νθy\nu_{\theta}^{y} using MCMC and map the resulting samples to data space through SθS_{\theta}. In contrast to the conventional data-space approach, νθy\nu_{\theta}^{y} is available up to normalization, enabling Metropolis correction and thus an MCMC kernel that leaves νθy\nu_{\theta}^{y} invariant. Furthermore, the source-space posterior is expected to have more favorable geometry for MCMC: its prior is Gaussian, while SθS_{\theta} has already absorbed much of the curvature and anisotropy of π0\pi_{0}. Nevertheless, the likelihood/weight ℓy∘Sθ\ell_{y} \circ S_{\theta} may reintroduce curvature, stiffness, anisotropy, or multimodality, particularly when the observation model is highly informative or nonlinear. Early work by Patel et al. (2022) used a Wasserstein GAN to construct SθS_{\theta} and applied Hamiltonian Monte Carlo (HMC) with the No-U-Turn Sampler (Hoffman et al., 2014) to the resulting low-dimensional latent posterior. However, learning SθS_{\theta} with a WGAN requires solving an adversarial min-max optimization problem, which can be challenging to stabilize. Flow-based models (Chen et al., 2018) offer an attractive alternative: flow matching learns a time-dependent vector field through a standard regression objective (Lipman et al., 2023; Tong et al., 2024). This provides a scalable approach to learning expressive transport maps for complex and multimodal priors. Under suitable regularity conditions on the vector field, the resulting ODE flow also defines a diffeomorphism between source and data spaces (Papamakarios et al., 2021). Source-space guidance for flow-matching models has been explored through both optimization and sampling. D-Flow (Ben-Hamu et al., 2024) optimizes the source variable, while Source-Guided Flow Matching (SGFM) (Wang et al., 2026b) samples from the source posterior distribution (2). Source Parallel Tempering (SPT) (Wang et al., 2026a) combines local preconditioned Crank-Nicolson (pCN) (Beskos et al., 2008) updates with replica exchanges (Earl & Deem, 2005) across tempered source distributions to address multimodality. These source-space methods are instances of test-time guidance, incorporating user-specified likelihoods or weights during inference.

For methods that represent the prior through a learned transport (Wang et al., 2026b,a), a central theoretical question is how prior-learning error controls the discrepancy between the learned posterior (Sθ)#νθy(S_{\theta})_{\#}\nu_{\theta}^{y} and the true posterior πy\pi^{y} in (1). We refer to this as posterior stability. Existing works have tried to address this question, but a gap remains. Wang et al. (2026b) assume a uniform vector-field approximation bound, ∥vθ(x,t)−v(x,t)∥∞≤ϵ\|v_{\theta}(x,t)-v(x,t)\|_{\infty} \leq \epsilon where v(x,t)v(x,t) is the true velocity field and vθ(x,t)v_{\theta}(x,t) is the learned velocity field. However, the flow-matching objective controls an average squared error rather than a uniform error. Wang et al. (2026a) address this mismatch by establishing posterior stability in terms of the L2L^{2} transport-map error, i.e., Ez∼γ∥S(z)−Sθ(z)∥2≤ϵ2\mathbb{E}_{z \sim \gamma} \|S(z) - S_{\theta}(z)\|^{2} \leq \epsilon^{2}, where SS is the exact transport map induced by v(x,t)v(x,t). Their connection to the flow matching objective takes SθS_{\theta} to be the map induced by the exactly integrated learned flow, via Grönwall's inequality. In practice, however, numerical ODE solvers are employed, introducing an additional discretization error. Under standard regularity and stability assumptions, a numerical ODE solver of order k has global error O(hk)O(h^{k}) (Hairer et al., 1993). The training objective alone does not control this error. Reducing h requires more integration steps, increasing the cost of source-space MCMC. Minibatch optimal-transport coupling (Tong et al., 2024), as used by Wang et al. (2026b), can encourage straighter trajectories and facilitate few-step integration, but does not by itself provide a bound on this numerical error; their theoretical bound likewise concerns the exactly integrated learned flow. Thus, guarantees for the exactly integrated learned flow do not by themselves establish posterior stability for a fixed few-step implementation. Likewise, Purohit et al. (2025) use few-step consistency models but do not establish how the consistency-distillation training objective controls the resulting posterior error.

In this work, we pursue two complementary objectives: making source-space inference computationally efficient through few-step transports and establishing posterior stability guarantees for the implemented maps via the true population training objective. To this end, we use improved MeanFlow (iMF) (Geng et al., 2026b), which learns interval-average velocities without distillation and natively enables one-step or few-step generation without numerical ODE integration. We further explain why the original MeanFlow objective (Geng et al., 2026a) does not directly yield the same guarantee, highlighting that native few-step generation alone can fall short of establishing such stability results. Practically, the iMF maps make source-space gradients inexpensive to evaluate when available, allowing MCMC kernels to optionally exploit them to improve mixing.

Contributions We use iMF transport mappings to represent complex priors available only through samples in generalized Bayesian inference settings. Under stated regularity assumptions, we connect population training suboptimality and model-class approximation error for the joint iMF and auxiliary-velocity objective to posterior stability for the implemented one-step or few-step maps. Building on these transports, we adopt SPT with pCN updates (Wang et al., 2026a) to facilitate exploration across modes while exploiting the Gaussian reference structure of the high-dimensional source space. When likelihood or reward gradients are available, we additionally introduce Gaussian-reference split HMC (Beskos et al., 2011) at the coldest temperature of SPT to exploit local posterior geometry and potentially improve mixing. Both local kernels preserve the Gaussian reference measure in their reference dynamics, making them natural choices for inference in high-dimensional source spaces. We evaluate the proposed framework on synthetic posterior sampling and CLIP-guided ImageNet generation, demonstrating accurate and efficient posterior approximation in the synthetic settings and the ability to steer a pretrained image prior toward text-specified preferences.

References (75)