Hierarchical flow matching usually starts its inner flow from pure noise. CCVFM starts it from a closed-form coreset of the data, so the network only has to learn a small correction.
Zihua She · Jianxi Su · Xiao Wang
Department of Statistics, Purdue University
CCVFM in one picture. (a) Stage I compresses the data into weighted coreset atoms. (b) Stage II samples the induced velocity law in closed form, with no network. (c) Stage III learns only the small remaining correction.
- 3× lower FID with 10× fewer steps than HRF2 on MNIST. CCVFM reaches FID50k 0.75 at 51 NFE. The best HRF2 result is 2.57 at 500 NFE.
- Same network, better source. On ImageNet-32 we keep HRF2's U-Net and FID protocol and change only the source distribution. FID drops by 38% at 11 NFE and 24% at 21 NFE.
- The source is what matters. In a controlled MNIST ablation (same network, same 80k-step budget), only the inner-flow source changes. The coreset surrogate reaches FID50k 2.60 ± 0.22 at 11 NFE; the Gaussian source reaches 10.74.
- Stage I is cheap. The coreset surrogate of CIFAR-10 (K = 10,000) takes 95 s on one GPU, and ImageNet-32 (1.28M images) takes 6 min. That is under 0.5% of the training budget.
- Stage II needs no network. Sampling from the surrogate is a categorical draw plus a Gaussian draw, in closed form.
-
It comes with theory. The source-to-target transport cost CCVFM's network must learn shrinks as
$O(K^{-1/d})$ . With a Gaussian source this cost stays bounded below by a constant, however large K or n is. - The results reproduce. Five sampling seeds give MNIST FID50k 0.772 ± 0.011. Retraining from scratch with a new seed gives 0.747.
![]() MNIST FID50k 0.75 |
![]() CIFAR-10 FID50k 6.35 |
![]() ImageNet-32 FID50k 8.76 |
![]() CelebA-HQ 256 FID28k 4.17 |
Uncurated samples; the same pools were used to compute the reported FIDs.
A flow-matching model regresses the velocity
| What happens | Learned parameters | |
|---|---|---|
| Stage I: coreset | An entropic-Sinkhorn coreset compresses the data into |
none (closed form, seconds to minutes) |
| Stage II: closed-form velocity law | Plugging |
none (one categorical draw plus one Gaussian draw) |
| Stage III: correction flow | A network |
the correction network |
Sampling (
Theory in two statements (see the paper for the precise assumptions)
Define the correction task at the generation boundary as
-
Transport-task reduction.
$D(Q_{\mathrm{CCVFM}})=W_2(\rho_1,\tilde\rho_1)\le C_Q K^{-1/d}$ under the Stage-I compression assumption. For the Gaussian source,$D(Q_{\mathrm{HRF2}})\ge\sqrt d,(\sqrt{\sigma_1^2+1}-1)$ , a positive constant in$K$ and$n$ . The Euler budget needed to reach a given accuracy scales with$D(Q)^2$ . -
Training-target scale. With the surrogate source, the conditional second moment of the regression target
$V_1-V_0$ depends on within-mode quantities only. With an independent Gaussian source it pays the cross-mode diameter plus$d$ . The data-anchored coupling keeps the source marginal exactly$\tilde\pi(\cdot\mid C)$ , so training and inference use the same source.
git clone https://github.com/ziwaa-se/CCVFM.git && cd CCVFM
pip install -e . # installs the small `ccvfm` package (torch, numpy, scipy, matplotlib)
python -m pytest -q tests # checks the closed forms against dense / Monte-Carlo referencesimport torch
from ccvfm import fit_coreset_gmm, ccvfm_loss, sample, MLPCorrection
x = ... # (n, d) training data
gmm = fit_coreset_gmm(x, K=64, rank=1) # Stage I: Sinkhorn coreset + low-rank GMM
x_fast = sample(None, gmm, 10_000) # Stage II: closed form, zero network evaluations
net = MLPCorrection(dim=x.shape[1]) # Stage III: learn only the residual
opt = torch.optim.Adam(net.parameters(), lr=1e-3)
for step in range(5000):
loss = ccvfm_loss(net, gmm, x[torch.randint(len(x), (512,))])
opt.zero_grad(); loss.backward(); opt.step()
x_gen = sample(net, gmm, 10_000, L=4) # 4 network evaluationsccvfm_loss(..., source="gaussian") trains the HRF2 baseline with the same network, which makes controlled comparisons one argument away. The package is dimension-agnostic, and the low-rank covariance keeps every operation
| Example | What you get | Cost |
|---|---|---|
examples/toy2d.py |
Stage I → II → III on three 2D targets, compared against a Gaussian-source (HRF2) network with the same budget | a few minutes, CPU is fine |
examples/mnist_quickstart.py |
full pipeline on MNIST (K = 1000, r = 30, 80k steps) with sample grids and FID50k; our run gives 2.40 at 11 NFE | ~40 min on one GPU |
Output of examples/toy2d.py. With 1–2 network evaluations, CCVFM is 7–28× closer to the target (sliced W2) than the same network trained from a Gaussian source. In 2D the closed-form Stage II draw alone is already close to the target.
All FIDs use InceptionV3 pool features. FID50k compares 50k samples against the 50k training images (the HRF2 protocol). NFE counts correction-network evaluations plus one for the closed-form Stage II draw. Raw CSVs are in results/.
|
MNIST (K = 2000, r = 50)
|
ImageNet-32 (K = 5000, r = 80)
| ||||||||||||||||||||||||||||||||||||||||||
|
CIFAR-10 (K = 10000, r = 80)
|
CelebA-HQ 256 (DC-AE latent, K = 10000, r = 128)
|
Baselines are quoted from their papers (MNIST and ImageNet-32 HRF2/RF rows from HRF2, Table 7). The CIFAR-10 and CelebA baselines are shown for context and differ in protocol or architecture. See the paper for the complete tables.
To isolate the contribution of the source, we train the same correction U-Net on MNIST with the same budget (80k steps, surrogate K = 1000, r = 30). The only change is where the inner flow starts: the coreset surrogate (CCVFM) or
| Source of the inner flow | FID50k @ 6 NFE | @ 11 NFE | @ 21 NFE |
|---|---|---|---|
| Gaussian |
17.17 | 10.74 | 9.94 |
| Coreset surrogate (CCVFM), 5 seeds | 3.25 ± 0.31 | 2.60 ± 0.22 | 2.86 ± 0.36 |
The theory predicts this gap: with a Gaussian source the regression target must absorb the whole noise-to-data transport, while the surrogate source leaves only a surrogate-to-target residual (see the Theorem 3 check below). Raw numbers: results/mnist_source_ablation.csv.
These experiments were added in our public responses to the NeurIPS 2026 reviewers. The code is in experiments/rebuttal/ and the raw numbers are in results/review/. They use deliberately lightweight budgets, so absolute values are not comparable to the main tables.
Both identities of Theorem 3 hold numerically. Monte-Carlo estimates of the training-target second moment
| Dataset ( |
Surrogate: measured | Thm 3(i) | Gaussian: measured | Thm 3(ii) | Gaussian / surrogate |
|---|---|---|---|---|---|
| ring-6 (2) | 8.171 | 8.158 | 8.088 | 8.074 | 1.0 |
| moons (2) | 9.400 | 9.426 | 9.618 | 9.618 | 1.0 |
| pinwheel (2) | 4.993 | 4.988 | 6.508 | 6.486 | 1.3 |
| checkerboard (2) | 5.307 | 5.318 | 6.683 | 6.672 | 1.3 |
| helix (3) | 4.668 | 4.677 | 8.344 | 8.344 | 1.8 |
| MNIST (784) | 105.5 | 105.4 | 1655.2 | 1655.6 | 15.7 |
| CIFAR-10 (3072) | 1528.4 | 1523.2 | 6929.2 | 6929.0 | 4.5 |
Measurements and theory agree to 0.03–0.3%. On the image benchmarks the surrogate source shrinks the regression target by 16× (MNIST) and 4.5× (CIFAR-10); on the low-dimensional toys the gain is small, consistent with the dimension-proportional Gaussian term
The low-rank covariance saturates around r = 50. MNIST, K = 1000, 80k steps, FID50k (mean ± std over 3 training seeds; 5 for r = 30). The full-rank arm uses
| r | 6 NFE | 11 NFE | 21 NFE |
|---|---|---|---|
| 10 | 3.18 ± 0.06 | 3.47 ± 0.59 | 4.35 ± 0.89 |
| 30 | 3.25 ± 0.31 | 2.60 ± 0.22 | 2.86 ± 0.36 |
| 50 | 3.14 ± 0.45 | 2.38 ± 0.11 | 2.60 ± 0.13 |
| 200 | 3.22 ± 0.33 | 2.36 ± 0.18 | 2.64 ± 0.14 |
| 784 (full) | 2.90 ± 0.37 | 2.40 ± 0.16 | 2.82 ± 0.24 |
A KDE source (K = n) loses the low-NFE regime. With
Compression follows an effective dimension. Log-log slopes of the surrogate gap against K:
| Target | Diagnostic | Slope | Reference |
|---|---|---|---|
| thin circle (2D) | sliced W2 | −0.503 ± 0.013 | |
| two moons (2D) | sliced W2 | −0.467 ± 0.016 | |
| helix (curve in 3D) | sliced W2 | −0.44 ± 0.02 | nominal |
| MNIST | transport-cost proxy | −0.162 |
|
| CIFAR-10 | transport-cost proxy | −0.136 |
|
Stage I is cheap (one GPU, coreset iterations plus covariance fits, excluding data loading):
| Dataset | n | K | r | Wall-clock | Peak GPU memory |
|---|---|---|---|---|---|
| MNIST | 60k | 2,000 | 50 | 10 s | 1.6 GB |
| CIFAR-10 | 50k | 10,000 | 80 | 95 s | 6.6 GB |
| ImageNet-32 | 1.28M | 5,000 | 60 | 350 s | 22.9 GB |
Wall-clock grows near-linearly in K (2 → 20 s on MNIST and 7 → 95 s on CIFAR-10 over a 16× range), well under 1% of the Stage III training time.
Error bars. On the MNIST headline checkpoint, 5 sampling seeds give FID50k 2.958 ± 0.032 / 1.136 ± 0.017 / 0.772 ± 0.011 at 11 / 21 / 51 NFE. Re-training the whole pipeline with a different Stage III seed gives 2.994 / 1.125 / 0.747.
The exact scripts behind every number live in experiments/. experiments/README.md lists the commands, the expected output files and the provenance of each headline number. SLURM templates are in slurm/. Each run below fits on one 80 to 96 GB GPU.
| Dataset | Command (from experiments/) |
GPU time | Expected |
|---|---|---|---|
| MNIST | python prepare_mnist.py && python mnist_pixel_ccvfm.py |
~1 h | FID50k 0.75 @ 51 NFE |
| CIFAR-10 | cifar10_pixel_hrf2_ccvfm.py (400k steps), then resume_cifar10_pixel_hrf2_ccvfm.py (to 720k) |
~24 h + ~20 h | FID50k 6.35 @ 51 NFE |
| ImageNet-32 | imagenet32_pixel_hrf2_ccvfm.py |
~25 h | FID50k 8.76 @ 51 NFE |
| CelebA-HQ 256 | celebahq_dcae_dit_cfg.py (continue with resume_celebahq_dcae_dit_cfg.py if your wall-clock limit is < 52 h), then eval_celebahq_dcae_dit_cfg.py |
~52 h + ~4 h | FID 4.17 @ 51 NFE (w = 0) |
The review-period experiments (theory checks, rank and KDE ablations, compression scaling, Stage-I cost) have their own commands in experiments/rebuttal/README.md.
Every script accepts --smoke for a few-minute end-to-end check. Datasets (torchvision MNIST/CIFAR-10, Hugging Face ImageNet-32 and CelebA-HQ) and the DC-AE autoencoder download automatically on first use.
ccvfm/ small, documented, dimension-agnostic implementation (the thing to import)
coreset.py Stage I Sinkhorn coreset + closed-form PPCA lift
gmm.py low-rank GMM with Woodbury densities / sampling
velocity.py Stage II closed-form conditional velocity law, data-anchored coupling
flow.py Stage III loss + nested J x L sampler
nets.py reference MLP / U-Net correction networks, EMA
metrics.py sliced W2, Inception FID
examples/ toy2d.py, mnist_quickstart.py
experiments/ the paper scripts (MNIST, CIFAR-10, ImageNet-32, CelebA-HQ) + evaluation
rebuttal/ the additional experiments from the review (theory checks, ablations, cost)
slurm/ job templates for the experiments
results/ CSVs behind every reported number (review-period results in results/review/)
tests/ correctness tests for ccvfm/
tools/ figure generation for this README
docs/ project homepage (GitHub Pages)
@inproceedings{she2026ccvfm,
title = {Coreset-Induced Conditional Velocity Flow Matching},
author = {She, Zihua and Su, Jianxi and Wang, Xiao},
booktitle = {Advances in Neural Information Processing Systems (NeurIPS)},
year = {2026},
note = {arXiv:2605.12951}
}The dual-branch U-Net in experiments/hrf_models/ is taken from Hierarchical Rectified Flow (Zhang, Yan, Schwing & Zhao, ICLR 2025) and is itself built on OpenAI's guided-diffusion (MIT). The CelebA-HQ experiments use the DC-AE autoencoder through diffusers. See THIRD_PARTY_NOTICES.md.
MIT. See LICENSE.







