NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Contrastive Flow Map Matching

Junyu Zhang, Daochang Liu, Younghyun Kim, Jong Hwan Ko, Shichao Zhang, Chang Xu, Eunbyung ParkICML 2026

Abstract Diffusion and flow-based models have revolutionized image generation but are traditionally bottlenecked by slow, multi-step sampling processes. Flow Map Matching (FMM) addresses this by learning finite-time transport maps for one- or few-step generation. However, FMMs often suffer from a training-sampling discrepancy that degrades image quality. Contrastive Flow Map Matching (CFMM) is a novel, principled training framework that explicitly aligns FMM training with inference-time sampling. By leveraging a joint-KL decomposition and a contrastive loss, CFMM significantly improves the fidelity and perceptual quality of generated images without introducing any inference-time overhead.

The Challenge: Training-Sampling Discrepancy While FMMs successfully compress the generation process into giant leaps from noise to data, they face a critical hurdle: the mismatch between training and sampling. During training, models learn from perfect, ground-truth transitions. During inference, however, the model must rely on its own imperfect previous steps. These small errors accumulate, causing the generated samples to drift away from the true data manifold.

Standard FMM training relies on simple pixel-wise regression. This approach is often too brittle to correct semantic drifts, leading to blurry or inconsistent images when the number of sampling steps is severely limited. Furthermore, standard FMM training targets are often "self-referential"—depending on the model's current parameters—which creates an intrinsic bias early in the training process.

Methodology: Contrastive Flow Map Matching (CFMM) To overcome these limitations, CFMM introduces a framework grounded in a theoretical "joint-KL decomposition." The authors provide a mathematical proof demonstrating that the total generation error (the reverse KL divergence) can be upper-bounded by the sum of two specific mismatches: marginal and conditional. CFMM tackles these through two complementary objectives:

  1. Marginal Alignment (Average-Velocity Regression): This objective ensures that the intermediate states generated by the model remain close to the expected distribution of noisy data at any given time step.
  2. Conditional Refinement (Sampling-Aligned InfoNCE Loss): This is the core innovation of CFMM. Recognizing that pixel-perfect reconstruction is overly restrictive for few-step generation, the authors employ a contrastive loss in a high-level feature space. By passing both the generated image and the ground-truth target through a frozen, pre-trained feature encoder (DINOv2), the model learns to maximize semantic similarity. It pulls the features of the generated image closer to the target while pushing them away from other "negative" samples in the batch.

Crucially, CFMM is a training-only plug-in. It can be used to fine-tune existing FMM models or train new ones from scratch. Because the contrastive encoder is discarded after training, CFMM incurs zero additional computational cost during inference.

Experimental Results CFMM was evaluated across several standard generative modeling benchmarks, including CIFAR-10, ImageNet (256×256), and LSUN (Bedroom and Cat, 256×256). It consistently outperformed baseline models across various architectures (Shortcut, MeanFlow, TiM, and $\alpha$-Flow):

  • ImageNet (256×256): Applied to the MeanFlow-XL/2 baseline, CFMM improved the 1-step Fréchet Inception Distance (FID) from 3.47 to 2.95. For 2-step generation, FID improved from 2.46 to 2.10.
  • CIFAR-10: When trained from scratch, CFMM achieved an FID of 2.70, surpassing the original MeanFlow (2.92) and several state-of-the-art consistency models.
  • LSUN: Fine-tuning existing Consistency Models (CT) with CFMM yielded improvements in both FID and Precision/Recall metrics, demonstrating the framework's robustness across different fast-sampling architectures.

Limitations and Future Directions While highly effective, CFMM has a few limitations. The objectives used are "surrogates" motivated by KL divergence; they do not directly minimize the exact KL divergence, which remains computationally intractable. Additionally, the conditional refinement relies heavily on the quality of the frozen DINOv2 encoder. While excellent for natural images, its effectiveness may vary in specialized domains like medical or satellite imaging where such pre-trained encoders are less robust.

Future work may explore "unfreezing" the contrastive encoder during training or developing tighter theoretical links between the contrastive objective and the model-induced conditional distribution.

Summary updated

BibTeX
@inproceedings{zhang2026contrastive,
  author = {Junyu Zhang and Daochang Liu and Younghyun Kim and Jong Hwan Ko and Shichao Zhang and Chang Xu and Eunbyung Park},
  title = {{Contrastive Flow Map Matching}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=d9AhmsW5JA},
}
Figure