TL;DR
Flow Matching with Confidence (FMwC) introduces a method to extract per-sample confidence scores from flow-matching generative models during a single forward pass, matching standard sampling costs. By analytically propagating input-dependent noise through the network layers and the ODE trajectory, FMwC enables training-free sample filtering, targeted editing, and adaptive stepping without the $k\times$ computational overhead of traditional ensembles.
What Problem Does This Paper Address?
State-of-the-art generative models—including flow-matching models—are highly capable but prone to generating realistic-looking failures, such as hallucinated citations, anatomically broken images, or thermodynamically impossible crystal structures. Crucially, these models typically output samples with the same implicit confidence, leaving users with no native signal to distinguish high-quality outputs from failures.
While uncertainty quantification (UQ) methods like Deep Ensembles or MC-Dropout exist, they require running $k$ separate models or stochastic trajectories at inference time. This multiplies the computational cost by $k\times$, which is prohibitively expensive for large-scale generation or scientific discovery pipelines (e.g., crystal structure screening). The authors address this gap by asking: Can flow-matching models learn to know what they don't know, efficiently and in a single pass?
Methods
The authors propose Flow Matching with Confidence (FMwC). Instead of treating network weights as fixed point estimates, FMwC treats them stochastically using Variational Adaptive Dropout (VAD), which learns an input-dependent noise scale for each layer via a small auxiliary inference network.
To avoid the need for expensive Monte Carlo sampling to estimate uncertainty, FMwC uses sampling-free moment propagation. It analytically propagates the mean and variance through the network's linear layers and pointwise nonlinearities in closed form.
Crucially, FMwC extends this variance propagation through the entire ODE integration trajectory. At each Euler step, the network emits both a posterior-mean velocity ($\mu_t$) and its corresponding variance ($\sigma_t^2$). The trajectory of these variances can then be aggregated into scalar confidence scores using three label-free geometric metrics:
- Endpoint confidence: The analytical variance at the final step ($t=1$).
- Integrated confidence: The sum of per-step velocity standard deviations along the trajectory.
- Temporal confidence ratio: The ratio of late-window variance to early-window variance.
Datasets
The method was evaluated across three distinct domains:
- Checkerboard: A 2D synthetic target distributed uniformly across 8 cells of a 4×4 grid, used to evaluate basic geometric properties and misplacement rates.
- MNIST: The standard handwritten digits dataset, used to evaluate image generation quality (FID) and classifier-guided failure detection.
- Crystals: A structured scientific dataset for de novo inorganic crystal generation using the FlowMM backbone, trained on a stable subset of the Materials Project.
Key Insights and Ideas
- Tracking Local Divergence: The single-pass confidence score ($\sigma_t^2$) strongly correlates with the local divergence of the learned velocity field ($|\nabla \cdot v_{t,\theta}|$). This means the propagated variance acts as a direct proxy for the intrinsic geometric instability of the flow.
- Bifurcation Points as Uncertainty Peaks: Uncertainty naturally peaks at critical "decision moments" (bifurcation points) along the trajectory where the model must commit to a specific mode.
- Downstream Applications Without Retraining: Because the variance trajectory uncovers exactly when and where a model is uncertain, it unlocks three training-free inference tricks:
- Filtering: Discarding low-confidence samples to monotonically improve batch quality.
- Targeted Editing: Identifying the exact timestep where the model commits to a structure, allowing users to inject noise and redirect the trajectory while respecting constraints.
- Adaptive Stepping: Dynamically allocating more integration steps to regions where the flow is ambiguous, saving compute on easy trajectories.
Key Results
- Quality & Cost: Standard generation under FMwC preserves or slightly improves baseline sample quality while introducing negligible computational overhead for scaled models (1.003× FLOPs for MNIST, 1.08× for Crystals). For instance, MNIST FID improved from 5.17 (baseline) to 4.22.
- Ensemble-Grade Filtering: On the Checkerboard dataset, FMwC's single-trajectory temporal aggregation achieved an AUPRC of 0.55, matching the performance of 5× MC-Dropout and Deep Ensembles at one-fifth of the inference cost.
- Adaptive Stepping Efficiency: The proposed Online Adaptive controller significantly outperformed uniform stepping schedules at low step budgets. At $N=5$ steps, it reduced Checkerboard misplacement from 11.0% to 9.6% and dropped MNIST FID from 12.7 to 7.6.
Limitations and Future Work
- Evaluation Scale: Due to the high computational cost of downstream crystal relaxation simulations, the Crystal dataset results were reported using only a single random seed.
- Modality Scope: The benchmarks currently span 2D targets, images, and crystal manifolds, but have not yet been validated on text, video, or large-scale molecular graphs.
- Theoretical Gap: While empirical results show a strong correlation between variance and velocity field divergence, a formal theoretical proof directly linking posterior trajectory divergence to sample-level epistemic uncertainty remains an open problem.
Summary updated