Towards Hierarchical Rectified Flow

Yichi Zhang, Yici Yan, Alexander G. Schwing, Zhizhen Zhao · DOI

Introduction

Generative modeling has undergone a significant evolution from stochastic diffusion processes to deterministic flow-matching frameworks. These models function by transforming a simple source distribution, such as Gaussian noise, into a complex data distribution by following a learned velocity field. However, a persistent bottleneck in these methods is the curvature of the integration paths. Highly curved trajectories require many small steps—high Neural Function Evaluations (NFEs)—to navigate accurately during sampling, leading to computational inefficiency.

This paper introduces Hierarchical Rectified Flow (HRF), a framework designed to "untangle" these paths. By hierarchically coupling multiple ordinary differential equations (ODEs), HRF models the entire distribution of velocities and accelerations, allowing trajectories to intersect and resulting in significantly straighter paths from noise to data.

The Problem: The Mean Velocity Trap

In classic Rectified Flow, models are trained using a Mean Squared Error (MSE) objective to predict the velocity at any given point in space and time. A fundamental limitation arises when multiple "ground-truth" velocities lead to different data points from the same location. Because MSE regresses to the mean, the model learns an average velocity field.

To maintain a deterministic flow without intersections, these paths are forced to "curve" around one another. This curvature is the primary driver of sampling error; to minimize this error, practitioners must use many NFEs, which slows down the generation process.

Methods: Hierarchical Coupling

HRF proposes a hierarchy of ODEs to capture the latent complexity of motion. Rather than simply learning the mean velocity, HRF models the velocity distribution itself through deeper levels of the hierarchy:

  • Depth 1 ($D=1$): Equivalent to classic Rectified Flow, modeling the mean velocity.
  • Depth 2 ($D=2$): Models the acceleration. Sampling involves a nested process: the model first integrates in velocity space to sample a specific velocity from the distribution, then uses that velocity to take a step in location space.
  • Higher Depths ($D \geq 3$): Can theoretically model jerk, snap, and higher-order derivatives.

Unlike Diffusion models that rely on Stochastic Differential Equations (SDEs) driven by Brownian motion, HRF utilizes Random Differential Equations (RDE). In this setup, the randomness is confined to the initial conditions of the coupled ODEs. Once the initial velocity or acceleration is sampled, the path remains deterministic, preserving the benefits of flow-based modeling while allowing for the complexity of intersecting trajectories.

Key Insights

Intersection as a Feature

In standard flows, path crossing is prohibited. HRF treats intersection as a feature that allows the model to "untangle" the flow. By accounting for different velocities at the same spatial coordinate, HRF creates trajectories that are nearly straight lines. The authors prove (Theorem 1) that the velocity distribution at the start of the process ($t=0$) is as complex as the target data distribution, justifying the need for a powerful hierarchical model to capture it.

Efficiency and Density Estimation

Because the resulting paths are straighter, the numerical error associated with large integration steps is drastically reduced. This allows HRF to achieve high-quality results in as few as 2–5 steps. Furthermore, the hierarchical structure enables a new method for estimating data likelihood (bits per dimension), consistently outperforming standard rectified flows in density estimation tasks.

Experimental Results

The authors validated HRF across synthetic benchmarks and standard image datasets:

  • Synthetic Data: Visualizations on 1D/2D Gaussian mixtures and the "moons" dataset confirmed that HRF2 and HRF3 produce "pencil-straight" paths compared to the curved trajectories of standard Rectified Flow.
  • Image Generation: On MNIST and CIFAR-10, HRF2 achieved significantly lower (better) FID scores than the baseline for the same number of NFEs. For instance, on MNIST, HRF2 reached an FID of approximately 2.5 with very few steps, while the baseline remained significantly higher.
  • Model Compactness: In low-dimensional tests, the HRF2 model required only about 1/4th the parameters of the baseline while maintaining superior performance, suggesting that the hierarchical inductive bias is highly parameter-efficient.

Limitations and Future Work

While HRF shows great promise, several areas remain for optimization:

  1. Sampling Complexity: Current sampling relies on simple Euler integration for nested ODEs. Advanced solvers like RK45 could potentially improve results further.
  2. Integration Schedules: The optimal number of steps to take at each level of the hierarchy is currently determined via grid search; a learned or automated schedule remains an open challenge.
  3. High-Resolution Scaling: While effective at $32 \times 32$ resolution, the computational overhead of deeper hierarchies on high-resolution images (e.g., $1024 \times 1024$) requires further investigation to ensure that NFE savings outweigh the per-step cost.

Summary updated

BibTeX
@inproceedings{zhang2025towards,
  author = {Yichi Zhang and Yici Yan and Alexander G. Schwing and Zhizhen Zhao},
  title = {{Towards Hierarchical Rectified Flow}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=6F6qwdycgJ},
}
Figure