Manuscript Offprint

arXiv:2610.21657

Conditional Mean Flows: Few-Step Densities for Simulation-Based Inference

Jonas Arruda, Jan Hasenauer, Stefan T. Radev

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

Abstract

Flow matching has emerged as a powerful generative family for simulation-based inference (SBI). However, sampling and density evaluation require numerical integration at inference time. This makes posterior sampling in neural posterior estimation costly. More importantly, it can make repeated likelihood evaluation prohibitively expensive and impractical for Markov chain Monte Carlo (MCMC) sampling, which may require thousands of repeated density evaluations. Here, we develop conditional mean flows for posterior and likelihood approximation, combining few-step sampling with tractable density evaluation. We show that the mean flow objective identifies conditional flow maps and that independent masking enables direct estimation of marginal likelihoods. We evaluate both posterior and likelihood estimation across several tasks and show that conditional mean flows retain the flexibility of flow-based density estimators while significantly reducing inference time. In particular, single-step conditional mean flow density evaluation yields estimation error comparable to 200-step flow matching while enabling about 200-fold faster downstream MCMC sampling.

1 INTRODUCTION

Mechanistic simulators are used to describe processes ranging from cognitive science (Ratcliff et al., 2016) to disease modeling (Ye et al., 2025). Yet, while practically important, their likelihoods are often unavailable in closed form. Simulation-based inference (SBI; Sisson et al., 2018; Cranmer et al., 2020; Deistler et al., 2025; Arruda et al., 2026) addresses this challenge by using simulated parameter-observation pairs ( θ\theta, y) to infer unknown parameters, and amortized methods reuse the trained network across datasets (Bürkner et al., 2023). Two popular forms of SBI are neural posterior estimation (NPE) and neural likelihood estimation (NLE). NPE learns a posterior model qψ(θ∣y)q_{\psi}(\boldsymbol{\theta} \mid \mathbf{y}) which can sample from the approximate posterior directly. NLE, instead, learns a likelihood model qψ(y∣θ)q_{\psi}(\mathbf{y} \mid \boldsymbol{\theta}) which requires Markov chain Monte Carlo (MCMC) to sample from the posterior. NPE amortizes over datasets but is usually tied to the prior and data format used in training, whereas NLE needs MCMC for every dataset, but allows the prior to be changed after training and composes exchangeable likelihoods across any number of i.i.d. observations (Cranmer et al., 2020).

Many SBI methods demand neural estimators that are both flexible and inexpensive to evaluate. In NLE, MCMC requires thousands of likelihood evaluations per posterior, making each evaluation a practical bottleneck. Further, hierarchical approaches (Arruda et al., 2024) or self-consistency objectives that improve NPE (Schmitt et al., 2024a; Mishra et al., 2026) and enable model comparison (Kucharský and Bürkner, 2026) rely on density evaluation during training or inference.

So far, normalizing flows have been a standard choice in these applications because they evaluate densities in a single pass (Papamakarios et al., 2021; Dinh et al., 2017; Durkan et al., 2019). However, their transformations must remain invertible with tractable Jacobians, which restricts how inductive biases can be built into the architecture (Chen et al., 2025). Autoregressive flows based on causal transformers (e.g., TARFlow and STARFlow) relax this restriction (Zhai et al., 2025; Gu et al., 2025), but impose a fixed variable ordering and require sequential inversion for sampling. Moreover, tractable joint densities do not generally imply tractable marginals, which are required with missing observations (Yalavarthi et al., 2024).

Flow matching and diffusion models instead learn a velocity or score field with an unconstrained neural network (Lipman et al., 2023; Liu et al., 2022; Wildberger et al., 2023; Sharrock et al., 2024; Arruda et al., 2026), and diffusion transformers can flexibly represent arbitrary conditionals and marginals (Gloeckler et al.,

2024). Yet, their densities require solving an ordinary differential equation (ODE), which can take hundreds of network evaluations and makes repeated likelihood calls during training or within MCMC costly. Few-step generative models reduce the sampling cost, but consistency models, for instance, provide no tractable density (Song et al., 2023; Schmitt et al., 2024b). Thus, current SBI approaches either restrict the network architecture or make every density evaluation expensive.

To overcome this limitation, we present conditional mean flows for SBI, which learn the average velocity between two times, so that one network evaluation defines a finite-time map based on mean flows (Geng et al., 2025, 2026). We first evaluate direct posterior sampling and density estimation, then focus on learned likelihoods for compositional inference, missing observations, and gradient-based and delayed acceptance MCMC. Concretely, we develop and showcase

  1. a conditional mean flow formulation for posterior and likelihood approximation, with exact stepwise Jacobian determinants, and a proof that the mean flow objective suffices to identify conditional flow maps (Section 3.1, Proposition 1);

  2. marginal density estimation for missing targets with a masked transformer backbone, and a proof that the masked objective targets the correct marginal likelihood (Section 3.3, Proposition 2);

  3. and a benchmark against normalizing flows and regular flow matching on four tasks covering both NLE and NPE, including a single-trial likelihood comparison in which one mean flow step matches the error of 200-step flow matching with two orders of magnitude faster sampling (Section 4);

References (87)