betaFeedback

WorksComputer Science

Smoother Flow Matching via Contrastive Trajectory Repulsion

Abstract

Trajectory crossing remains a critical bottleneck in Flow Matching (FM), and previous works typically view these crossings from a theoretical optimization perspective causing velocity averaging. They attempt to address it indirectly by post-hoc distillation or endpoint coupling, without explicitly regulating the intermediate trajectories. In this paper, we introduce a new network learning perspective: crossing points inherently induce large local Lipschitz constants in the target velocity field, leading to two drawbacks. First, high Lipschitz constants correspond to high-frequency signals in the velocity field that neural networks struggle to fit due to spectral bias. Second, they also imply drastic velocity variations, leading to severe numerical integration errors in few-step inference. To alleviate this, we propose CoFlow, a framework that introduces the contrastive learning paradigm into FM to explicitly repel trajectories during training, thereby lowering the local Lipschitz constants of the velocity field. Specifically, we formulate CoFlow from a Stochastic Differential Equation (SDE) perspective by injecting a repulsive drift term. This drift actively guides the forward process of positive samples away from negative trajectories, effectively reducing the local Lipschitz constant. Furthermore, we derive an equivalent stochastic interpolant formulation from this SDE, providing a simple and tractable design space to control the influence of negative samples. Extensive experiments on ImageNet 256x256 demonstrate that CoFlow significantly reduces FID compared to standard FM in few-step inference (e.g., 20 steps), with no added training overhead. The code can be accessed at: https://github.com/HKUST-LongGroup/CoFlow

Introduction

Continuous-time generative models, formulated as stochastic differential equations (SDEs) or ordinary differential equations (ODEs), have driven remarkable breakthroughs in high-quality visual synthesis. Specifically, diffusion models [14, 30] first gradually corrupt data with noise according to a predefined forward SDE and then learn a score function to reverse this process. However, probability paths induced by these forward SDEs are highly curved, thus requiring hundreds of sampling steps during inference. To overcome this, recent flow matching (FM) [17, 19, 1] enables the construction of straight probability paths and directly learns a velocity field, substantially reducing the required sampling steps.

Although designed to straighten paths for rapid sampling, standard flow matching still requires numerous steps (e.g., 50–100) in practice to generate high-fidelity samples. From a theoretical optimization perspective, this gap stems from trajectory crossings [19]: when trajectories cross1, the marginal velocity at intersections inherently becomes the expectation of conflicting velocities, yielding abrupt changes in the velocity field. During inference, these drastic velocity variations will amplify the truncation errors of numerical ODE solvers, thus degrading few-step generation performance. To alleviate this issue, prevailing approaches primarily operate on the boundaries: they either rely on post-hoc distillation to bypass intermediate integration [34, 31, 27, 19], or optimize endpoint couplings to reduce crossings [33, 5]. While both approaches are effective, a more straightforward direction seems to remain unexplored: why not fix the simple couplings and directly adjust the intermediate trajectories during training to explicitly mitigate crossings?

To bridge this gap, we first examine trajectory crossing from a neural network learning perspective, and use the local Lipschitz constant to quantify the smoothness of the velocity field. As illustrated in Figure 1(a), when trajectories cross, spatially adjacent points have drastically different velocity targets, causing the Lipschitz constant of the target velocity field to be extremely large. This large Lipschitz constant leads to two critical drawbacks: 1) It corresponds to high-frequency signals in the velocity field, which neural networks struggle to fit due to spectral bias [24]. This will make the velocity field difficult to learn accurately. 2) Theoretically, a high Lipschitz constant directly amplifies the truncation error of ODE solvers, degrading few-step sampling quality.

Figure 1. Illustration of our motivation. (a) In standard FM, straight trajectories inevitably cross. At the intersection, spatially adjacent points have conflicting velocity targets (vA≠vBv_A \ne v_B while xA≈xBx_A \approx x_B), leading to an extremely high local Lipschitz constant LL. (b) CoFlow explicitly repels trajectories to alleviate crossing, keeping xAx_A and xBx_B separated. This significantly reduces the local Lipschitz constant, yielding a smoother target velocity field that is easier to learn and induces lower numerical integration errors during few-step sampling.

Building upon this perspective, a compelling direction emerges: Explicitly repelling these conflicting trajectories during training to suppress the Lipschitz constant should enable the network to learn a smoother (i.e., with a lower local Lipschitz constant, see Figure 1(b)) velocity field. Motivated by this, we introduce CoFlow, a novel framework that systematically rectifies training trajectories via negative samples. Drawing inspiration from contrastive learning [3] (He et al. 2020), CoFlow explicitly forces the trajectory of a target sample (positive) to repel adjacent negative paths (e.g., paths targeting other data points in a mini-batch). Theoretically, we demonstrate that this dynamic is mathematically equivalent to injecting a repulsive drift into the forward stochastic process, closely related to Doob’s hh-transform [36]. From this SDE we can further derive a closed-form, stochastic interpolant (SI) formulation [1], which provides a flexible design space to control the influence of negative samples. We further prove that, when the repulsive drift vanishes at both endpoints, CoFlow still maps the source distribution to the target distribution, as in standard flow matching. A 2D experiment Figure 3 provides some initial evidence for our motivation, showing that CoFlow can learn a velocity field with lower Lipschitz and decrease the truncation errors during inference.

Figure 3. 2D Example: Gaussian to Two Moons. (a) Visualization of generated trajectories: CoFlow yields paths with reduced curvature compared to standard FM. (b) Local Lipschitz constant of the learned velocity field. (c) Relative Truncation Error reduced compared with standard FM.

A closely related contemporary work is DeltaFM [32], which also explores negative samples by introducing an auxiliary contrastive loss to the standard objective to penalize velocity similarity with negative samples. Despite sharing a similar motivation, DeltaFM focuses on velocity-level alignment rather than altering intermediate trajectories, as shown in Figure 2. Notably, another theoretical contribution of our work is proving that the optimal velocity field learned by DeltaFM is mathematically equivalent to an inference-time affine transformation of the standard FM velocity field. Leveraging this insight, we can seamlessly incorporate this transformation into CoFlow at inference time, achieving further performance gains without extra training overhead.

Figure 2. Comparison between DeltaFM and CoFlow.

To further validate the effectiveness of CoFlow, we conduct extensive experiments on the ImageNet-256 generation benchmark (Deng et al., [6]). Our evaluations demonstrate that CoFlow significantly enhances the fidelity of few-step (e.g., 20 steps) image generation. Furthermore, we illustrate its compatibility with complementary techniques, such as REPA (Yu et al., [35]), OT-CFM (Tong et al., [33]), and DeltaFM (Stoica et al., [32]). In summary, our main contributions are as follows:

  1. A Lipschitz perspective on trajectory crossing. We quantify trajectory crossing via the local Lipschitz constant, showing that its explosion amplifies numerical truncation errors and thereby degrades few-step sampling quality.

  1. CoFlow framework inspired by Doob-hh transform. We propose CoFlow, which explicitly repels conflicting trajectories via negative samples during training to suppress local Lipschitz constants, thus learning a smoother velocity field. We derive an exact closed-form formulation that enables efficient training without costly numerical simulation.

  1. Theoretical insight into DeltaFM. We theoretically prove that DeltaFM is mathematically equivalent to an inference-time affine transformation, revealing its mechanism and allowing it to be combined with CoFlow for further performance gains.

Related Works

Few Step Generation. Improving generation quality with few sampling steps is an important goal in diffusion and flow-based models. Existing efforts to achieve this can be broadly categorized into three paradigms. The first paradigm focuses on optimizing noise-data coupling during training to explicitly reduce trajectory crossing, such as Minibatch OT-CFM (Tong et al., [33]). The second paradigm relies on post-hoc rectification or distillation. For example, ReFlow (Liu et al., [19]) and InstaFlow (Liu et al., [20]) generate new synthetic data-noise pairs to retrain the model, while distillation methods like DMD (Yin et al., [34]); Salimans & Ho, [27]; Song et al., [31]) attempt to directly distill a pre-trained model for one-step generation. Recently, a third paradigm has emerged, which introduces the concept of mean velocity by incorporating extra conditioning to naturally enable single-step sampling, like Shortcut Model (Frans et al., [9]) or MeanFlow (Geng et al., [10]).CoFlow explores a complementary approach: directly adjusting intermediate training trajectories using negative samples to encourage a smoother velocity field with lower local Lipschitz constants, thereby supporting more accurate few-step sampling.

Contrastive Learning in Generative Models. Contrastive Learning (He et al., 2020; Chen et al., [3]) is a powerful learning paradigm in deep learning, fundamentally relying on negative samples to benefit training. While extensively utilized in models like GANs (Goodfellow et al., [11]), its usage into the training of continuous-time generative models has remained relatively underexplored. Interestingly, at inference time, Classifier-Free Guidance (CFG) (Ho & Salimans, [13]; Dhariwal & Nichol, [8]) acts as a de facto contrastive mechanism, pushing the target conditional generation trajectories away from unconditional ones. The remarkable effectiveness of CFG strongly implies that explicitly incorporating contrastive learning into the training phase holds great potential. Pioneering work includes Drifting Models [7] and DeltaFM [32].

