introduction to flow models

https://www.pi.website/blog/pi07 https://diffusion.csail.mit.edu/2026/index.html

Time dependent vector fields

  • A time dependent vector field maps a point β€˜x’ in space and time β€˜t’ to a velocity vector
  • mathematically we define such field as u(x,t) or just as ut(x)
  • ex- wind direction (the velocity of wind at every point in space and time would be different)
  • interestingly the velocity field is responsible to change the trajectories of points as:

  • the central question which we want to address is:
    • if a point starts at x0 at t=0 and follows the vector field, where does the particle reach at a later time?
    • to answer this question we need to solve the above differential equation
    • the idea is to use the velocity vector to advance the point in small time increments

defining flow

  • collection of trajectories which evolve according to the vector field

so in sequence we have Velocity Field β†’ Trajectories β†’ Flow

Let’s take an example:

  • suppose we have a velocity vector field given by :- ut(x) = -𝛉x
  • then the flow field is given as follows (how can we check if this is valid?)

differential equation:

if the flow field is replaced in the differential equation and it satisfies the equation it is a valid flow field:

Once we have an ODE, how do we simulate it an find the trajectories?

  • We use Euler method in inference to simulate the trajectories and find the final state!
  • We simply take small steps in the direction of vector field

Flow models:

  • goal is to convert a simple dist pinit to a complex dist pdata
  • simulation of an ODE is a natural choice for this transformation
  • a flow model is described by the following ODE:
  • our goal is to make the endpoint x1 of the trajectory have dist pdata
  • the neural network that predicts this ODE is aka neural ode

key things to note:

  • an ODE specifies that the rate of change of position is given by a vector field dXt/dt = ut(Xt)
  • the solution to an ODE for all starting location x0 at once is called the flow ψt(x0) which maps where the initial point ends up at time t
  • because the vector field is parameterized by a complex deep nn, there is no pencil and paper solution for the solution, therefore solving an ode in practice means simulating it step by step using numerical solvers like euler method or heun’s method by taking small updates into the direction predicted by the nn
  • necessary at inference but avoided in training - solving the ode is mandatory to preoduce samples at inference however during training, modern flow matching is sim free meaning we can train the nn vector field without ever having to solve or sim the ode!
  • the neural network takes a continuous location or state x and a time scalar t and outputs a single velocity vector telling a particle situated at x and time t exactly what direction and speed it should move at that specific moment. During training (in flow matching) the neural network learns to match a target marginal vector field uttarget
  • the flow is obtained via sim of the ode step-by-step via ode using a solver like euler method, querying the neural network vector field at every step:

Xt+h = Xt + h.utΞΈ(Xt)

202609251146