On the Trajectory Regularity of ODE-based Diffusion Sampling

Defang Chen, Zhenyu Zhou, Can Wang, Chunhua Shen, Siwei Lyu

Introduction

Diffusion models have emerged as a dominant force in generative AI, yet their computational cost remains a significant barrier. Generating high-quality images typically requires solving complex ordinary differential equations (ODEs) through numerous iterative steps, transforming pure noise into structured data. While advanced solvers like DPM-Solver and DDIM have improved efficiency, the selection of the "time schedule"—the specific timestamps at which the model is evaluated—has historically relied on simple heuristics like uniform or quadratic spacing.

This research investigates the underlying geometry of these high-dimensional sampling paths, revealing a surprising regularity that can be exploited to create mathematically optimal schedules.

The Geometry of Diffusion: The "Boomerang" Trajectory

By visualizing the sampling process using Principal Component Analysis (PCA), the researchers discovered that despite the massive dimensionality of image data, the trajectories are remarkably "flat." Regardless of the specific image being generated, the paths follow a consistent linear-nonlinear-linear structure, resembling a boomerang.

The "boomerang" shape of sampling trajectories visualized via PCA for ImageNet 64x64.

This "boomerang" shape implies that the trajectory starts linearly as it moves away from noise, becomes highly curved in the middle—where the model makes critical decisions about the image's specific content—and returns to a linear path during the final refinement of details. The authors theoretically link this behavior to an "annealed mean shift" process, where the denoising output acts like a gravity pendulum that shortens as noise levels decrease, governing the rotation of the sampling path.

Geometry-Inspired Time Scheduling (GITS)

To leverage this geometric regularity, the authors introduced Geometry-Inspired Time Scheduling (GITS). This method moves away from heuristic scheduling by using dynamic programming to find an optimal path through the sampling space. The process involves four key stages:

  1. Warmup: A small set of samples (e.g., 256) is generated to map the typical trajectory for a specific dataset.
  2. Error Mapping: The local truncation error—the mathematical "cost" of taking a discrete step—is calculated across a fine-grained grid of timestamps.
  3. Optimization: Dynamic programming is employed to find the "shortest path" through this grid, minimizing total error for a fixed budget of function evaluations (NFEs).
  4. Deployment: This optimized schedule is then used for all subsequent generations on that dataset.
Analysis of trajectory projection, visual reconstruction quality across dimensions, and PCA variance ratios.

Key Results and Performance

The GITS approach demonstrates that a schedule placing more steps where trajectory curvature is highest (the "turn" of the boomerang) significantly improves image quality, especially at very low NFEs.

On the CIFAR-10 benchmark with only 5 steps, standard DDIM yields a Frechet Inception Distance (FID) of 49.66, whereas DDIM enhanced with GITS drops the FID to 28.05. When combined with the iPNDM solver, GITS achieved a state-of-the-art FID of 8.38 at 5 steps.

Crucially, GITS is a "plug-and-play" wrapper. It requires no retraining of the underlying model and adds negligible computational overhead. The one-time "warmup" cost is minimal, ranging from one minute for CIFAR-10 to approximately 15 minutes for high-resolution Stable Diffusion models.

Conclusion

The discovery of the "boomerang" trajectory regularity provides a new geometric lens through which to view diffusion sampling. By replacing heuristic time schedules with geometry-inspired optimization, GITS enables high-quality image generation in as few as 5 to 10 steps. Future work may extend these geometric insights to other domains, such as audio or video diffusion, where similar regularities likely exist.

Summary updated

BibTeX
@inproceedings{chen2024trajectory,
  author = {Defang Chen and Zhenyu Zhou and Can Wang and Chunhua Shen and Siwei Lyu},
  title = {{On the Trajectory Regularity of ODE-based Diffusion Sampling}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=H86WzfH5N1},
}
Figure