Method

In this section, we detail the formulation of CoFlow, a framework that incorporates negative samples into continuous-time generative modeling. Typically, continuous-time generative models can be described from two complementary perspectives: the stochastic diffusion perspective (e.g., score SDEs [30]) and the stochastic interpolant(SI) perspective [1], which directly constructs the conditional probability path. Currently, SI has emerged as the prevailing paradigm [22], as it provides a more flexible design space. However, it often obscures the underlying physical intuition behind the stochastic diffusion dynamics.

Therefore, to rigorously introduce our method, we leverage the connection between these two paradigms. Specifically, we first introduce the mechanism of CoFlow from the SDE perspective, providing an intuitive motivation for injecting a repulsive drift via negative samples. Subsequently, we derive its equivalent formulation within the stochastic interpolant framework. Finally, we demonstrate how to train a velocity field in our framework.

Preliminaries

Continuous-Time Generative Modeling with SDE. From the stochastic dynamics perspective, continuous-time generative models define a forward process that gradually corrupts the data distribution p0p_0 to a prior noise distribution p1p_1 over time t∈[0,1]t \in[0,1], governed by the following SDE:

dxt=f(xt,t) dt+g(t) dwt(1)\mathrm{d}x_t = f(x_t,t)\,\mathrm{d}t + g(t)\,\mathrm{d}w_t \tag*{(1)}

where xt∈Rdx_t \in\mathbb{R}^{d} represents the state at time tt, wtw_t denotes a standard dd-dimensional Wiener process, f(⋅,t):Rd→Rdf(\cdot,t):\mathbb{R}^{d} \to\mathbb{R}^{d} and g(t):[0,1]→Rg(t):[0,1] \to\mathbb{R} are the drift and diffusion coefficients, respectively.

In mainstream diffusion frameworks [14, 29], the drift term is designed to be linear with respect to xtx_t, i.e., f(xt,t)=α(t)xtf(x_t,t)=\alpha(t)x_t. This linearity guarantees that the intermediate state xtx_t can be sampled in closed form by solving Eq. (1):

xt=s(t)x0+s(t)σ(t)x1,(2)x_t = s(t)x_0 + s(t)\sigma(t)x_1, \tag*{(2)}

where x0∼p0x_0 \sim p_0, x1∼p1=N(0,I)x_1 \sim p_1 = \mathcal{N}(0,I), and s(t)s(t), σ(t)\sigma(t) are related schedule functions in EDM [15] (More details in Appendix § 9). This makes it feasible to sample xtx_t in the training of the score function ∇xtlog⁡pt(xt)\nabla_{x_t}\log p_t(x_t), with the ground truth as −x1s(t)σ(t)-\frac{x_1}{s(t)\sigma(t)}. Once the score function network is learned, generation is performed by solving the corresponding reverse-time SDE from t=1t=1 to t=0t=0.

dxt=[f(xt,t)−g2(t)∇xtlog⁡pt(xt)]dt+g(t) dwˉt,(3)\mathrm{d}x_t = \left[f(x_t,t)-g^2(t)\nabla_{x_t}\log p_t(x_t)\right]\mathrm{d}t + g(t)\,\mathrm{d}\bar{w}_t, \tag*{(3)}

where dwˉt\mathrm{d}\bar{w}_t is a Wiener process running backwards in time. Because directly constructing the conditional probability paths (as in Eq. (2)) offers greater engineering efficiency, subsequent frameworks like FM opt to define the generative process directly via stochastic interpolant [2].

Flow Matching Configuration. In this paper, we consider a specific stochastic-interpolant configuration where the drift and diffusion coefficients are given by f(xt,t)=−11−txtf(x_t,t)=-\frac{1}{1-t}x_t and the diffusion coefficient is g(t)=2t1−tg(t)=\sqrt{\frac{2t}{1-t}}. Under this specific SDE, the stochastic interpolant formulation of xtx_t essentially becomes a simple linear interpolation between the data point and the prior noise: xt=(1−t)x0+tx1x_t=(1-t)x_0+tx_1, where s(t)=1−ts(t)=1-t, σ(t)=t1−t\sigma(t)=\frac{t}{1-t}. This setup essentially corresponds to standard Flow Matching.

Lipschitz Constant and Truncation Error. The spatial smoothness of a velocity field v(x,t)v(x,t) is characterized by its Lipschitz constant LL, where ∥v(xA,t)−v(xB,t)∥≤L∥xA−xB∥\lVert v(x_A,t)-v(x_B,t)\rVert\leq L\lVert x_A-x_B\rVert. When simulating the ODE via an Euler step with step size Δt\Delta t, the single-step truncation error is defined as the gap between the true trajectory and the numerical update:

E(xt,Δt,vt)=∥x(t+Δt)−(x(t)+Δt v(x(t),t))∥≤(LM+B)Δt2(4)\mathcal{E}(x_t,\Delta t,v_t)=\lVert x(t+\Delta t)-(x(t)+\Delta t\,v(x(t),t))\rVert\leq(LM+B)\Delta t^2 \tag*{(4)}

Where M,BM,B are constants bounding the velocity and time variable (See Appendix § 13 for detailed proof). Consequently, for a fixed step size Δt\Delta t, suppressing the local Lipschitz constant LL effectively decreases this error, thus improving few-step sampling performance.

Fixed Endpoints via Doob's hh-Transform

The standard forward diffusion trajectory described in Eq. (1) transports a source point x0x_0 towards a random destination in the prior p1p_1. However, in many practical scenarios, such as image-to-image translation [36, 4, 18, 16], the source-target pairs are explicitly defined. Thus, it becomes necessary to modify the forward trajectory such that it deterministically terminates at a specific target state x1x_1.

This can be achieved via Doob's hh-transform [36]. Specifically, conditioning the SDE on a fixed terminal endpoint x1x_1 at t=1t=1 introduces an additional drift term to Eq. (1), yielding the conditional bridge SDE that terminates at x1x_1:

dxt=[f(xt,t)+g2(t)⋅∇xtlog⁡p(x1∣xt)]dt+g(t) dwt.(5)\mathrm{d}x_t = \left[f(x_t,t) + g^2(t) \cdot\nabla_{x_t}\log p(x_1\mid x_t)\right]\mathrm{d}t + g(t)\,\mathrm{d}w_t. \tag*{(5)}

In this formulation, the additional drift, g2(t)∇xtlog⁡p(x1∣xt)g^2(t)\nabla_{x_t}\log p(x_1\mid x_t), acts as an attractive force guiding the particle's trajectory towards the target x1x_1. For instance, under the specific linear configuration discussed in § 3.1, this attractive force simplifies to x1−xt1−t\frac{x_1-x_t}{1-t}. As t→1t\to1, the magnitude of this force increases to infinity, mathematically guaranteeing that the trajectory terminates exactly at x1x_1.

This mechanism inspires our core motivation: if injecting a specific drift can exert an attractive force towards a target point, it is a natural extension to introduce a repulsive force that pushes the trajectory away from a negative sample. This physical intuition forms the foundational motivation for our following CoFlow framework.

CoFlow

Consider a target trajectory that transports a source point x0x_0 towards a destination x1x_1 alongside a reference pair (x0r,x1r)(x_0^r,x_1^r). We regard the reference pair as a negative sample when its induced trajectory lies in close spatial proximity to the positive trajectory, as such cases can lead to a more challenging optimization landscape, characterized by a large local Lipschitz constant. The core motivation of CoFlow is to inject a repulsive force b(xt,t,xtr)b(x_t,t,x_t^r) into the drift term of Eq. (1) to push the target particle away from the negative trajectory. Formally, this repulsive SDE is defined as follows:

dx^t=[f(xt,t)−b(xt,t,xtr)]dt+g(t) dwt(6)\mathrm{d}\hat{x}_t = \left[f(x_t,t)-b(x_t,t,x_t^r)\right]\mathrm{d}t + g(t)\,\mathrm{d}w_t \tag*{(6)}

Mathematically, the corresponding stochastic interpolant for this modified SDE can be expressed in the following equation (See Appendix § 10 for more details):

x^t=s(t)x0+s(t)σ(t)x1−s(t)∫0tb(xξ,ξ,xξr)s(ξ) dξ,(7)\hat{x}_t=s(t)x_0+s(t)\sigma(t)x_1-s(t)\int_0^t\frac{b(x_\xi,\xi,x_\xi^r)}{s(\xi)}\,\mathrm{d}\xi, \tag*{(7)}

where x^t\hat{x}_t represents the new trajectory that dynamically bypasses the negative sample. Eq. (7) demonstrates that injecting a repulsive drift into the SDE is fundamentally equivalent to modifying the standard stochastic interpolant.

Simulation-Free Reparameterization. The integral in Eq. (7) renders the sampling of x^t\hat{x}_t computationally intractable during training. To circumvent this, we propose a simple reparameterization trick to make it simulation-free. Specifically, instead of defining the repulsive drift bb and computing the integral, we directly define a tractable modified trajectory x^t\hat{x}_t:

