Flowing with Confidence

Friso de Kruiff, Dario Coscia, Max Welling, Erik BekkersarXiv 2026

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?

Figure 1: Flow-Matching model with Confidence. (Left) Variance is propagated alongside the sample as it is generated along the path p0 →p1: well-placed samples (green) contract into a tight ±σ band, while misplaced ones (red) stay diffuse. (Right) Sorting by the resulting confidence score recovers quality across modalities—low-energy crystals and clean digits at high confidence, implausible structures and malformed digits at low confidence.

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:

  1. Endpoint confidence: The analytical variance at the final step ($t=1$).
  2. Integrated confidence: The sum of per-step velocity standard deviations along the trajectory.
  3. 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.
Spatial fields showing that $\sigma_t^2$ recovers the analytical divergence structure at bifurcation times.
  • 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.
Adaptive stepping performance comparison across different step budgets.

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

Abstract

Generative models can produce nonsensical text, unrealistic images, and unstable materials faster than simulation or human review can absorb; without per-sample confidence, trust erodes. Existing fixes run $k$ ensembles or stochastic trajectories at $k\times$ compute, measuring variability between models, not model confidence. We propose Flow Matching with Confidence (FMwC). FMwC injects input-dependent multiplicative noise at selected layers, propagates its variance through the network in closed form, and integrates it along the ODE trajectory, yielding a per-sample confidence score at standard sampling cost. The score supports multiple uses: filtering improves image quality and thermodynamic stability of crystals; editing rewinds trajectories to the points where the model commits and redirects them; and adaptive stepping concentrates ODE compute where the flow is ambiguous. We find that the confidence score correlates with the magnitude of the divergence of the learned velocity field, which gives us a window to understand the generative process, opening up surgical forms of guidance that target the moments that matter, new sampling algorithms and interpretability of generative models.
BibTeX
@misc{kruiff2026flowing,
  author = {Friso de Kruiff and Dario Coscia and Max Welling and Erik Bekkers},
  title = {{Flowing with Confidence}},
  year = {2026},
  eprint = {2605.18472},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.18472},
}

Loading related content...

Figure