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

Reflected Flow Matching

Tianyu Xie, Yu Zhu, Longlin Yu, Tong Yang, Ziheng Cheng, Shiyue Zhang, Xiangyu Zhang, Cheng Zhang

TL;DR

Reflected Flow Matching (RFM) extends the efficiency of Flow Matching to data living on constrained domains, such as bounded boxes or simplices. By incorporating a reflection term into the underlying Ordinary Differential Equation (ODE), RFM ensures that generated trajectories never leave the valid data manifold. This eliminates "out-of-bounds" artifacts—like oversaturated pixels in images—while maintaining the fast, simulation-free training of vanilla Flow Matching.

The Problem: Boundary Violations in Generative Models

Deep generative models like Continuous Normalizing Flows (CNFs) learn to transform simple noise into complex data by following a "velocity field" defined by an ODE. Recently, Flow Matching (FM) has emerged as a highly efficient, "simulation-free" approach for training these models. Instead of solving an expensive ODE during training, FM simply regresses the model toward a target conditional velocity.

However, most real-world data is constrained. For example, RGB image pixels must strictly stay between 0 and 255 (or scaled between 0 and 1). In standard FM, numerical errors during sampling or inaccuracies in the learned velocity model can push trajectories outside these boundaries. This leads to "boundary violations," resulting in unnatural, "burnt," or oversaturated images.

This problem is particularly acute when using classifier-free guidance, a technique used to improve sample quality that often pushes the model's predictions toward extreme values. While "Reflected Diffusion Models" (RDMs) exist to handle such constraints, they are often biased, require complex approximations for the "score" function near boundaries, and are computationally expensive to train.

Methods: Introducing Reflected Flow Matching

To address these limitations, the authors introduce Reflected Flow Matching (RFM). The core innovation is the use of a Reflected ODE:

$$d\phi_t(x) = v_t(\phi_t(x))dt + dL_t$$

Here, $dL_t$ acts as a reflection term—a mathematical "cushion" at the boundary. If a trajectory attempts to exit the valid domain $\Omega$, the reflection term immediately pushes it back inside.

Illustration of reflected trajectories in non-convex domains like the Half Annulus and Cup.

Key technical contributions include: * Simulation-Free Training: The authors prove that these reflected models can be trained using a conditional objective similar to vanilla FM. The reflection mechanism does not need to be simulated during every training step, preserving FM's core efficiency. * Analytical Conditional Velocity Fields: RFM provides specific mathematical constructions for velocity fields that naturally respect boundaries. This works for both convex domains (like hypercubes and simplices) and complex non-convex domains (like a "cup" or "half-annulus"). * Reflected Sampling Algorithm: The proposed iterative reflection solver ensures that if a numerical step takes a sample outside the domain, the algorithm calculates the exact intersection point with the boundary and "bounces" the trajectory back into the valid space.

Key Insights and Results

The researchers evaluated RFM across several benchmarks, including low-dimensional toy tasks (Hypercube, Simplex, Half Annulus, Cup) and standard image benchmarks (CIFAR-10 and ImageNet 64x64).

  • The "Guidance" Paradox Resolved: In standard diffusion and flow models, increasing the "guidance weight" makes images look more like the target class but introduces massive boundary violations. RFM resolves this by allowing high guidance while strictly enforcing pixel constraints.
  • Zero Violations: Across all tests, RFM achieved a 0.0% constraint violation ratio. In stark contrast, vanilla Flow Matching on ImageNet exhibited violation rates as high as 64.5% when using high guidance weights.
Comparison of Ground Truth, standard Flow Matching (FM), and Reflected Flow Matching (RFM) across various domains. Red points indicate boundary violations.
  • Superior Image Quality: On ImageNet (64x64) with a high guidance weight of $w=15$, RFM achieved an FID score of 26.67, significantly outperforming vanilla FM (31.83) and Reflected Diffusion Models (66.74).
  • Sampling Efficiency: RFM produces high-quality samples with significantly fewer Number of Function Evaluations (NFE) than previous reflected models. On CIFAR-10, it achieved competitive results with only 139 steps, whereas some diffusion baselines required up to 2,000.

Limitations and Future Work

While highly effective, RFM does have limitations. To implement the reflection logic, one must have an analytical form for the domain's boundary ($\partial \Omega$). While this is trivial for hypercubes (like images), it becomes difficult for data living on complex, unknown manifolds. Additionally, the current reflected velocity fields are not necessarily "optimal transport" (the absolute shortest path), suggesting room for even more efficient sampling paths in the future.

Looking forward, the authors suggest extending RFM to other constrained data types, such as videos, 3D point clouds, and human motion trajectories, where strict physical constraints are critical for realistic generation.

Summary updated

BibTeX
@inproceedings{xie2024reflected,
  author = {Tianyu Xie and Yu Zhu and Longlin Yu and Tong Yang and Ziheng Cheng and Shiyue Zhang and Xiangyu Zhang and Cheng Zhang},
  title = {{Reflected Flow Matching}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=Sf5KYznS2G},
}
Figure