x^t=s(t)x0+s(t)σ(t)x1−b^(xt,t,xtr),(8)\hat{x}_t=s(t)x_0+s(t)\sigma(t)x_1-\hat{b}(x_t,t,x_t^r), \tag*{(8)}

Here, xt=s(t)x0+s(t)σ(t)x1x_t=s(t)x_0+s(t)\sigma(t)x_1 denotes the standard baseline trajectory. Under this formulation, the repulsive drift in Eq. (6) can be analytically calculated through

b(xt,t,xtr)=s(t)ddt[b^(xt,t,xtr)/s(t)](9)b(x_t,t,x_t^r)=s(t)\frac{\mathrm{d}}{\mathrm{d}t}\left[\hat{b}(x_t,t,x_t^r)/s(t)\right] \tag*{(9)}

Crucially, CoFlow provides the flexibility to explicitly design b^\hat{b}. For example, by constraining b^\hat{b} to vanish at the boundaries (i.e., b^(⋅,0,⋅)=b^(⋅,1,⋅)=0\hat{b}(\cdot,0,\cdot)=\hat{b}(\cdot,1,\cdot)=0), CoFlow mathematically guarantees a strictly unbiased transformation between the prior noise and the target data distribution (See proof in Appendix § 11). In this paper, we primarily focus on this unbiased regime to ensure a fair comparison with standard FM. However, the empirical success of CFG indicates that introducing specific distributional biases can sometimes yield superior generative fidelity. This suggests a broader design space for b^\hat{b}, potentially allowing for intentional shifts at the boundary distributions. And we leave this for future work. After deciding the drift b^\hat{b}, a velocity field utθ(x^t)u_t^\theta(\hat{x}_t) can be learned by regressing against the closed-form target conditional velocity field:

LCoFlow=E[∥utθ(x^t)−vt(x^t)∥2](10)\mathcal{L}_{CoFlow} = \mathbb{E}\left[\left\|u_t^\theta(\hat{x}_t)-v_t(\hat{x}_t)\right\|^2\right] \tag*{(10)}

where the input x^t\hat{x}_t is sampled from Eq. (8), the target vt(x^t)=dx^tdtv_t(\hat{x}_t)=\frac{d\hat{x}_t}{dt} is calculated by taking the time derivative of x^t\hat{x}_t. The inference stage is the same as that in standard flow matching.

Design Space

The adjustment term b^(xt,t,xtr)\hat{b}(x_t,t,x_t^r) and scheduling functions s(t),σ(t)s(t),\sigma(t) constitute the design space of CoFlow. While b^(xt,t,xtr)\hat{b}(x_t,t,x_t^r) can theoretically take any form, to systematically explore this space, we decouple it into three distinct components:

b^(xt,t,xtr)=λ⋅β(t)⋅x−.(11)\hat{b}(x_t,t,x_t^r)=\lambda\cdot\beta(t)\cdot x^-. \tag*{(11)}

Strength Factor λ\lambda. This hyperparameter controls the overall strength of the repulsive adjustment.

Time Schedule β(t)\beta(t). This function dictates how the repulsive adjustment varies across time, providing fine-grained dynamic control. As discussed in § 3.3, to ensure an unbiased transformation, we enforce the boundary conditions, i.e., β(0)=β(1)=0\beta(0)=\beta(1)=0. For simplicity, we fix this as a symmetric schedule β(t)=t(1−t)\beta(t)=t(1-t).

Algorithm 1: CoFlow: Training

# fn(x, t): velocity network
# x0: training batch of data
t, x1 = rand_t(),randn_like(x0)

# Negative sampling
idx = randperm(x0.shape[0])
x0_r, x1_r = x0[idx], x1[idx]

# Base interpolants and velocities
xt = (1 - t) * x0 + t * x1
xt_r = (1 - t) * x0_r + t * x1_r
vt, vt_r = x1 - x0, x1_r - x0_r

# CoFlow trajectory adjustment
x_hat = xt - lam * t * (1 - t) * (xt_r
    - xt)
v_hat = vt - lam * (1 - 2 * t) * (xt_r
    - xt)
    - lam * t * (1 - t) * (vt_r - vt)

u = fn(x_hat, t)
loss = mse_loss(u, v_hat)

Negative Signal x−x^-. This term defines the specific directional signal used to repel the current state xtx_t away from the reference trajectory xtrx_t^r. In this paper, we investigate three distinct formulations for x−x^-: 1) State Residual (xtr−xt)(x_t^r-x_t), the most intuitive spatial signal. Pushing the trajectory in the exact opposite direction of the concurrent negative state at timestep tt directly reduces the local Lipschitz constant. 2) Endpoint Residual (x1r−x1)(x_1^r-x_1). Because the state residual might introduce high variance dynamically across different timesteps, this strategy repels the trajectories at an instance level, thereby reducing temporal variance. 3) Velocity Residual (vtr−vt)(v_t^r-v_t). Inspired by DeltaFM, this strategy leverages the difference in the target velocities as the directional signal.

Sampling Policy. This dictates how we obtain the reference trajectory (x0r,x1r)(x_0^r,x_1^r) within a mini-batch. Specifically, we explore three distinct policies: 1) Random: We uniformly sample another trajectory from the current mini-batch to serve as the negative reference. 2) Nearest. We search for the most spatially adjacent sample in the batch as the reference. 3) Largest Lipschitz. We select the sample that yields the highest local Lipschitz constant relative to the target.

For the remainder of this paper, we default to the linear interpolation configuration, where s(t)=1−ts(t)=1-t and σ(t)=t1−t\sigma(t)=\frac{t}{1-t}. By default, we adopt the random sampling policy and utilize the state residual (xtr−xt)(x_t^r-x_t) as the negative signal. Under this specific setting, the explicit CoFlow stochastic interpolant and its corresponding target velocity field become:

x^t=(1−t)x0+tx1−λt(1−t)(xtr−xt)(12)\hat{x}_t=(1-t)x_0+tx_1-\lambda t(1-t)(x_t^r-x_t) \tag*{(12)}
vt(x^t)=x1−x0−λ[(1−2t)(xtr−xt)+t(1−t)(vtr−vt)](13)v_t(\hat{x}_t)=x_1-x_0-\lambda\left[(1-2t)(x_t^r-x_t)+t(1-t)(v_t^r-v_t)\right] \tag*{(13)}

Here, vtr=x1r−x0rv_t^r=x_1^r-x_0^r and vt=x1−x0v_t=x_1-x_0 represent the velocities for the reference and target trajectories, respectively. The complete training pipeline is summarized in Algorithm 1.

Experiments

Experimental Setup. We evaluated CoFlow on class-conditional ImageNet 256×256 using SiT (Ma et al., [22]) backbones. Images were encoded into the latent space using a pre-trained SD-VAE (Rombach et al., [25]) before training. Unless otherwise specified, all models were trained for 400K steps with a global batch size of 256, using AdamW (Loshchilov & Hutter, [21]) with a constant learning rate of 1×10−41 \times10^{-4} and no weight decay. For evaluation, we generated 50K images using a 20-step Euler–Maruyama (EM) sampler by default. We reported FID (Heusel et al., [12]), sFID (Nash et al., [23]), Inception Score (IS) (Salimans et al., [28]), Recall (Sajjadi et al., [26]), and Precision (Sajjadi et al., [26]). All remaining settings followed the SiT configuration.

Comparison with Standard Flow Matching

Setting. We compared CoFlow with standard FM using SiT-B/2 and SiT-XL/2 using the training protocol described above. For each method, we trained with and without REPA. For CoFlow, it was trained using the state residual as the negative signal, λ=0.2\lambda= 0.2, and β(t)=t(1−t)\beta(t) = t(1 - t), as described in § 3.4. The results in Table 1 are obtained without classifier-free guidance (CFG).

ModelMethodFID↓\downarrowsFID↓\downarrowIS↑\uparrowPrecision↑\uparrowRecall↑\uparrow
SiT-B/2FM61.4335.1827.460.430.54
SiT-B/2CoFlow52.7921.7135.000.450.58
SiT-B/2FM + REPA47.6434.3340.750.480.59
SiT-B/2CoFlow + REPA37.7620.2352.920.510.60
SiT-XL/2FM38.5029.2750.140.540.58
SiT-XL/2CoFlow29.6517.4164.120.570.59
SiT-XL/2FM + REPA35.3527.9863.130.520.55
SiT-XL/2CoFlow + REPA27.7817.8880.520.550.53

Table 1. Class-Conditional ImageNet 256×256. Training for 400k steps. We sample 50K images using the EMSolver, with the number of function evaluations (NFE) set to 20. No CFG involved.

Few-Step Generation. Table 1 reports generation quality at NEF = 20. Without REPA, CoFlow reduces FID from 61.43 to 52.79 on SiT-B/2 and from 38.50 to 29.65 on SiT-XL/2. The other four metrics also improve and the improvements are retained when using REPA. These results demonstrate the effectiveness of CoFlow in improving few-step generation. Figure 4 provides a qualitative comparison using the 20-step EM sampler.

