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

The Curse of Conditions: Analyzing and Improving Optimal Transport for Conditional Flow-Based Generation

Ho Kei Cheng, Alexander G. Schwing · DOI

Introduction

Flow-matching models have emerged as a powerful alternative to Diffusion, learning to transform a simple noise distribution (the prior) into complex data. A key goal in this field is achieving "straight paths" during generation. Straight paths are computationally efficient, allowing high-quality image synthesis in just a few numerical steps.

To achieve this, researchers frequently employ Minibatch Optimal Transport (OT). By pairing noise and data samples to minimize total travel distance during training, OT effectively straightens the vector field. While this works exceptionally well for unconditional models, this paper identifies a critical failure mode—the "curse of conditions"—where standard OT degrades performance in conditional generation tasks (e.g., class-conditioned or text-to-image generation).

The Problem: The Skewed Prior

The authors discover that standard OT creates a train-test gap by inducing a correlation between the noise distribution ($x_0$) and the condition ($c$). Because OT ignores labels when pairing noise with data, it may inadvertently "reserve" specific regions of the noise space for specific labels during training.

Visualizing the train-test gap: Standard OT (middle) skews the prior by separating noise distributions by condition during training, leading to failure at test time when the full noise distribution is used. $C^2OT$ (right) maintains the independence of noise and conditions.

At test time, the model is expected to generate a sample for a specific condition using the entire noise distribution. However, if the model only saw a subset of that noise paired with that condition during training, it fails to generalize. This violation of the independence between noise and conditions is the root of the performance drop.

Proposed Method: Conditional Optimal Transport ($C^2OT$)

To resolve this, the authors introduce Conditional Optimal Transport ($C^2OT$). The core innovation is a condition-aware OT coupling achieved by modifying the cost function used during training:

$$\text{Cost} = \|x_0 - x_1\|^2 + f(c_0, c_1)$$

By adding a penalty term $f(c_0, c_1)$ based on the conditions, the model is forced to prioritize pairings that share similar or identical labels.

  • Discrete Conditions: For class labels, the penalty is set to infinity for mismatched classes, restricting OT to within-class pairings.
  • Continuous Conditions: For text embeddings, a weighted cosine distance is used to penalize pairings with dissimilar semantic meanings.
  • Adaptive Weighting: The method includes an adaptive search to automatically balance the condition penalty against the spatial distance, ensuring robust performance without manual tuning.

Key Results

$C^2OT$ consistently outperforms both standard Flow Matching (FM) and standard OT across synthetic and high-dimensional datasets like CIFAR-10 and ImageNet.

Comparison of FM, OT, and $C^2OT$ across unconditional, discrete, and continuous conditions. $C^2OT$ achieves significantly straighter paths and lower error (bolded) in conditional settings, especially for single-step generation.

Superior Few-Step Generation

In the most challenging "Euler-1 step" regime, $C^2OT$ achieves a 2-Wasserstein distance of 0.048 on 2D discrete tasks, compared to 0.483 for standard OT. This indicates that $C^2OT$ successfully straightens paths without sacrificing the model's ability to follow conditional prompts.

Image Quality and Condition Adherence

On CIFAR-10, $C^2OT$ reached an FID of 2.90, surpassing both basic FM (2.92) and standard OT (4.14). Crucially, on ImageNet, $C^2OT$ maintained high CLIP scores, proving that it respects text prompts while standard OT often ignores them in favor of path straightness.

Conclusion

$C^2OT$ provides a simple yet effective fix for the pitfalls of using Optimal Transport in conditional generative models. By restoring the independence between the prior noise and the conditioning information, it enables the training of flow models that are both computationally efficient (straight paths) and highly accurate (respecting the data distribution and conditions). Unlike "Reflow" methods, $C^2OT$ achieves these benefits in a single training run, making it a highly practical tool for modern generative AI.

Summary updated

BibTeX
@inproceedings{cheng2025curse,
  author = {Ho Kei Cheng and Alexander G. Schwing},
  title = {{The Curse of Conditions: Analyzing and Improving Optimal Transport for Conditional Flow-Based Generation}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure