Conditional Mean Flows: Few-Step Densities for Simulation-Based Inference
Organizations: University of Bonn · Rensselaer Polytechnic Institute
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.
Figures & tables
| Mean flow | Normalizing flow | |
|---|---|---|
| NRMSE | (0.008) | 0.199 (0.009) |
| RMSE | (0.007) | 0.159 (0.036) |
| RMSE | (0.013) | 0.125 (0.031) |
| ESS | (247) | 2,700 (629) |
| Leapfrog steps | (4) | 480 (57) |
| Wall time (s) | 36,146 (6,157) | (285) |
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Experiment | Method | ATC |
| Two moons | Normalizing flow | (0.019) |
| Mean flow, / / | (0.010) / (0.011) / (0.011) | |
| Consistency model, / / | (0.011) † / (0.011) / (0.014) | |
| Mean flow ( -head), Euler / / | (0.013) † / (0.015) / (0.012) | |
| Flow matching, Euler / | (0.011) † / (0.014) | |
| Mean flow ( -head) / flow matching, adaptive | (0.012) / (0.011) |
| Hyperparameter | Search space | Selected |
|---|---|---|
| Cycle weight (log) | ||
| Probability of replacing the condition in | ||
| Fraction of time pairs with | ||
| Exponent of the adaptive weight | ||
| Offset of the adaptive weight (log) | ||
| Scale of the Fourier time embedding (log) |
| Consistency model | 1 | 2 | 3 | 3.5 | 3.5 | |
|---|---|---|---|---|---|---|
| C2ST, selected | 0.918 | 0.542 | 0.555 | 0.539 | 0.535 | |
| C2ST, worst | 0.973 | 0.975 | 0.946 | 0.700 | 0.666 | |
| Mean flow | 4.54 | 3.82 | 4.12 | 8.34 | 7.42 | |
| C2ST, selected | 0.502 | 0.504 | 0.509 | 0.505 | 0.507 |
| Method | Steps | Mass | KL | Hellinger |
|---|---|---|---|---|
| Normalizing flow | 0.977 (0.055) | 0.446 (0.073) | 0.383 (0.023) | |
| Mean flow | 1.066 (0.017) | 0.347 (0.137) | 0.322 (0.052) | |
| Mean flow | 1.045 (0.030) | 0.179 (0.077) | 0.230 (0.042) | |
| Mean flow | 1.085 (0.093) | 0.165 (0.053) | 0.219 (0.050) | |
| Mean flow | (0.025) | 0.160 (0.052) | 0.169 (0.027) | |
| Mean flow ( -head) | Euler, | 73.2 (19.0) | 1.000 (0.000) |
| Method | NRMSE | Cov. 95% | Min ESS | Div. | ||
|---|---|---|---|---|---|---|
| Mean flow | 4 | 0.268 (0.079) | 0.90 (0.16) | 1,396 (312) | 1.0 (1.9) | 0.73 (0.14) |
| Mean flow | 16 | 0.161 (0.033) | 0.90 (0.16) | 1,174 (378) | 6.6 (11.5) | 0.90 (0.30) |
| Mean flow | 64 | 0.102 (0.028) | 0.90 (0.16) | 1,205 (186) | 2.4 (4.0) | 1.13 (0.47) |
| Mean flow | 256 | 0.070 (0.019) | 0.60 (0.31) | 1,146 (335) | 7.8 (21.7) | 2.15 (1.03) |
| Mean flow | 256 | 0.061 (0.016) | 0.73 (0.21) | 1,094 (335) | 0.6 (1.6) | 1.93 (0.77) |
| Mean flow | 256 | 0.066 (0.018) | 0.77 (0.27) | 503 (620) | 50.7 (50.1) | 2.02 (0.77) |
| Method | Steps | Samples | Min ESS | C2ST |
| Mean flow | 1 | 32,000 | (1,552) | 0.604 (0.049) |
| Mean flow | 2 | 16,000 | 4,856 (939) | 0.587 (0.046) |
| Mean flow | 4 | 8,000 | 2,436 (708) | (0.039) |
| Mean flow | 8 | 4,000 | 1,143 (476) | 0.599 (0.030) |
| Normalizing flow | 1 | 32,000 | 8,023 (3,169) | 0.679 (0.078) |
| Flow matching, Euler | 200 | 4,000 | 1,270 (331) | 0.614 (0.048) |
Simulation-Based Inference
Simulation-based inference estimates parameters and uncertainty from simulators when evaluating a tractable likelihood is difficult or impossible.
See all 86 papers