Qualitative comparison of FM and Ours images across training iterations

Figure 4. Qualitative comparison. All images are generated using a 20-step EM solver.

Effect of Sampling Budget. Figure 5 reports FID-10K across different numbers of evaluation (NFE). CoFlow substantially outperforms standard FM at low NFEs, and this gap generally narrows as NFE increases, with two methods achieving similar FID at 250 NFEs. This trend is consistent with our motivation: learning a smoother velocity field with lower local Lipschitz constants can decrease numerical truncation errors under few sampling steps. As the sampling budget increases, finer discretization reduces these errors for both methods, diminishing the advantage of CoFlow. These results suggest that CoFlow primarily improves sampling efficiency in the few-step setting.

Figure 5. FID-10K versus NFE for Standard FM and CoFlow. EM solver was used to sample on SiT-B/2 without REPA.

Compatibility with Other Methods

We investigated CoFlow’s compatibility with two closely related methods: DeltaFM, which also exploits negative samples, and OT-CFM, which seeks to mitigate trajectory crossing.

DeltaFM. DeltaFM incorporates negative samples through modifying the training objective, whereas CoFlow adjusts the intermediate trajectories. Although DeltaFM was originally introduced as a training-based method, we show that its optimal velocity field can be obtained by an affine transformation of the optimal standard FM field. We therefore apply this transformation to a trained standard FM model to approximate the DeltaFM solution without additional training:

uθΔFM(xt)=uθFM(xt)−λmt1−λ,(14)u_{\theta}^{\Delta\mathrm{FM}}(x_t) = \frac{u_{\theta}^{\mathrm{FM}}(x_t) - \lambda m_t}{1-\lambda}, \tag*{(14)}

where mtm_t is calculated by averaging the latents across the entire training set. We refer to this equivalent training-free operation as velocity centering (VC) and provide the derivation in Appendix § 12. As shown in Table 5, applying VC to trained FM models yields performance comparable to models trained with the DeltaFM objective.

ModelMethodFID ↓\downarrowsFID ↓\downarrowIS ↑\uparrow
SiT-B/2FM27.6411.7661.07
SiT-B/2DeltaFM20.405.4870.41
SiT-B/2FM + VC19.975.4571.44
SiT-XL/2FM11.408.69114.69
SiT-XL/2DeltaFM7.294.93129.89
SiT-XL/2FM + VC7.384.84130.25

Table 5. Comparison with DeltaFM. Both models are trained with REPA involved and NEF=50 for inference. “VC” denotes the inference-time Velocity Centering operation.

We next evaluated whether VC could further improve CoFlow, using SiT-B/2 trained for 400K steps with REPA. As shown in Table 2, applying VC reduces CoFlow’s FID from 37.76 to 27.74 and outperforms DeltaFM on all three metrics. These results demonstrate that CoFlow’s trajectory adjustment can be effectively combined with DeltaFM for further improvement.

MethodFID↓\downarrowsFID↓\downarrowIS↑\uparrow
FM47.6434.3340.75
DeltaFM32.3215.7356.33
CoFlow37.7620.2352.92
CoFlow+VC27.748.6863.94

Table 2. Compatibility with DeltaFM. Trained on SiT-B/2 + REPA for 400K steps.

OT-CFM. OT-CFM attempts to reduce trajectory crossing by optimizing the coupling between noise and data, whereas CoFlow directly adjusts the intermediate trajectories. To evaluate whether they are compatible, we combined CoFlow with OT-CFM using SiT-B/2 trained for 400K steps without REPA. Table 3 shows that incorporating CoFlow with OT-CFM reduces FID from 69.90 to 63.92 and sFID from 38.87 to 25.96. These improvements indicate that trajectory adjustment remains beneficial when combined with optimized endpoint coupling.

MethodFID↓\downarrowsFID↓\downarrowIS↑\uparrow
OT-CFM69.9038.8723.47
+CoFlow63.9225.9628.75

Table 3. Compatibility with OT-CFM. Trained on SiT-B/2 without REPA.

Component-Wise Ablation

We examined the negative signal, sampling policy, and repulsive strength using SiT-S/2 trained for 400K steps without REPA. Table 4 reports the results of varying one component at a time. The default configuration uses λ=0.2\lambda= 0.2, the state residual (xtr−xt)(x_t^r - x_t), and random negative sampling.

λ\lambdaNegative signal x−x^{-}Sampling policyFID↓\downarrowsFID↓\downarrowIS↑\uparrow
Standard FM86.9943.4716.25
0.2ϵ\epsilonRandom86.4941.7716.49
0.2xtr−xtx_t^r - x_tRandom79.5526.6320.36
0.2x1r−x1x_1^r - x_1Random92.2447.2216.25
0.2vtr−vtv_t^r - v_tRandom122.1987.049.41
0.2xtr−xtx_t^r - x_tRandom79.5526.6320.36
0.2xtr−xtx_t^r - x_tLipschitz78.1226.1620.66
0.2xtr−xtx_t^r - x_tNearest79.4024.6420.27
0.05xtr−xtx_t^r - x_tRandom85.6639.7717.04
0.2xtr−xtx_t^r - x_tRandom79.5526.6320.36
0.5xtr−xtx_t^r - x_tRandom75.0614.8222.45
1.0xtr−xtx_t^r - x_tRandom87.4356.7314.15

Table 4. Component-wise ablation on ImageNet 256×256. All models were SiT-S/2 trained for 400K iterations without REPA. We evaluated 50K images using the EM sampler with NFE = 20 and fixed β(t)=t(1−t)\beta(t) = t(1 - t). Colored cells indicate the factor varied in each block.

Negative signal. We first used random noise as signal to test whether random perturbations alone could explain CoFlow’s gains. This control changes FID only slightly, from 86.99 to 86.49, suggesting that simply perturbing the trajectories cannot bring the observed improvement. We then compared three signals derived from negative trajectories: the state, endpoint, and velocity residuals. The state residual (xtr−xtx_t^r - x_t) performs best across all three metrics, achieving an FID of 79.55. We hypothesize that the state residual is more suitable to reduce local Lipschitz constants, as it guides repulsion using the relative positions of trajectories.

Sampling policy. We compared the Random, Nearest, and Lipschitz policies described in § 3.4. Although negatives can be selected using states at time tt, the selected negatives may change as tt varies, introducing discontinuities in the stochastic interpolant in Eq. (12). To avoid this, we used endpoint states x0x_0 to select negatives for the Nearest and Lipschitz policies as a practical compromise. It turns out all three policies improve upon standard FM, with Lipschitz achieving the lowest FID of 78.12. This is consistent with our motivation to improve few-step generation by reducing local Lipschitz constants. Because random sampling remains competitive with an FID of 79.55, we adopt it as the default policy for its simplicity.

Strength factor. We varied λ∈{0.05,0.2,0.5,1.0}\lambda\in\{0.05, 0.2, 0.5, 1.0\}, with λ=0\lambda= 0 corresponding to standard FM. Increasing λ\lambda from 0.05 to 0.5 improves FID from 85.66 to 75.06. However, increasing λ\lambda further to 1.0 degrades FID to 87.43, slightly worse than standard FM. These results show that moderate repulsion improves generation quality, while an excessively strong adjustment can be detrimental.

Conclusion

This paper presents CoFlow, a framework that utilizes negative samples to repel crossing training trajectories, which is inspired by Doob-hh transform. Motivated by the relationship between trajectory crossing and local Lipschitz constants, CoFlow adjusts intermediate to encourage a smoother velocity field. We derived a closed-form stochastic interpolant that preserves the endpoint distributions and enables simulation-free training. Experiments on ImageNet 256 × 256 demonstrate improved few-step generation and compatibility with methods like REPA and OT-CFM. We also developed an inference-time velocity adjustment that is equivalent to DeltaFM, which can further improves CoFlow without additional training. Our findings suggest that contrastive learning can serve as a mechanism for adjusting training trajectories to improve few-step generation in flow matching.

AI Use Statement

In this work, we used generative AI tools (specifically, ChatGPT) solely for assistance with language polishing and grammatical improvements. We have not used generative AI tools for research ideation, data collection, mathematical proofs, experimental implementation, or writing the scientific claims of this paper. All AI-assisted revisions were thoroughly reviewed and verified by the authors. We take full responsibility for the final content of this work, including all text, claims, and artifacts.

Reproducibility Statement

We provide the CoFlow training procedure in Algorithm 1 and describe its design choices and default configuration in § 3.4. The training and evaluation settings, together with component-wise ablations, are reported in § 4. Supporting derivations and assumptions are provided in Appendices § 9–§ 12, including the formulation and implementation of velocity centering. Our anonymous implementation is available at https://anonymous.4open.science/r/CoFlow-A0A0.

Limitations

