Flow Matching with Uncertainty Quantification and Guidance
Organizations: MIT
Abstract
Despite the remarkable success of sampling-based generative models such as flow matching, they can still produce samples of inconsistent or degraded quality. To assess sample reliability and improve sample fidelity, we propose uncertainty-aware flow matching (UA-Flow), a lightweight extension of flow matching that predicts the velocity field together with heteroscedastic uncertainty. UA-Flow estimates spatially localized sample uncertainty by propagating velocity uncertainty through the flow dynamics. The resulting estimates serve as reliability signals that reflect data-manifold support for each generated sample or region. We further use them to steer generation via uncertainty-aware guidance (UG) and uncertainty-aware classifier-free guidance (UCFG). Experiments on ImageNet and CIFAR-10 show that UA-Flow's uncertainty tracks sample fidelity more consistently than element-wise baselines and that these signals also carry information about data-manifold support. On ImageNet, UG increases precision at the cost of recall and improves FID, while UCFG maintains lower FID than CFG at large guidance scales.
Figures & tables
| : | velocity mean | : | state mean |
| : | state variance | : | number of probes |
| Method | CIFAR-10 | ImageNet-128 | ImageNet-256 |
|---|---|---|---|
| Vanilla | 4.044 | 1.112 | 4.601 |
| AU | 5.014 | 1.379 | 5.706 |
| BayesDiff | 9.201 | 2.479 | 10.26 |
| GenUnc | 24.32 | 7.655 | 31.39 |
| UA-Flow | 5.506 | 1.380 | 5.761 |
| UA-Flow + CLIP | 5.550 | 2.200 | 8.916 |
| Sample-wise | Patch-wise | |||||
|---|---|---|---|---|---|---|
| Dataset | Metric | GenUnc | UA-Flow + CLIP | AU | BayesDiff | UA-Flow |
| CIFAR-10 | Dist. to manifold | |||||
| Rarity | ||||||
| ImageNet-128 | Dist. to manifold | |||||
| Rarity | ||||||
| ImageNet-256 | Dist. to manifold | |||||
| Batch size | Average bias-correction | Recovered |
| Reference | — | |
| 2 | 17.21% | |
| 16 | 47.21% | |
| 64 | 60.35% | |
| 256 | 70.21% | |
| 1,024 | 78.32% |
| Before | After | |||
|---|---|---|---|---|
| ECE | Brier | ECE | Brier | |
| 0.5 | 0.1328 | 0.4771 | 0.0066 | 0.0515 |
| 0.7 | 0.0992 | 0.3281 | 0.0038 | 0.0492 |
| 0.9 | 0.0277 | 0.1009 | 0.0008 | 0.0481 |
| Threshold | Excl. % | Success % | Mean MaxR |
|---|---|---|---|
| no removal | 0.0% | 62.7% | 0.9514 |
| 0.0010 | 87.8% | 91.0 % | 0.9702 |
| 0.0025 | 62.9% | 77.6% | 0.9597 |
| 0.0050 | 29.2% | 66.8% | 0.9536 |
| 0.0075 | 14.6% | 63.6% | 0.9536 |
| 0.0100 | 7.9% | 63.3% | 0.9521 |
Appendix figures & tables25 assets
Supplementary material from the paper’s appendix.
Appendix
| CIFAR-10 | ImageNet-128 | ImageNet-256 | |||
| pretraining | finetuning | pretraining | finetuning | finetuning | |
| Learning rate | |||||
| AdamW | |||||
| Gradient warm-up step | – | 10000 | – | 1000 | 1000 |
| Gradient clipping | – | 1.0 | – | 1.0 | 1.0 |
| EMA decay rate | 0.999 | 0.999 | 0.9999 | 0.9999 | 0.9999 |
| CIFAR-10 | |
|---|---|
| # of ResNet blocks per scale | 4 |
| Base channels | 128 |
| Channel multiplier per scale | (2, 2, 2) |
| Attention resolutions | 2 |
| Dropout | 0.3 |
| Setting | FID | Prec. | Rec. |
|---|---|---|---|
| CFG only ( ) | |||
| CFG + UG ( ) |
| Task | FID | Prec. | Rec. |
|---|---|---|---|
| — | 22.87 | 0.5063 | 0.6683 |
| Filtering (50%) | 20.66 | 0.5158 | 0.6462 |
| UG ( , ) | 18.44 | 0.5296 | 0.6389 |
| Best UCFG † ( ) | |||
| Best fixed CFG † ( ) |
| Filtering ratio | Coverage |
|---|---|
| 0% (no filtering) | 0.9572 |
| 1% | 0.9668 |
| 2.5% | 0.9793 |
| 5% | 0.9876 |
| 10% | 0.9936 |
| Filtering ratio | MSE ( ) |
|---|---|
| 0% (no filtering) | 14.65 |
| 10% | 3.87 |
| 25% | 2.11 |
| 50% | 1.77 |
| 90% | 0.78 |
| Threshold | Included | Excluded | Excl. % | Success % | Mean MaxR | Std MaxR |
|---|---|---|---|---|---|---|
| no removal | 1000 | 0 | 0.0% | 62.7% | 0.9514 | 0.1506 |
| 0.0010 | 122 | 878 | 87.8% | 91.0 % | 0.9702 | 0.1253 |
| 0.0025 | 371 | 629 | 62.9% | 77.6% | 0.9597 | 0.1424 |
| 0.0050 | 708 | 292 | 29.2% | 66.8% | 0.9536 | 0.1526 |
| 0.0075 | 854 | 146 | 14.6% | 63.6% | 0.9536 | 0.1504 |
| 0.0100 | 921 | 79 | 7.9% | 63.3% | 0.9521 | 0.1511 |