Papers
Topics
Authors
Recent
Search
2000 character limit reached

Source-Guided Flow Matching (SGFM)

Updated 2 July 2026
  • SGFM is a framework for controlling generative models by intervening on the source distribution while keeping the pre-trained flow unchanged.
  • It decouples guidance by designing a guided source to match target energy-reweighted distributions, yielding theoretical exactness and flexibility.
  • SGFM enhances efficiency with reduced gradient variance and accelerated convergence, improving metrics like FID in diverse conditional and inverse tasks.

Source-Guided Flow Matching (SGFM) is a framework for controlling the behavior of generative models based on flow matching by intervening on the source distribution, enabling precise alignment with target constraints. Unlike traditional guidance methods that add time-varying perturbations to the vector field during generation, SGFM modifies the source (initial) measure while keeping the pre-trained flow (vector field) unchanged. This structure introduces significant algorithmic and theoretical advantages in image synthesis, conditional generation, inverse problems, decision-making, and beyond (Wang et al., 20 Aug 2025).

1. Conceptual Foundations and Motivation

In flow matching, a probability flow model parameterized by a vector field v(t,x)v(t, x) is trained to transport samples from a tractable source distribution μ0\mu_0 (commonly Gaussian) to a target data distribution μ1\mu_1, using an ODE:

dxt=v(t,xt)dt,x0μ0,x1=ϕ1(x0).dx_t = v(t, x_t)\, dt,\quad x_0 \sim \mu_0,\quad x_1 = \phi_1(x_0).

SGFM arises from the observation that classic guidance strategies—typified by classifier guidance or score conditioning—intervene by modifying v(t,x)v(t, x) directly, resulting in curvature in sample paths, approximation variance, and increased computation (due to Monte Carlo gradient estimation along the entire path) (Feng et al., 4 Feb 2025, Zheng et al., 2023). In contrast, SGFM ensures guidance by designing or sampling from a guided source such that, under the (possibly pre-trained) flow ϕ1\phi_1, the output distribution matches a desired energy-reweighted target:

μ1(x)μ1(x)eJ(x).\mu_1'(x) \propto \mu_1(x) e^{-J(x)}.

This decouples the source/target constraint matching from the dynamics, yielding both theoretical exactness and algorithmic flexibility (Wang et al., 20 Aug 2025, Lee et al., 20 Dec 2025).

2. Mathematical Framework

The central theoretical result formalizes the construction of a guided source μ0\mu_0':

μ0(x)μ0(x)exp[J(ϕ1(x))],\mu_0'(x) \propto \mu_0(x) \exp[-J(\phi_1(x))],

so that, for any x0μ0x_0' \sim \mu_0', integration through the unchanged vector field μ0\mu_00 ensures μ0\mu_01 (Wang et al., 20 Aug 2025). This is provably exact under the assumption that μ0\mu_02 pushes forward μ0\mu_03 to μ0\mu_04, i.e., μ0\mu_05. No modification to the learned vector field is required. For an approximate field μ0\mu_06 or approximate source sampler μ0\mu_07, the Wasserstein-2 distance between the achieved output and desired guided target admits explicit bounds:

μ0\mu_08

where μ0\mu_09 is the Lipschitz constant of the field and μ1\mu_10 bounds the maximum deviation of μ1\mu_11 from μ1\mu_12 (Wang et al., 20 Aug 2025).

Given the guided source μ1\mu_13, various sampling strategies are possible:

  • Importance Sampling (IS): Draw samples from μ1\mu_14, weight by μ1\mu_15.
  • MCMC (HMC, MALA): Simulate a Markov chain targeting μ1\mu_16, leveraging gradients of the composed energy.
  • Optimization-based (mode-seeking): Solve μ1\mu_17 (Wang et al., 20 Aug 2025).

For the conditional setting, as in text-to-image generation, the source can be parameterized conditionally as:

μ1\mu_18