Our image-generation experiments focus on class-conditional ImageNet 256 × 256 with SiT backbones, due to limited computational resources. The effectiveness of CoFlow on other datasets, higher resolutions, and different generation tasks remains to be evaluated. In addition, our current implementation uses a fixed repulsion schedule and selects negative samples independently of time to retain a simple closed-form target velocity. Future work could explore adaptive schedules and time-dependent negative selection while preserving smooth interpolants and tractable velocity targets.

Marginal Equivalence between SDE and SI

In this section, we give a self-contained proof of related conclusions in § 3.1. Formally, we need to for the following SDE:

dxt=f(xt,t) dt+g(t) dwt,(15)\mathrm{d}x_t = f(x_t,t)\,\mathrm{d}t + g(t)\,\mathrm{d}w_t, \tag*{(15)}

it admits the following representation in distribution for each fixed time tt:

xt=ds(t)x0+s(t)σ(t)x1,(16)x_t \overset{d}{=} s(t)x_0 + s(t)\sigma(t)x_1, \tag*{(16)}

where f(xt,t)=α(t)xtf(x_t,t)=\alpha(t)x_t, and =d\overset{d}{=} denotes equality in distribution. A typical method is to introduce an integrating factor as follow:

s(t)=exp⁡(∫0tα(ξ) dξ)(17)s(t)=\exp\left(\int_0^t \alpha(\xi)\,\mathrm{d}\xi\right) \tag*{(17)}

Take the derivative with respect to time tt of s(t)s(t), we have:

ds(t)dt=α(t)⋅exp⁡(∫0tα(ξ) dξ)=α(t)s(t)(18)\frac{\mathrm{d}s(t)}{\mathrm{d}t}=\alpha(t)\cdot\exp\left(\int_0^t\alpha(\xi)\,\mathrm{d}\xi\right)=\alpha(t)s(t) \tag*{(18)}

Which means:

ds(t)=α(t)s(t)dt(19)\mathrm{d}s(t)=\alpha(t)s(t)\mathrm{d}t \tag*{(19)}

Then we consider the differential of xts(t)\frac{x_t}{s(t)}:

d(xts(t))=dxts(t)−xtds(t)s(t)2(20)\mathrm{d}\left(\frac{x_t}{s(t)}\right)=\frac{\mathrm{d}x_t}{s(t)}-\frac{x_t\mathrm{d}s(t)}{s(t)^2} \tag*{(20)}
d(xts(t))=α(t)xtdt+g(t)dwts(t)−xt(α(t)s(t)dt)s(t)2(21)\mathrm{d}\left(\frac{x_t}{s(t)}\right)=\frac{\alpha(t)x_t\mathrm{d}t+g(t)\mathrm{d}w_t}{s(t)}-\frac{x_t\left(\alpha(t)s(t)\mathrm{d}t\right)}{s(t)^2} \tag*{(21)}
d(xts(t))=[α(t)xts(t)dt+g(t)s(t)dwt]−α(t)xts(t)dt(22)\mathrm{d}\left(\frac{x_t}{s(t)}\right)=\left[\frac{\alpha(t)x_t}{s(t)}\mathrm{d}t+\frac{g(t)}{s(t)}\mathrm{d}w_t\right]-\frac{\alpha(t)x_t}{s(t)}\mathrm{d}t \tag*{(22)}
d(xts(t))=g(t)s(t)dwt(23)\mathrm{d}\left(\frac{x_t}{s(t)}\right)=\frac{g(t)}{s(t)}\mathrm{d}w_t \tag*{(23)}

Then we can integrate both sides of the equation from 0 to tt to solve xtx_t:

∫0td(xξs(ξ))=∫0tg(ξ)s(ξ)dwξ(24)\int_0^t \mathrm{d}\left(\frac{x_\xi}{s(\xi)}\right)=\int_0^t\frac{g(\xi)}{s(\xi)}\mathrm{d}w_\xi \tag*{(24)}
x(t)s(t)−x(0)s(0)=∫0tg(ξ)s(ξ)dwξ(25)\frac{x(t)}{s(t)}-\frac{x(0)}{s(0)}=\int_0^t\frac{g(\xi)}{s(\xi)}\mathrm{d}w_\xi \tag*{(25)}

According to the definition, s(0)=exp⁡(∫00α(ξ)dξ)=exp⁡(0)=1s(0)=\exp\left(\int_0^0\alpha(\xi)\mathrm{d}\xi\right)=\exp(0)=1, therefore we have:

x(t)=s(t)x(0)+s(t)∫0tg(ξ)s(ξ)dwξ(26)x(t)=s(t)x(0)+s(t)\int_0^t\frac{g(\xi)}{s(\xi)}\mathrm{d}w_\xi \tag*{(26)}

According to the properties of stochastic calculus, the integral of a deterministic function g(ξ)s(ξ)\frac{g(\xi)}{s(\xi)} with respect to Brownian motion dwξ\mathrm{d}w_\xi follows a normal distribution with a mean of 0 and a variance equal to the integral of the square of that function (known as the Itô Isometry):

∫0tg(ξ)s(ξ)dwξ∼N(0,(∫0tg(ξ)2s(ξ)2dξ)I)(27)\int_0^t\frac{g(\xi)}{s(\xi)}\mathrm{d}w_\xi\sim\mathcal{N}\left(0,\left(\int_0^t\frac{g(\xi)^2}{s(\xi)^2}\mathrm{d}\xi\right)I\right) \tag*{(27)}

Therefore, let σ(t)2=∫0tg(ξ)2s(ξ)2dξ\sigma(t)^2 = \int_0^t \frac{g(\xi)^2}{s(\xi)^2}d\xi, and x1∼N(0,I)x_1 \sim\mathcal{N}(0,I), the solution can be reparameterized as Eq (2):

xt=ds(t)x0+s(t)σ(t)x1(28)x_t \mathrel{\overset{d}{=}} s(t)x_0+s(t)\sigma(t)x_1 \tag*{(28)}
s(t)=exp⁡(∫0tα(ξ)dξ)(29)s(t)=\exp\left(\int_0^t\alpha(\xi)d\xi\right) \tag*{(29)}
σ(t)2=∫0tg(ξ)2s(ξ)2dξ(30)\sigma(t)^2=\int_0^t\frac{g(\xi)^2}{s(\xi)^2}d\xi \tag*{(30)}

The results are consistent with those in EDM (Karras et al., [15]). This representation matches the SDE’s one-time marginals; using a fixed x1x_1 across time defines an interpolant that need not have the same joint distribution across time. For the special configuration, where α(t)=−11−t\alpha(t)=-\frac{1}{1-t} and g(t)=2t1−tg(t)=\sqrt{\frac{2t}{1-t}}, substitute them into the definition of s(t),σ(t)s(t),\sigma(t):

s(t)=exp⁡(∫0t−11−ξdξ)=1−t.(31)s(t)=\exp\left(\int_0^t\frac{-1}{1-\xi}d\xi\right)=1-t. \tag*{(31)}
σ(t)2=∫0t2ξ(1−ξ)3dξ=t2(1−t)2(32)\sigma(t)^2=\int_0^t\frac{2\xi}{(1-\xi)^3}d\xi=\frac{t^2}{(1-t)^2} \tag*{(32)}

Therefore, xt=ds(t)x0+s(t)σ(t)x1=(1−t)x0+tx1x_t \mathrel{\overset{d}{=}} s(t)x_0+s(t)\sigma(t)x_1=(1-t)x_0+tx_1, which is linear.

Equivalence of CoFlow

In this section, we prove the equivalence between Eq (6) and Eq (7). Formally, for the following SDE:

dxt=[f(xt,t)−b(xt,t,xtr)] dt+g(t) dwt(33)d x_t=[f(x_t,t)-b(x_t,t,x_t^r)]\,dt+g(t)\,dw_t \tag*{(33)}

Its solution should be in the form as follows:

x^t=s(t)x0+s(t)σ(t)x1−s(t)∫0tb(xξ,ξ,xξr)s(ξ)dξ,(34)\hat{x}_t=s(t)x_0+s(t)\sigma(t)x_1-s(t)\int_0^t\frac{b(x_\xi,\xi,x_\xi^r)}{s(\xi)}d\xi, \tag*{(34)}

The proof is similar to that in Appendix B, with the same definition of s(t)s(t) and σ(t)\sigma(t). Specifically, while adding an additional drift b(xt,t,xtr)b(x_t,t,x_t^r) to Eq (1), the differential of xts(t)\frac{x_t}{s(t)} becomes:

