No history yet

Continuous Flow Foundations

From Steps to Streams

In many generative models, we transform a simple noise distribution into a complex data distribution through a series of distinct steps. Think of it like a chain of functions, where each one slightly modifies the output of the previous one. This is the core idea behind discrete normalizing flows. While powerful, this approach can feel rigid; you're stacking discrete layers, and the complexity of the transformation depends on the number of layers you can afford to compute.

What if we could make this process smooth and continuous? Instead of taking discrete jumps, we could model the transformation as a seamless flow, like a particle drifting through a current. This is the leap from discrete models to Continuous Normalizing Flows (CNFs). In this framework, we describe the entire generative process with a single Ordinary Differential Equation (ODE).

dx(t)dt=v(t,x(t))\frac{d\mathbf{x}(t)}{dt} = \mathbf{v}(t, \mathbf{x}(t))

This ODE defines a path for every single point. We start with a point x(0)\mathbf{x}(0) sampled from a simple distribution, like a standard Gaussian. By integrating this equation from t=0t=0 to t=1t=1, we find its final position, x(1)\mathbf{x}(1), which should be a plausible data point from our target distribution. The entire transformation is governed by the vector field, v\mathbf{v}.

Vector Fields as Guideposts

The vector field v(t,x(t))\mathbf{v}(t, \mathbf{x}(t)) is the heart of the continuous flow. You can visualize it as a massive set of signposts distributed throughout space and time. Each signpost is an arrow that points in a specific direction and has a specific length, indicating the instantaneous velocity (direction and speed) a particle should have if it finds itself at that exact spot at that exact time.

The flow map, often written as Φt\Phi_t, is what you get by following the vector field's instructions. If you give it a starting point x(0)\mathbf{x}(0), the flow map Φt(x(0))\Phi_t(\mathbf{x}(0)) tells you the exact position of that point at any later time tt. The generative process is simply evaluating this map at t=1t=1: x(1)=Φ1(x(0))\mathbf{x}(1) = \Phi_1(\mathbf{x}(0)). The challenge, then, isn't solving the ODE—it's learning the correct vector field v\mathbf{v} that transforms noise into data.

Probability in Motion

We've seen how individual points move, but how does this affect the overall probability distribution? As the cloud of points flows from the initial noise distribution p0p_0 to the final data distribution p1p_1, its density changes. Regions can become more compressed (higher probability density) or more spread out (lower probability density). This evolution of density is not arbitrary; it's governed by a fundamental principle.

The change in probability density over time is directly linked to the divergence of the flow of probability. This relationship is captured by the Continuity Equation.

pt(x)t=(pt(x)v(t,x))\frac{\partial p_t(\mathbf{x})}{\partial t} = -\nabla \cdot (p_t(\mathbf{x}) \mathbf{v}(t, \mathbf{x}))

In simpler terms, if more probability is flowing out of a region than is flowing in (a positive divergence), the density in that region must decrease. The minus sign ensures this balance. This equation provides the theoretical link between the microscopic movement of points (governed by v\mathbf{v}) and the macroscopic evolution of the probability distribution ptp_t. It's the key that allows us to reason about the entire distribution, not just single trajectories.

This ODE-based perspective establishes a deterministic and reversible path between noise and data. Unlike discrete models, the transformation is continuous, and its properties are described by the learned vector field. The next challenge is figuring out an efficient way to learn this field without the computationally expensive process of traditional CNF training, which is precisely what Flow Matching aims to solve.