Easing Training Process of Rectified Flow Models Via Lengthening Inter-Path Distance

Xu Shifeng, Yanzhu Liu, Adams Wai-Kin KongICLR 2025

TL;DR

Distance-Aware Noise-Sample Matching (DANSM) is a novel training strategy designed to accelerate the convergence of Rectified Flow Models (RFMs) and Diffusion Models (DMs). By strategically matching noise to training samples to maximize the distance between their transformation trajectories, DANSM reduces "gradient interference." This makes the mapping process significantly easier for the neural network to learn, yielding a 30% to 40% speedup in training time without sacrificing generation quality.

The Problem: Tangled Paths and Gradient Interference

Training generative models like Diffusion Models or Rectified Flow Models fundamentally involves teaching a neural network to map a point in a chaotic "noise space" to a structured point in "data space" (such as a coherent image). Traditionally, this mapping is established by pairing a training image with a completely random sample of Gaussian noise.

Recent research highlights a fundamental inefficiency in this random pairing approach: path crossing. In high-dimensional spaces, if the trajectories (or paths) from two different noise samples to their respective target images pass too close to one another, the model receives conflicting optimization signals. At a specific "noisy" state, the network might be instructed to move toward "Image A" in one training step, and toward "Image B" in the next.

This messy, tangled path structure creates friction. It slows down the training process because the model requires significantly more iterations to resolve the ambiguity of these intersecting trajectories.

The Solution: Distance-Aware Noise-Sample Matching (DANSM)

To untangle these trajectories, the researchers propose Distance-Aware Noise-Sample Matching (DANSM). The core objective of DANSM is to pair noises and samples in a way that ensures the resulting paths are as far apart as possible, thereby maximizing the "inter-path distance."

The methodology relies on several key technical contributions:

  1. Mathematical Derivation for Straight Paths: Rectified Flow Models utilize straight-line paths between noise and data. Leveraging this, the authors derived a closed-form formula to precisely calculate the distance between any two paths.
  2. The Optimization Surrogate: Calculating exact inter-path distances for thousands of pairs across a dataset is computationally prohibitive. To solve this, the authors proved a crucial negative correlation: minimizing the individual path length (the Euclidean distance between a specific noise point and its paired sample) generally maximizes the distance between different paths.
  3. Greedy Matching Algorithm: Instead of relying on complex, computationally heavy optimization solvers (like the $O(n^3)$ Hungarian algorithm used in previous methods), DANSM employs a simple, GPU-accelerated greedy algorithm. For a given batch, it pairs each sample with its nearest available noise point ($O(n^2)$ complexity). This transforms a complex path-distance optimization into a highly efficient "nearest neighbor" search.

Experimental Setup

The authors evaluated DANSM across several standard benchmarks, testing both pixel space and compressed latent space representations:

  • CIFAR-10: 32x32 images.
  • ImageNet64: 64x64 images.
  • LSUN Bedroom: 256x256 images.
  • FFHQ: 256x256 face images.
  • Latent Spaces: The method was also applied to the latent variables of Stable Diffusion (SD) to demonstrate its efficacy on compressed data representations.

Key Findings and Results

By forcing the model to start with a "clean," well-organized mapping where paths rarely cross, DANSM achieves substantial improvements in both speed and quality.

Visual comparison of generated bedroom images using Rectified Flow Models (RFM) and Diffusion Models (DM).
  • Significant Speedup: DANSM reduces the total training time required to reach a baseline image quality (measured by FID score) by 30% to 40%.
  • Higher Generation Quality: When trained for the same number of epochs, DANSM consistently achieves lower (better) FID scores than baseline methods. For instance, on the CIFAR-10 dataset, the baseline FID of 16.5 was drastically improved to 9.7 using DANSM with a large match-size.
  • Broad Generalization: Although the mathematical foundation of DANSM is derived from the straight-line logic of Rectified Flows, empirical evidence shows it works remarkably well for standard Diffusion Models, which typically utilize curved paths. On latent Bedroom datasets, DANSM reached a target FID in just 5.37 hours, compared to the baseline's 8.55 hours.

Limitations and Future Directions

While highly effective, DANSM has a few limitations that pave the way for future research:

  • Match-Size Dependency: The method's success is tied to the "match-size" (the number of noise/sample pairs compared simultaneously). While larger match-sizes yield better path organization, they also increase the computational overhead of the matching step.
  • Theoretical Proof for Curved Paths: The success of DANSM on standard Diffusion Models is currently backed by strong empirical results. A rigorous mathematical proof extending the inter-path distance logic to curved trajectories remains an open challenge.
  • Batch Independence: Currently, matching occurs only within isolated batches (match-sets). Exploring how global matching across an entire dataset might further improve results is a promising, albeit computationally daunting, future direction.

Summary updated

BibTeX
@inproceedings{shifeng2025easing,
  author = {Xu Shifeng and Yanzhu Liu and Adams Wai-Kin Kong},
  title = {{Easing Training Process of Rectified Flow Models Via Lengthening Inter-Path Distance}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=RaR3ETzyKp},
}
Figure