d(xts(t))=dxts(t)−xtds(t)s(t)2(35)d\left(\frac{x_t}{s(t)}\right)=\frac{dx_t}{s(t)}-\frac{x_tds(t)}{s(t)^2} \tag*{(35)}
d(xts(t))=α(t)xtdt−b(xt,t,xtr)dt+g(t)dwts(t)−xt(α(t)s(t)dt)s(t)2(36)d\left(\frac{x_t}{s(t)}\right)=\frac{\alpha(t)x_tdt-b(x_t,t,x_t^r)dt+g(t)dw_t}{s(t)}-\frac{x_t(\alpha(t)s(t)dt)}{s(t)^2} \tag*{(36)}
d(xts(t))=[α(t)xts(t)dt−b(xt,t,xtr)s(t)dt+g(t)s(t)dwt]−α(t)xts(t)dt(37)d\left(\frac{x_t}{s(t)}\right)=\left[\frac{\alpha(t)x_t}{s(t)}dt-\frac{b(x_t,t,x_t^r)}{s(t)}dt+\frac{g(t)}{s(t)}dw_t\right]-\frac{\alpha(t)x_t}{s(t)}dt \tag*{(37)}
d(xts(t))=g(t)s(t)dwt−b(xt,t,xtr)s(t)dt(38)d\left(\frac{x_t}{s(t)}\right)=\frac{g(t)}{s(t)}dw_t-\frac{b(x_t,t,x_t^r)}{s(t)}dt \tag*{(38)}

Similarly, we integrate both sides of the equation from 00 to tt to solve xtx_t:

∫0td(xξs(ξ))=∫0tg(ξ)s(ξ)dwξ−∫0tb(xξ,ξ,xξr)s(ξ)dξ(39)\int_0^t d\left(\frac{x_\xi}{s(\xi)}\right)=\int_0^t\frac{g(\xi)}{s(\xi)}dw_\xi-\int_0^t\frac{b(x_\xi,\xi,x_\xi^r)}{s(\xi)}d\xi \tag*{(39)}
x(t)s(t)−x(0)s(0)=∫0tg(ξ)s(ξ)dwξ−∫0tb(xξ,ξ,xξr)s(ξ)dξ(40)\frac{x(t)}{s(t)}-\frac{x(0)}{s(0)}=\int_0^t\frac{g(\xi)}{s(\xi)}dw_\xi-\int_0^t\frac{b(x_\xi,\xi,x_\xi^r)}{s(\xi)}d\xi \tag*{(40)}

Therefore, we can solve xtx_t:

x(t)=s(t)x(0)+s(t)∫0tg(ξ)s(ξ)dwξ−s(t)∫0tb(xξ,ξ,xξr)s(ξ)dξ(41)x(t)=s(t)x(0)+s(t)\int_0^t\frac{g(\xi)}{s(\xi)}dw_\xi-s(t)\int_0^t\frac{b(x_\xi,\xi,x_\xi^r)}{s(\xi)}d\xi \tag*{(41)}

Because f(xt,t)f(x_t,t), s(t)s(t), σ(t)\sigma(t), g(t)g(t) are identical in the two SDEs(Eq. (1) and Eq. (6)), xtx_t can be simplified into:

x^t=s(t)x0+s(t)σ(t)x1−s(t)∫0tb(xξ,ξ,xtr)s(ξ) dξ(42)\hat{x}_t=s(t)x_0+s(t)\sigma(t)x_1-s(t)\int_0^t\frac{b(x_\xi,\xi,x_t^r)}{s(\xi)}\,\mathrm{d}\xi \tag*{(42)}

Additionally, for the Simulation-Free Reparameterization, we define b^(xt,t,xtr)\hat{b}(x_t,t,x_t^r) as:

b^(xt,t,xtr)=s(t)∫0tb(xξ,ξ,xtr)s(ξ) dξ(43)\hat{b}(x_t,t,x_t^r)=s(t)\int_0^t\frac{b(x_\xi,\xi,x_t^r)}{s(\xi)}\,\mathrm{d}\xi \tag*{(43)}
b^(xt,t,xtr)s(t)=∫0tb(xξ,ξ,xtr)s(ξ) dξ(44)\frac{\hat{b}(x_t,t,x_t^r)}{s(t)}=\int_0^t\frac{b(x_\xi,\xi,x_t^r)}{s(\xi)}\,\mathrm{d}\xi \tag*{(44)}

Take the time derivative of both sides:

ddt[b^(xt,t,xtr)/s(t)]=b(xt,t,xtr)s(t)(45)\frac{\mathrm{d}}{\mathrm{d}t}\left[\hat{b}(x_t,t,x_t^r)/s(t)\right]=\frac{b(x_t,t,x_t^r)}{s(t)} \tag*{(45)}
b(xt,t,xtr)=s(t)ddt[b^(xt,t,xtr)/s(t)](46)b(x_t,t,x_t^r)=s(t)\frac{\mathrm{d}}{\mathrm{d}t}\left[\hat{b}(x_t,t,x_t^r)/s(t)\right] \tag*{(46)}

This completes the proof.

Unbiasedness of CoFlow

In this section, we provide a rigorous mathematical proof that the proposed CoFlow interpolant strictly guarantees an unbiased transformation from the prior noise distribution p1p_1 to the target data distribution p0p_0, provided that the repulsive adjustment term respects the boundary conditions.

Let x0∼p0x_0\sim p_0 be the data distribution and x1∼p1x_1\sim p_1 be the prior noise distribution. Let z=(x0,x1,x0r,x1r)z=(x_0,x_1,x_0^r,x_1^r) denote the joint set of base and reference samples. We define the CoFlow stochastic interpolant path as:

x^t=I(t,z)=s(t)x0+s(t)σ(t)x1−b^t(z)\hat{x}_t=I(t,z)=s(t)x_0+s(t)\sigma(t)x_1-\hat{b}_t(z)

where b^t(z)\hat{b}_t(z) is an abbreviation for the repulsive adjustment term b^(xt,t,xtr)\hat{b}(x_t,t,x_t^r). For the CoFlow adjustment term, we strictly enforce b^0(z)=0\hat{b}_0(z)=0 and b^1(z)=0\hat{b}_1(z)=0 for all zz. Let ρt(x)\rho_t(x) denote the time-dependent marginal probability density function of x^t\hat{x}_t.

First, we check the boundary situation when t=0t=0 and t=1t=1:

x^0=1⋅x0+0⋅x1−b^0(z)=x0(47)\hat{x}_0=1\cdot x_0+0\cdot x_1-\hat{b}_0(z)=x_0 \tag*{(47)}

Since x0∼p0x_0\sim p_0, the marginal density ρ0(x)=p0(x)\rho_0(x)=p_0(x).

x^1=0⋅x0+1⋅x1−b^1(z)=x1(48)\hat{x}_1=0\cdot x_0+1\cdot x_1-\hat{b}_1(z)=x_1 \tag*{(48)}

Since x1∼p1x_1\sim p_1, the marginal density ρ1(x)=p1(x)\rho_1(x)=p_1(x).

About the flow from ρ1\rho_1 to ρ0\rho_0, the continuity equation always holds:

∂ρt(x)∂t+∇⋅(ρt(x)vt(x))=0(49)\frac{\partial\rho_t(x)}{\partial t}+\nabla\cdot\left(\rho_t(x)v_t(x)\right)=0 \tag*{(49)}

Therefore, once vt(x)v_t(x) is obtained, we can use it to transfer between the two distributions. To solve vt(x)v_t(x), we use the standard test function approach. For any test function ϕ(x)\phi(x), we consider the time derivative of its expectation with respect to the marginal density ρt(x)\rho_t(x):

ddtEx^t∼ρt[ϕ(x^t)]=ddt∫ϕ(x)ρt(x) dx=∫ϕ(x)∂ρt(x)∂t dx(50)\frac{\mathrm{d}}{\mathrm{d}t}\mathbb{E}_{\hat{x}_t\sim\rho_t}\left[\phi(\hat{x}_t)\right]=\frac{\mathrm{d}}{\mathrm{d}t}\int\phi(x)\rho_t(x)\,\mathrm{d}x=\int\phi(x)\frac{\partial\rho_t(x)}{\partial t}\,\mathrm{d}x \tag*{(50)}

Alternatively, by taking the derivative inside the expectation over the path generation process and applying the chain rule:

ddtExt[ϕ(x^t)]=Ext[∇ϕ(x^t)⋅dx^tdt](51)\frac{d}{dt}\mathbb{E}_{x_t}\left[\phi(\hat{x}_t)\right] = \mathbb{E}_{x_t}\left[\nabla\phi(\hat{x}_t)\cdot\frac{d\hat{x}_t}{dt}\right] \tag*{(51)}
=Ex^t∼ρt[Ez[∇ϕ(x^t)⋅dx^tdt | x^t]](52)= \mathbb{E}_{\hat{x}_t\sim\rho_t}\left[\mathbb{E}_z\left[\nabla\phi(\hat{x}_t)\cdot\frac{d\hat{x}_t}{dt}\,\middle|\,\hat{x}_t\right]\right] \tag*{(52)}
=Ex^t∼ρt[∇ϕ(x^t)⋅Ez[dx^tdt | x^t]](53)= \mathbb{E}_{\hat{x}_t\sim\rho_t}\left[\nabla\phi(\hat{x}_t)\cdot\mathbb{E}_z\left[\frac{d\hat{x}_t}{dt}\,\middle|\,\hat{x}_t\right]\right] \tag*{(53)}
=∫ρt(x)∇ϕ(x)⋅vt(x)dx(54)= \int\rho_t(x)\nabla\phi(x)\cdot v_t(x)dx \tag*{(54)}
=−∫ϕ(x)∇⋅(ρt(x)vt(x))dx(55)= -\int\phi(x)\nabla\cdot\left(\rho_t(x)v_t(x)\right)dx \tag*{(55)}

