Flow Matching

Flow matching trains a model to predict a velocity field that transports samples from a simple distribution to a data distribution. It is closely related to diffusion and continuous normalizing flow perspectives.

The training objective is usually written as:

Here is the learned velocity field and is the target velocity along a chosen probability path.

A path is usually defined by conditional distributions:

where is sampled from a base distribution and from the data distribution. The model then defines an ODE sampler:

The final sample is obtained by integrating from to .

For a simple linear path:

but other paths can be chosen to fit geometry, noise schedules, or conditional constraints.

If the model learns the exact conditional velocity field, sampling follows:

where and the integrated endpoint should follow the data distribution.

Objective Decomposition

For paper notes, record the path, sampling distribution, and target velocity:

The notation hides important choices:

SymbolMeaningCheck
base distributionnoise, prior, scaffold, initial coordinates
target data distributiontrain data, standardized objects, coordinate frame
time samplinguniform, biased, schedule-weighted
probability pathlinear, OT-like, diffusion-like, domain-specific
target velocityanalytic, simulated, estimated, conditional
conditionclass, text, property, pocket, protein, partial structure

Conditional Flow Matching

A common training view samples paired endpoints and trains on a conditional vector field:

then:

The model sees , not necessarily the endpoints. The learned field approximates the marginal velocity after averaging over possible endpoint pairs.

Path Choice

The path is not a detail. It defines the target vector field and the difficulty of integration.

PathBenefitRisk
linear interpolationsimple analytic velocityinvalid intermediate objects
diffusion-like pathconnects to score/diffusion toolingschedule and parameterization matter
OT-inspired pathstraighter transport and fewer stepspairing or approximation assumptions
geometry-aware pathrespects coordinates or constraintsharder target construction
conditional pathuses class, pocket, scaffold, or promptcondition leakage or overfitting

Geometry Boundary

For coordinates, the velocity field must transform consistently:

when rotations and translations should not change the physical meaning. If the model predicts scalar properties instead, the target is usually invariant rather than equivariant.

For molecular or protein coordinates, also state whether translation, rotation, permutation, chirality, bond constraints, and atom/residue identity are preserved along the path.

Design Choices

  • Probability path: linear, diffusion-like, optimal-transport inspired, or domain-specific.
  • Vector field architecture: MLP, Transformer, GNN, or equivariant network.
  • Conditioning: class, text, property, structure, pocket, or other context.
  • Solver budget: number of function evaluations, step size, and error tolerance.
  • Target parameterization: velocity, score, displacement, coordinate update, or domain-specific field.
  • Symmetry rule: invariant, equivariant, permutation-aware, or frame-dependent.

Why It Matters

  • Provides a generative modeling framework for continuous objects.
  • Can be adapted to molecular coordinates and protein geometry.
  • Gives a way to model trajectories instead of only final structures.

Failure Modes

  • A path that ignores constraints can generate invalid intermediate states.
  • A non-equivariant velocity field can leak coordinate-frame assumptions.
  • Solver cost can erase the benefit of a cleaner objective.
  • Conditional generation can overfit the condition and reduce diversity.
  • Endpoint pairing can leak labels, templates, or target structures if not defined carefully.

Checks

  • What path is used between noise and data?
  • Which symmetries should the velocity field preserve?
  • How does it interact with equivariant GNN architectures?
  • Is the velocity target defined in a valid coordinate frame?
  • Is sample quality reported together with solver budget?
  • Are path choice, time sampling, and target velocity matched across baselines?
  • Does the evaluation separate sample validity, condition satisfaction, diversity, and downstream utility?
  • Are endpoint pairing, conditioning context, and target velocity public and reproducible?
  • Does the path keep intermediate states inside a meaningful representation space?