with μ1\mu_19 a conditioning signal, e.g., text (Kim et al., 5 Feb 2026).

3. Empirical Methodology and Loss Formulations

SGFM introduces several techniques for learning or shaping the source distribution, with both learned and post hoc approaches:

  • Learned Condition-Dependent Source: dxt=v(t,xt)dt,x0μ0,x1=ϕ1(x0).dx_t = v(t, x_t)\, dt,\quad x_0 \sim \mu_0,\quad x_1 = \phi_1(x_0).0 maps condition dxt=v(t,xt)dt,x0μ0,x1=ϕ1(x0).dx_t = v(t, x_t)\, dt,\quad x_0 \sim \mu_0,\quad x_1 = \phi_1(x_0).1 to the mean and variance of a source Gaussian. Training simultaneously learns the flow field dxt=v(t,xt)dt,x0μ0,x1=ϕ1(x0).dx_t = v(t, x_t)\, dt,\quad x_0 \sim \mu_0,\quad x_1 = \phi_1(x_0).2 and dxt=v(t,xt)dt,x0μ0,x1=ϕ1(x0).dx_t = v(t, x_t)\, dt,\quad x_0 \sim \mu_0,\quad x_1 = \phi_1(x_0).3, with objective:

dxt=v(t,xt)dt,x0μ0,x1=ϕ1(x0).dx_t = v(t, x_t)\, dt,\quad x_0 \sim \mu_0,\quad x_1 = \phi_1(x_0).4

(Kim et al., 5 Feb 2026)

VarReg penalizes collapse of variance, and the alignment term enforces directional proximity in latent space.

  • Post-Hoc Source Shaping: For existing Gaussian-trained models, SGFM proposes:
    • Norm Alignment: At training, scale target data so the average source and target norm coincide, minimizing the model’s need to learn large radial transformations (Lee et al., 20 Dec 2025).
    • Directionally-Pruned Sampling: At inference, reject source samples whose directions are unsupported by the data manifold, using PCA of the normalized data to detect sparse directions. This improves sample efficiency without retraining (Lee et al., 20 Dec 2025).
  • Guidance in Conditional Flow Matching: In Classifier-Free Guidance analogues for flow matching, a blending parameter dxt=v(t,xt)dt,x0μ0,x1=ϕ1(x0).dx_t = v(t, x_t)\, dt,\quad x_0 \sim \mu_0,\quad x_1 = \phi_1(x_0).5 combines unconditional and conditional vector fields at inference to steer toward the data manifold, paralleling the diffusion literature but adapting for velocity fields (Zheng et al., 2023).

4. Theoretical and Geometric Analyses

Four key insights govern the efficacy and limitations of source intervention in high-dimensional flow matching (Lee et al., 20 Dec 2025):

  • Density Approximation Pitfalls: Attempting density estimation to align the source with the data can create mode gaps, complicating vector field learning rather than simplifying it.
  • Directional Alignment Entanglement: Excessively concentric directional distributions (e.g., high-concentration von Mises-Fisher) increase Lipschitzness and path entanglement, degrading learning.
  • Omnidirectional Supervision: Full Gaussian coverage provides comprehensive directional supervision, crucial for robust learning.
  • Norm Misalignment: Large initial radial discrepancies between source and data incur significant learning costs for contraction or expansion.

These considerations justify the preference for minimal, precisely targeted interventions—such as those afforded by SGFM.

5. Empirical Results and Practical Impact

SGFM demonstrates robust empirical improvements across modalities and domains:

Task Metric Baseline SGFM Variant Results Reference
ImageNet-1K text-to-image (RAE space) FID FM (Gaussian source) CSFM (learned source) 3.01× FID drop speedup (Kim et al., 5 Feb 2026)
CIFAR-10 (NFE=40) FID OT-CFM (Gauss) +Pruned sampling 5.61 → 4.92 (Lee et al., 20 Dec 2025)
MNIST conditional generation FID g{cov-A} (VF-guided) SGFM-ULA 57.1 → 46.7 (Wang et al., 20 Aug 2025)
Physics inverse (Darcy flow) Guidance cost/consistency g{cov-A} SGFM-OPT χ²/SFGM-HMC Best cost, improved consistency (Wang et al., 20 Aug 2025)
D4RL Offline RL Return Gradient-based guidance MC-SGFM Outperforms on 9/9 tasks (Feng et al., 4 Feb 2025)