Here, zz means all possible (x0,x1)(x_0,x_1) pairings that pass given xtx_t, and vt(x)=Ez[dx^tdt | x^t=x]v_t(x)=\mathbb{E}_z\left[\frac{d\hat{x}_t}{dt}\,\middle|\,\hat{x}_t=x\right]. This means:

∫ϕ(x)∂ρt(x)∂tdx=−∫ϕ(x)∇⋅(ρt(x)vt(x))dx(56)\int\phi(x)\frac{\partial\rho_t(x)}{\partial t}dx=-\int\phi(x)\nabla\cdot\left(\rho_t(x)v_t(x)\right)dx \tag*{(56)}

This perfectly matches the continuity equation, which means vt(x)v_t(x) defined as Ez[dx^tdt | x^t=x]\mathbb{E}_z\left[\frac{d\hat{x}_t}{dt}\,\middle|\,\hat{x}_t=x\right] is the velocity field that can achieve the distribution transformation.

According to Theorem 7 in Stochastic Interpolant (Albergo et al., [2]), to learn this marginal velocity field, a neural network uθ(x^t,t)u_\theta(\hat{x}_t,t) can be trained to minimize the mean squared error against the conditional velocity target:

LCoFlow(θ)=Et,z[∥uθ(x^t,t)−dx^tdt∥2]\mathcal{L}_{CoFlow}(\theta)=\mathbb{E}_{t,z}\left[\left\|u_\theta(\hat{x}_t,t)-\frac{d\hat{x}_t}{dt}\right\|^2\right]

Therefore, we prove that the training of CoFlow is the same as that in standard FM.

Training-free Equivalence of DeltaFM

In this section, we provide the detailed derivation for the training-free formulation of DeltaFM and discuss the empirical results presented in Table 5. We adapt the derivations in the DeltaFM appendix (Stoica et al., [32]) to our notation. The objective of DeltaFM is defined as follows:

L(ΔFM)(θ)=E[∥vθ(xt,t)−(α˙tx^+σ˙tϵ)∥2−λ∥vθ(xt,t)−(α˙tx~+σ˙tϵ~)∥2]\mathcal{L}^{(\Delta FM)}(\theta)=\mathbb{E}\left[\left\|v_\theta(x_t,t)-(\dot{\alpha}_t\hat{x}+\dot{\sigma}_t\epsilon)\right\|^2-\lambda\left\|v_\theta(x_t,t)-(\dot{\alpha}_t\tilde{x}+\dot{\sigma}_t\tilde{\epsilon})\right\|^2\right]

Let (x^,ϵ)(\hat{x},\epsilon) denote the positive data-noise pair used to construct the model’s input, xt=αtx^+σtϵx_t=\alpha_t\hat{x}+\sigma_t\epsilon. Similarly, let (x~,ϵ~)(\tilde{x},\tilde{\epsilon}) represent another data-noise pair independently sampled from the current batch, serving as the negative sample. The interpolant coefficients αt\alpha_t and σt\sigma_t correspond to s(t)s(t) and s(t)σ(t)s(t)\sigma(t) in our CoFlow framework, respectively.

For brevity, write v(θ)=vθ(xt,t)v(\theta)=v_\theta(x_t,t). Expanding the squared norms and completing the square gives

L(ΔFM)(θ)=E[(1−λ)∥v(θ)∥2−2v(θ)⊤(α˙tx^+σ˙tϵ−λ(α˙tx~+σ˙tϵ~))]+C1,(57)\mathcal{L}^{(\Delta\mathrm{FM})}(\theta)=\mathbb{E}\left[(1-\lambda)\lVert v(\theta)\rVert^2-2v(\theta)^\top\left(\dot{\alpha}_t\hat{x}+\dot{\sigma}_t\epsilon-\lambda(\dot{\alpha}_t\tilde{x}+\dot{\sigma}_t\tilde{\epsilon})\right)\right]+C_1, \tag*{(57)}
=E[∥1−λv(θ)−α˙tx^+σ˙tϵ−λ(α˙tx~+σ˙tϵ~)1−λ∥2]+C2,(58)=\mathbb{E}\left[\left\lVert\sqrt{1-\lambda}v(\theta)-\frac{\dot{\alpha}_t\hat{x}+\dot{\sigma}_t\epsilon-\lambda(\dot{\alpha}_t\tilde{x}+\dot{\sigma}_t\tilde{\epsilon})}{\sqrt{1-\lambda}}\right\rVert^2\right]+C_2, \tag*{(58)}

where C1C_1 and C2C_2 do not depend on θ\theta and therefore do not affect the minimizer.

For a fixed input (x,t)(x,t), the conditional objective is strictly convex in the predicted velocity because 1−λ>01-\lambda>0. Setting its gradient to zero yields

(1−λ)vtΔFM,∗(x)=E[α˙tx^+σ˙tϵ∣xt=x,t]−λE[α˙tx~+σ˙tϵ~∣xt=x,t].(59)(1-\lambda)v_t^{\Delta\mathrm{FM},*}(x)=\mathbb{E}\left[\dot{\alpha}_t\hat{x}+\dot{\sigma}_t\epsilon\mid x_t=x,t\right]-\lambda\mathbb{E}\left[\dot{\alpha}_t\tilde{x}+\dot{\sigma}_t\tilde{\epsilon}\mid x_t=x,t\right]. \tag*{(59)}

The first conditional expectation is the optimal standard FM velocity field:

vtFM,∗(x)=E[α˙tx^+σ˙tϵ∣xt=x,t].(60)v_t^{\mathrm{FM},*}(x)=\mathbb{E}\left[\dot{\alpha}_t\hat{x}+\dot{\sigma}_t\epsilon\mid x_t=x,t\right]. \tag*{(60)}

Because the negative pair is independent of the positive pair and the sampled time, the second conditional expectation simplifies to

E[α˙tx~+σ˙tϵ~∣xt=x,t]=E[α˙tx~+σ˙tϵ~∣t]=mt.(61)\mathbb{E}\left[\dot{\alpha}_t\tilde{x}+\dot{\sigma}_t\tilde{\epsilon}\mid x_t=x,t\right] =\mathbb{E}\left[\dot{\alpha}_t\tilde{x}+\dot{\sigma}_t\tilde{\epsilon}\mid t\right]=m_t. \tag*{(61)}

We therefore obtain the following relation between the optimal velocity fields:

vtΔFM,∗(x)=vtFM,∗(x)−λmt1−λ.(62)v_t^{\Delta\mathrm{FM},*}(x)=\frac{v_t^{\mathrm{FM},*}(x)-\lambda m_t}{1-\lambda}. \tag*{(62)}

Since the Gaussian prior has zero mean, mtm_t simplifies to

mt=α˙tEx~∼p0[x~]+σ˙tEϵ~∼N(0,I)[ϵ~](63)m_t=\dot{\alpha}_t\mathbb{E}_{\tilde{x}\sim p_0}[\tilde{x}]+\dot{\sigma}_t\mathbb{E}_{\tilde{\epsilon}\sim\mathcal{N}(0,I)}[\tilde{\epsilon}] \tag*{(63)}
=α˙tμdata,(64)=\dot{\alpha}_t\mu_{\mathrm{data}}, \tag*{(64)}

where μdata\mu_{\mathrm{data}} is the mean of the data distribution in VAE latent space. Eq. (62) shows that the optimal DeltaFM velocity field is an affine transformation of the optimal standard FM field. Applying this transformation to a learned standard FM velocity field gives an approximation to the optimal DeltaFM field:

uθΔFM(xt)=uθFM(xt)−λmt1−λ,(65)u_\theta^{\Delta\mathrm{FM}}(x_t)=\frac{u_\theta^{\mathrm{FM}}(x_t)-\lambda m_t}{1-\lambda}, \tag*{(65)}

where uθΔFMu_\theta^{\Delta\mathrm{FM}} denotes the transformed prediction and mtm_t is estimated from the training data. We call this operation velocity centering (VC), which requires no additional model training. To verify its effectiveness, we conducted the experiments in Table 5. Specifically, we estimated the data mean by averaging the SD-VAE latents across the entire training set.

To evaluate VC, we estimated the data mean by averaging the SD-VAE latents across the entire training set and applied the transformation to trained FM models during inference. As shown in Table 5, FM+VC achieves performance comparable to models explicitly trained with the DeltaFM objective, supporting the effectiveness of this training-free formulation.

Lipschitz Constants and Euler Discretization Error

Consider the ODE x˙(s)=v(x(s),s)\dot{x}(s)=v(x(s),s). Assume that, in a neighborhood of the trajectory over [t,t+h][t,t+h], the velocity is bounded by MM and is Lipschitz continuous in space and time with constants LL and BB, respectively. Starting from the definition of the single-step Euler error, we obtain

