KAIST CS492(C): Diffusion and Flow Models (Fall 2025)
Programming Assignment 3
Instructor: Minhyuk Sung (mhsung [at] kaist.ac.kr)
TA: Seungwoo Yoo (dreamy1534 [at] kaist.ac.kr)
Credit: Juil Koo (63days [at] kaist.ac.kr)
Flow Matching (FM) is a novel generative framework that shares similarities with diffusion models, particularly in how both tackle the Optimal Transport problem through an iterative process. Similar to diffusion models, FM also splits the sampling process into several time-dependent steps. At first glance, FM and diffusion models may seem almost identical due to their shared iterative sampling approach. However, the key differences lie in the objectve function and the choice of trajectories in FM.
Regading the objective function, diffusion models predict the injected noise during training. In contrast, Flow Matching predicts the displacement between the data distribution and the prior distribution.
Moreover, Flow Matching is developed from the perspective of flow, a time-dependent transformation function that corresponds to the forward pass in diffusion models. Unlike diffuison models, where the forward pass is fixed to ensure that every intermediate distribution also follows a Gaussian distribution, FM offers much greater flexibility in the choice of flow. This flexibility allows for the use of simpler trajectories, such as linear interpolation over time, between the data distribution and the prior distribution. Experimental results have sohwn that the FM objective and its simpler trajectory are highly effective in modeling the data distribution, Making FM a compelling alternative to diffusion models.
Furthermore, the concept of flows and their inducing vector fields gives rise to a technique known as rectification—a training-based approach for accelerating sampling in flow models. The key idea of rectification is to straighten the trajectories that transport the prior distribution to the target distribution, thereby reducing the number of inference steps required to generate new samples.
In this assignment, we will take a deep dive into the core components of the Flow Matching and Rectified Flow frameworks by implementing them step-by-step.
Clone this repository and upload the notebook file flow_matching.ipynb to Google Colab.
All instructions—including task descriptions and submission guidelines—are provided in the notebook file. Please follow them carefully to complete the tasks.