Notably, SGFM reduces gradient variance during flow training, accelerates convergence, improves FID and few-step sample quality, and achieves efficiency in wall-clock and function evaluations, all while maintaining theoretical guarantees for exactness under idealized settings (Kim et al., 5 Feb 2026, Feng et al., 4 Feb 2025).

6. Algorithmic Implementation and Guidelines

  1. For each minibatch sample condition dxt=v(t,xt)dt,x0μ0,x1=ϕ1(x0).dx_t = v(t, x_t)\, dt,\quad x_0 \sim \mu_0,\quad x_1 = \phi_1(x_0).6 (e.g., text embedding).
  2. Sample dxt=v(t,xt)dt,x0μ0,x1=ϕ1(x0).dx_t = v(t, x_t)\, dt,\quad x_0 \sim \mu_0,\quad x_1 = \phi_1(x_0).7, dxt=v(t,xt)dt,x0μ0,x1=ϕ1(x0).dx_t = v(t, x_t)\, dt,\quad x_0 \sim \mu_0,\quad x_1 = \phi_1(x_0).8.
  3. Sample dxt=v(t,xt)dt,x0μ0,x1=ϕ1(x0).dx_t = v(t, x_t)\, dt,\quad x_0 \sim \mu_0,\quad x_1 = \phi_1(x_0).9; form v(t,x)v(t, x)0.
  4. Compute loss terms: flow-matching, variance-regularization, alignment.
  5. Update parameters with AdamW; monitor stability via variance/early stops.

Post-hoc Pruned Sampling (Lee et al., 20 Dec 2025)

  1. Normalize all data samples and fit PCA.
  2. Identify unsupported directions via thresholding.
  3. At inference, accept only those Gaussian draws whose normalized direction is not within the pruned set; otherwise, resample.
  4. Optionally, apply Norm Alignment by scaling output accordingly.

SGFM does not require architectural or training pipeline changes for pruned sampling, and norm alignment requires only scaling operations and statistics computed over the dataset.

7. Limitations, Open Problems, and Practical Recommendations

  • SGFM’s exact guarantees hinge on accurate vector field training and correct source sampling; in high dimensions, importance sampling may exhibit degeneracy, while MCMC mixing time becomes a practical bottleneck (Wang et al., 20 Aug 2025).
  • Variance reduction can be limited in entangled latent spaces; learned sources work best in structured, concentrated manifolds (e.g., RAE+DINOv2) (Kim et al., 5 Feb 2026).
  • Path curvature is avoided in SGFM but may be required if only vector-field-based constraints are supported or the source intervention is not feasible (Feng et al., 4 Feb 2025).
  • Hyperparameter tuning for pruned sampling is minimal (typically v(t,x)v(t, x)1), and the cost overhead is negligible in typical settings (Lee et al., 20 Dec 2025).

Practical guidelines:

  • For existing Gaussian-source models, SGFM pruned sampling offers a direct, retrain-free quality and efficiency improvement.
  • When training new models, norm alignment can reduce training difficulty, subject to consideration of path geometry at low NFE.
  • For structured conditional generation, learnable conditional sources yield the largest acceleration and quality gains in concentrated representation spaces.

Taken together, SGFM enables a powerful, modular toolset for aligning generative flows to complex constraints, with theoretical and empirical guarantees spanning diverse applications (Kim et al., 5 Feb 2026, Wang et al., 20 Aug 2025, Lee et al., 20 Dec 2025).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Source-Guided Flow Matching (SGFM).