E=∥x(t+h)−x(t)−hv(x(t),t)∥=∥∫tt+h[v(x(s),s)−v(x(t),t)] ds∥≤∫tt+h[∥v(x(s),s)−v(x(t),s)∥+∥v(x(t),s)−v(x(t),t)∥] ds≤∫tt+h[L∥x(s)−x(t)∥+B(s−t)] ds≤∫tt+h[L∫ts∥v(x(r),r)∥ dr+B(s−t)] ds≤∫tt+h(LM+B)(s−t) ds=12(LM+B)h2.(66)\begin{aligned} \mathcal{E} &= \left\|x(t+h)-x(t)-h v(x(t),t)\right\| \\ &= \left\|\int_t^{t+h}\left[v(x(s),s)-v(x(t),t)\right]\,\mathrm{d}s\right\| \\ &\le\int_t^{t+h}\left[\left\|v(x(s),s)-v(x(t),s)\right\|+\left\|v(x(t),s)-v(x(t),t)\right\|\right]\,\mathrm{d}s \\ &\le\int_t^{t+h}\left[L\left\|x(s)-x(t)\right\|+B(s-t)\right]\,\mathrm{d}s \\ &\le\int_t^{t+h}\left[L\int_t^s\left\|v(x(r),r)\right\|\,\mathrm{d}r+B(s-t)\right]\,\mathrm{d}s \\ &\le\int_t^{t+h}(LM+B)(s-t)\,\mathrm{d}s \\ &= \frac{1}{2}(LM+B)h^2. \tag*{(66)} \end{aligned}

For fixed MM and BB, reducing the spatial Lipschitz constant LL tightens this error bound.

References

  1. [1]Michael S Albergo and Eric Vanden-Eijnden. Building normalizing flows with stochastic interpolants. arXiv preprint arXiv:2209.15571, 2022.arxiv.org/abs/2209.15571
  2. [2]Michael S Albergo, Mark Goldstein, Nicholas M Boffi, Rajesh Ranganath, and Eric Vanden-Eijnden. Stochastic interpolants with data-dependent couplings. arXiv preprint arXiv:2310.03725, 2023.arxiv.org/abs/2310.03725
  3. [3]Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pp. 1597–1607. PmLR, 2020.arxiv.org/abs/2002.05709
  4. [4]Hyungjin Chung, Jeongsol Kim, Michael T Mccann, Marc L Klasky, and Jong Chul Ye. Diffusion posterior sampling for general noisy inverse problems. arXiv preprint arXiv:2209.14687, 2022.arxiv.org/abs/2209.14687
  5. [5]Aram Davtyan, Leello Tadesse Dadi, Volkan Cevher, and Paolo Favaro. Faster inference of flow-based generative models via improved data-noise coupling. arXiv preprint arXiv:2603.15279, 2026.arxiv.org/abs/2603.15279
  6. [6]Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248–255. Ieee, 2009.
  7. [7]Mingyang Deng, He Li, Tianhong Li, Yilun Du, and Kaiming He. Generative modeling via drifting. arXiv preprint arXiv:2602.04770, 2026.arxiv.org/abs/2602.04770
  8. [8]Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. Advances in neural information processing systems, 34:8780–8794, 2021.
  9. [9]Kevin Frans, Danijar Hafner, Sergey Levine, and Pieter Abbeel. One step diffusion via shortcut models. arXiv preprint arXiv:2410.12557, 2024.arxiv.org/abs/2410.12557
  10. [10]Zhengyang Geng, Mingyang Deng, Xingjian Bai, J Zico Kolter, and Kaiming He. Mean flows for one-step generative modeling. arXiv preprint arXiv:2505.13447, 2025.arxiv.org/abs/2505.13447
  11. [11]Ian J Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. Advances in neural information processing systems, 27, 2014.
  12. [12]Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30, 2017.
  13. [13]Jonathan Ho and Tim Salimans. Classifier-free diffusion guidance. arXiv preprint arXiv:2207.12598, 2022.arxiv.org/abs/2207.12598
  14. [14]Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in neural information processing systems, 33:6840–6851, 2020.arxiv.org/abs/2006.11239
  15. [15]Tero Karras, Miika Aittala, Timo Aila, and Samuli Laine. Elucidating the design space of diffusion-based generative models. Advances in neural information processing systems, 35:26565–26577, 2022.arxiv.org/abs/2206.00364
  16. [16]Bahjat Kawar, Michael Elad, Stefano Ermon, and Jiaming Song. Denoising diffusion restoration models. Advances in neural information processing systems, 35:23593–23606, 2022.arxiv.org/abs/2201.11793
  17. [17]Yaron Lipman, Ricky TQ Chen, Heli Ben-Hamu, Maximilian Nickel, and Matt Le. Flow matching for generative modeling. arXiv preprint arXiv:2210.02747, 2022.arxiv.org/abs/2210.02747
  18. [18]Guan-Hong Liu, Arash Vahdat, De-An Huang, Evangelos A Theodorou, Weili Nie, and Anima Anandkumar. I²SB: Image-to-image schrödinger bridge. arXiv preprint arXiv:2302.05872, 2023a.
  19. [19]Xingchao Liu, Chengyue Gong, and Qiang Liu. Flow straight and fast: Learning to generate and transfer data with rectified flow. arXiv preprint arXiv:2209.03003, 2022.arxiv.org/abs/2209.03003
  20. [20]Xingchao Liu, Xiwen Zhang, Jianzhu Ma, Jian Peng, et al. Instaflow: One step is enough for high-quality diffusion-based text-to-image generation. In The Twelfth International Conference on Learning Representations, 2023b.arxiv.org/abs/2309.06380
  21. [21]Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
  22. [22]Nanye Ma, Mark Goldstein, Michael S Albergo, Nicholas M Boffi, Eric Vanden-Eijnden, and Saining Xie. SiT: Exploring flow and diffusion-based generative models with scalable interpolant transformers. In European Conference on Computer Vision, pp. 23–40. Springer, 2024.
  23. [23]Charlie Nash, Jacob Menick, Sander Dieleman, and Peter W Battaglia. Generating images with sparse representations. arXiv preprint arXiv:2103.03841, 2021.arxiv.org/abs/2103.03841
  24. [24]Nasim Rahaman, Aristide Baratin, Devansh Arpit, Felix Draxler, Min Lin, Fred Hamprecht, Yoshua Bengio, and Aaron Courville. On the spectral bias of neural networks. In International conference on machine learning, pp. 5301–5310. PMLR, 2019.arxiv.org/abs/1806.08734
  25. [25]Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10684–10695, 2022.arxiv.org/abs/2112.10752
  26. [26]Mehdi SM Sajjadi, Olivier Bachem, Mario Lucic, Olivier Bousquet, and Sylvain Gelly. Assessing generative models via precision and recall. Advances in neural information processing systems, 31, 2018.arxiv.org/abs/1806.00035
  27. [27]Tim Salimans and Jonathan Ho. Progressive distillation for fast sampling of diffusion models. arXiv preprint arXiv:2202.00512, 2022.arxiv.org/abs/2202.00512
  28. [28]Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. Advances in neural information processing systems, 29, 2016.arxiv.org/abs/1606.03498
  29. [29]Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. Advances in neural information processing systems, 32, 2019.arxiv.org/abs/1907.05600
  30. [30]Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. arXiv preprint arXiv:2011.13456, 2020.arxiv.org/abs/2011.13456
  31. [31]Yang Song, Prafulla Dhariwal, Mark Chen, and Ilya Sutskever. Consistency models. In International conference on machine learning, 2023.arxiv.org/abs/2303.01469
  32. [32]George Stoica, Vivek Ramanujan, Xiang Fan, Ali Farhadi, Ranjay Krishna, and Judy Hoffman. Contrastive flow matching. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1185–1194, 2025.arxiv.org/abs/2506.05350
  33. [33]Alexander Tong, Kilian Fatras, Nikolay Malkin, Guillaume Huguet, Yanlei Zhang, Jarrid Rector-Brooks, Guy Wolf, and Yoshua Bengio. Improving and generalizing flow-based generative models with minibatch optimal transport. arXiv preprint arXiv:2302.00482, 2023.arxiv.org/abs/2302.00482
  34. [34]Tianwei Yin, Michaël Gharbi, Richard Zhang, Eli Shechtman, Fredo Durand, William T Freeman, and Taesung Park. One-step diffusion with distribution matching distillation. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 6613–6623, 2024.arxiv.org/abs/2311.18828
  35. [35]Sihyun Yu, Sangkyung Kwak, Huiwon Jang, Jongheon Jeong, Jonathan Huang, Jinwoo Shin, and Saining Xie. Representation alignment for generation: Training diffusion transformers is easier than you think. arXiv preprint arXiv:2410.06940, 2024.arxiv.org/abs/2410.06940
  36. [36]Linqi Zhou, Aaron Lou, Samar Khanna, and Stefano Ermon. Denoising diffusion bridge models. arXiv preprint arXiv:2309.16948, 2023.arxiv.org/abs/2309.16948

Paper details

vlnc:W_trw7xss4
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 1

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

ChatGPT

View statement
Looking for related papers…
Contents