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

TO-FLOW: Efficient Continuous Normalizing Flows with Temporal Optimization adjoint with Moving Speed

Shian Du, Yihong Luo, Wei Chen, Jian Xu, Delu ZengCVPR 2022

Abstract

Continuous normalizing flows (CNFs) construct invertible mappings between an arbitrary complex distribution and an isotropic Gaussian distribution using Neural Ordinary Differential Equations (neural ODEs). It has not been tractable on large datasets due to the incremental complexity of the neural ODE training. Optimal Transport theory has been applied to regularize the dynamics of the ODE to speed up training in recent works. In this paper, a temporal optimization is proposed by optimizing the evolutionary time for forward propagation of the neural ODE training. In this approach, we optimize the network weights of the CNF alternately with evolutionary time by coordinate descent. Further with temporal regularization, stability of the evolution is ensured. This approach can be used in conjunction with the original regularization approach. We have experimentally demonstrated that the proposed approach can significantly accelerate training without sacrificing performance over baseline models.

Introduction

Generative modeling often relies on Normalizing Flows, which transform a simple probability distribution (like a Gaussian) into a complex one through a series of invertible mappings. Continuous Normalizing Flows (CNFs) take this a step further by using Neural Ordinary Differential Equations (Neural ODEs) to define these transformations as a continuous "flow" over time.

However, CNFs are computationally expensive. Training them requires solving an ODE at every step, and as the model learns, the "path" the data takes often becomes increasingly complex. This leads to a high Number of Function Evaluations (NFE), making training on large datasets slow. While previous research tried to "straighten" the path using Optimal Transport theory, the total time duration of the flow ($T$) was almost always treated as a fixed constant. TO-FLOW addresses this by treating the integration time as a learnable parameter.

Methodology

TO-FLOW introduces a "temporal optimization" strategy that integrates directly into the training loop via the following components:

  1. Coordinate Descent on Time: Instead of just training the neural network weights ($\theta$), the authors optimize the stopping time ($T$) of the ODE. They use a coordinate descent approach: first updating network weights while holding time fixed, then updating the stopping time while holding weights fixed.
  2. Temporal Regularization (TR): To prevent the stopping time from fluctuating wildly or growing too large, they add a penalty term ($\alpha \cdot |T|$) to the loss function. This acts as a "speed limit," encouraging the model to find the most efficient duration for the transformation.
  3. Clipping Function: To ensure numerical stability, they implement a clipping mechanism that keeps the learned time $T$ within a safe, predefined interval.
  4. Adjoint Method Compatibility: The approach remains compatible with the adjoint sensitivity method, allowing for memory-efficient backpropagation.

Experimental Setup

The authors evaluated TO-FLOW on two categories of data:

  • Toy 2D Benchmarks: Eight standard synthetic distributions (e.g., checkerboard, swissroll, 2spirals, circles) used to visualize how well the model captures multi-modal and discontinuous shapes.
  • Image Datasets: Three classic computer vision benchmarks: MNIST (handwritten digits), Fashion-MNIST (clothing items), and CIFAR-10 (natural images).
Qualitative comparison of TO-FLOW against FFJORD on eight toy 2D datasets.

Key Results

Experimental results show that TO-FLOW consistently outperforms the standard baseline (FFJORD) in terms of efficiency:

  • Speedup: TO-FLOW reduced total training time by 41.7% on MNIST, 27.7% on Fashion-MNIST, and 23.7% on CIFAR-10.
  • Computational Efficiency: On MNIST, the average NFE dropped from 750.67 (FFJORD) to just 396.81 (TO-FLOW)—nearly a 50% reduction in the work required by the ODE solver.
  • Performance Parity: Despite the speedup, the model maintained comparable Bits per Dimension (BPD) scores. For example, on CIFAR-10, TO-FLOW achieved a BPD of 3.429 compared to FFJORD's 3.414.
Evolution of the learned density for the checkerboard dataset over training iterations, showing faster convergence for TO-FLOW.

Conclusion

TO-FLOW demonstrates that the integration interval $[t_0, T]$ is an untapped lever for efficiency. By letting $T$ evolve alongside the network weights, the model finds a duration that minimizes the complexity of the ODE solver's task. Future work may involve combining this temporal optimization with the spatial path constraints of Optimal Transport to create even faster and more robust continuous normalizing flows.

Summary updated

BibTeX
@inproceedings{du2022flow,
  author = {Shian Du and Yihong Luo and Wei Chen and Jian Xu and Delu Zeng},
  title = {{TO-FLOW: Efficient Continuous Normalizing Flows with Temporal Optimization adjoint with Moving Speed}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
  url = {https://openreview.net/forum?id=3MvfMALpEpj},
}
Figure