---
title: 'Marginal Flow: Optimal Transport & Density Estimation'
url: https://www.emergentmind.com/topics/marginal-flow
type: topic
---

# Marginal Flow: Optimal Transport & Density Estimation

“Marginal Flow” is not a single standardized object but a family of constructions in which the central mathematical role is played by marginal distributions: preserving them, matching them at multiple times, transporting between them, or parameterizing densities through marginalization. In optimal transport, the term denotes a cost-specific, marginal-preserving neural-ODE update that moves inside the feasible set of couplings [2209.14577]. In density estimation, it denotes a model of the form
\[
q_\theta(x)=\int q(x\mid w)\,q_\theta(w)\,dw,
\]
where latent parameters are marginalized rather than optimized as fixed mixture components [2509.26221]. Related usages appear in multi-marginal Schrödinger bridges, continuum-marginal optimal transport, bridge-aware samplers, and several field-theoretic settings involving marginal or marginally irrelevant operators [1902.08319] [2604.24226] [2102.01829]. This suggests that the term is best understood through recurring structural motifs rather than a single canonical definition.

## 1. Marginals as constraints, invariants, and dynamical observables

A recurring formal idea is that a flow acts on couplings or path measures while the observable constraints are marginal laws. In the optimal-transport usage of “Marginal Flow,” one starts from a differentiable stochastic process \(\{X_t\}_{t\in[0,1]}\) with velocity field
\[
v_t^{\mathbf X}(z)=\mathbb{E}[\dot X_t \mid X_t=z],
\]
whose marginals \(\rho_t=\law(X_t)\) satisfy
\[
\partial_t \rho_t + \nabla\!\cdot\!\big(v_t^{\mathbf X}\rho_t\big)=0.
\]
A vector field \(r_t\) is \(\mathbf X\)-marginal-preserving if
\[
\int_0^t \mathbb{E}\big[\nabla h(X_s)\cdot r_s(X_s)\big]\,ds = 0 \quad \forall h\in \mathcal C_c,
\]
equivalently,
\[
\nabla\cdot\big(r_t\rho_t\big)=0.
\]
The key theorem states that two processes with the same initial law have identical marginals for all \(t\) iff the difference of their velocity fields is marginal-preserving [2209.14577].

In continuum-marginal optimal transport, marginals are not merely endpoint constraints but a full time-continuous input \(\mu=\{\mu_t\}_{0\le t\le T}\). The admissible velocity field \(u(t,x)\) must reproduce every marginal through the weak continuity equation
\[
\int_{\mathbb{R}^d}\varphi(t,x)\,p(t,x)\,dx - \int_{\mathbb{R}^d}\varphi(0,x)\,p(0,x)\,dx
=
\int_0^t\!\int_{\mathbb{R}^d}
\bigl(\partial_s\varphi + u(s,x)^{\mathsf T}\nabla_x\varphi\bigr)p(s,x)\,dx\,ds,
\]
and the optimization problem is
\[
V_0(\mu) := \inf_{u\in\mathcal{U}_0} \int_{[0,T]\times\mathbb{R}^d} |u(t,x)|^2\,p(t,x)\,dx\,dt.
\]
Here the marginal flow itself is the object being recovered [2604.24226].

A related continuum viewpoint appears in the Sinkhorn/IPFP limit. As \(\varepsilon\downarrow 0\) and \(k\approx t/\varepsilon\), the one-marginals produced by the discrete entropic OT iterations converge to an absolutely continuous curve \((\rho_t)_{t\ge 0}\) in \( \mathcal P_2(\mathbb R^d)\), called the Sinkhorn flow [2307.16421]. Across these formulations, “marginal flow” refers less to a particular architecture than to a dynamical law constrained or characterized by marginals.

## 2. Marginal-preserving optimal transport and interior updates

The most explicit algorithmic use of the name is the cost-specific extension of rectified flow in “Rectified Flow: A Marginal Preserving Approach to Optimal Transport” [2209.14577]. The problem is the Monge–Kantorovich program
\[
\min_{(X_0,X_1)} \mathbb{E}[c(X_1-X_0)]
\quad \text{s.t.} \quad
\law(X_0)=\pi_0,\;\law(X_1)=\pi_1,
\]
with \(c\) convex. The method starts from any valid coupling, often \(\pi_0\times\pi_1\), forms the linear interpolation
\[
X_t=(1-t)X_0+tX_1,
\]
and learns a new velocity restricted to the structured class
\[
g_t^{\mathbf X,c}(z)=\nabla c^*\!\big(\nabla f_t^{\mathbf X,c}(z)\big),
\]
where \(f^{\mathbf X,c}\) minimizes
\[
L_{\mathbf X,c}(f)
=
\int_0^1
\mathbb{E}\!\left[
c(\dot X_t)- \dot X_t\cdot \nabla f_t(X_t) + c^*(\nabla f_t(X_t))
\right] dt.
\]
The updated coupling is obtained from the neural ODE
\[
dZ_t = g_t^{\mathbf X,c}(Z_t)\,dt,\qquad Z_0=X_0.
\]

The defining feature is the “interior approach”: the iterate remains feasible by construction. The update changes the coupling while preserving all time marginals, rather than enforcing constraints through dual variables or penalties. The velocity admits a Bregman/Helmholtz-like decomposition
\[
v_t^{\mathbf X}
=
\nabla c^*(\nabla f_t^{\mathbf X,c}) + r_t^{\mathbf X,c},
\]
where the residual is exactly the marginal-preserving component removable without changing the marginals. The cost-improvement theorem states
\[
\mathbb{E}[c(X_1-X_0)]-\mathbb{E}[c(Z_1-Z_0)]
=
S_c(\mathbf Z)+L_{\mathbf X,c}(f^{\mathbf X,c}) \ge 0,
\]
and the fixed-point criterion is
\[
(X_0,X_1)=\crectify(X_0,X_1)
\quad \Longleftrightarrow \quad
\ell^*_{\mathbf X,c}=0
\quad \Longleftrightarrow \quad
(X_0,X_1)\ \text{is \(c\)-optimal}.
\]

For quadratic cost,
\[
c(x)=\frac12\|x\|^2,\qquad c^*(y)=\frac12\|y\|^2,\qquad \nabla c^*(y)=y,
\]
the construction reduces to standard rectified flow. A common misconception is that “marginal-preserving” means the process is unchanged. In fact, the entire purpose is to alter the coupling while keeping the prescribed marginals fixed [2209.14577].

## 3. Multi-marginal, bridge, and continuum-time formulations

Several works generalize marginal flow from two endpoint constraints to multi-time or all-time settings. In the multi-marginal Schrödinger bridge problem for inertial particles, the state evolves by
\[
dx = v\,dt, \qquad dv = dw,
\]
but only positional marginals
\[
\int \mu_{t_i}(x,v)\,dv = \rho_i(x), \qquad i=0,\dots,N,
\]
are observed. The solution is the path-space law \(\mathbb Q\) minimizing relative entropy with respect to the inertial Brownian prior, equivalently the optimal control problem
\[
\min \left\{\int_0^1 \|a(t)\|^2\,dt\right\}
\]
subject to
\[
dx = v\,dt,\qquad dv = a\,dt + dw,\qquad x(t_i)\sim \rho_i.
\]
In density form, the formulation becomes a Benamou–Brenier-like variational problem, and after the substitution \(\hat a = a - \frac12 \nabla_v \log \mu\), the cost acquires a Fisher information term in the velocity variable [1902.08319].

For high-dimensional snapshot data at irregular time points, Multi-Marginal Stochastic Flow Matching (MMSFM) models a stochastic flow
\[
dX(t) = u_t(X(t))\,dt + g(t)\,dW(t),
\]
with the decomposition
\[
u_t(x) = u_t^\circ(x) + \frac{g^2(t)}{2}\nabla \log p_t(x).
\]
The method constructs overlapping windows of consecutive marginals, uses transport splines to build Gaussian conditional paths
\[
p_t(x|z)=\mathcal N(x\mid \mu_t,\sigma_t^2),
\]
and trains flow and score networks jointly by a simulation-free objective. The paper emphasizes spline reparameterization over actual time intervals and stratified time sampling as the mechanisms that handle irregular snapshot timing [2508.04351].

ALI-CFM introduces adversarially learnt interpolants
\[
G_\phi(x_0,x_1,t)=(1-t)x_0 + tx_1 + t(1-t)f_\phi(x_0,x_1,t),
\]
and matches intermediate snapshot distributions through a GAN-style objective so that
\[
(G_\phi(\cdot,\cdot,t_i))_\#\pi = q_{t_i}
\]
at observed times. The learned interpolants are then marginalized by conditional flow matching to obtain a time-dependent vector field [2510.01159].

A further continuum limit is the Sinkhorn flow, which is both a limit of entropic OT iterations and an example of Wasserstein mirror gradient flow. Its continuity equation is
\[
\partial_t \rho_t + \operatorname{div}(\rho_t v_t)=0,
\]
with mirror-gradient velocity
\[
v_t(x)= -\left(\nabla^2 u_t(x)\right)^{-1}\nabla\bigl(\log \rho_t(x)+f(x)\bigr),
\]
and potential evolution governed by the parabolic Monge–Ampère equation
\[
\partial_t u_t(x)=f(x)-g(x^{u_t})+\log\det\!\left(\frac{\partial x^{u_t}}{\partial x}\right).
\]
The paper also proves exponential convergence under a logarithmic Sobolev inequality and a uniform lower bound on mirror curvature [2307.16421].

## 4. Density estimation, tail control, and parameter marginalization

In density modeling, “Marginal Flow” denotes a different construction: a conditional density with marginalized latent parameters. The framework defines
\[
q_\theta(x)=\int q(x\mid w)\, q_\theta(w)\, dw
=
\mathbb{E}_{w\sim q_\theta(w)}[q(x\mid w)],
\]
implemented in practice as
\[
q_\theta(x)\coloneqq \frac{1}{N_c}\sum_{i=1}^{N_c} q(x\mid w_{\theta,i}),
\qquad
w_{\theta,i}\sim q_\theta(w).
\]
The latent parameters are sampled by
\[
w_{\theta,i} \coloneqq f_\theta(z_i), \qquad z_i\sim p_{\text{base}}(z),
\]
so \(f_\theta\) need not be invertible and the method imposes no bijectivity constraint. The paper emphasizes exact density evaluation, efficient sampling, forward-KL or reverse-KL training, architectural freedom, and the ability to model lower-dimensional manifolds by choosing \(p_{\text{base}}\) in \(\mathbb R^m\) with \(m<d\) [2509.26221].

A related but older use of “marginal flow” appears in copula-and-marginal generative flows. There the joint law is decomposed as
\[
p(x_1,x_2)=c(F_{X_1}(x_1),F_{X_2}(x_2))\,p(x_1)\,p(x_2),
\]
with a copula flow \(h_\eta:[0,1]^2\to[0,1]^2\) and a marginal flow \(m_\theta\) applied componentwise:
\[
g_{\theta,\eta}(u)=m_\theta\circ h_\eta(u).
\]
The univariate marginal flow is a hybrid inverse-CDF construction,
\[
m(u,\theta)=
\begin{cases}
A_{X_1}^{-1}(u), & u\in[0,a]\cup[b,1],\\
\tilde f(u,\theta), & u\in(a,b),
\end{cases}
\]
so exact tail behavior is encoded directly where prior knowledge exists, while the interior is learned [1907.03361].

Tail control is also the theme of Marginal Tail-Adaptive Normalizing Flows. The core theorem states that, under the stated conditions and the copula assumption, if the first \(d_l\) marginals are light-tailed and the remaining marginals are heavy-tailed, the transformed variable has the same marginal tail behavior as the base. The architecture therefore uses a factorized base distribution with Gaussian marginals for light-tailed coordinates and Student-\(t\) marginals for heavy-tailed coordinates, together with tail-preserving permutations and block-triangular linear layers
\[
W=
\begin{pmatrix}
A & 0\\
B & C
\end{pmatrix}.
\]
The method is designed to preserve mixed-tailed structure rather than merely global heaviness [2206.10311].

## 5. Marginal-conditioned sampling and few-step distillation

A further line of work uses marginal information at inference time rather than training-time density construction. In bridge-aware discretization, the relevant quantity is the difference between conditional bridge geometry and marginal population flow. The conditional–marginal entropy-rate scheduler is based on
\[
r_{cm}(t) =
\left|
\mathbb{E}_{Z,X_t\mid Z}\!\left[\operatorname{div}_x v_t(X_t\mid Z)\right]
-
\mathbb{E}_{X_t}\!\left[\operatorname{div}_x \bar v_t(X_t)\right]
\right|,
\]
followed by CDF inversion
\[
Q(t)=\frac{\int_0^t r(s)\,ds}{\int_0^1 r(s)\,ds},
\qquad
t_k = Q^{-1}\!\left(\frac{k}{N}\right).
\]
For Gaussian Brownian bridges this rate is closed-form and U-shaped, motivating boundary-heavy nonuniform grids. The reported low-budget gains include an 18.1% 10-step ODE-Heun MMD improvement over linear and a paired 22.7% SDE-Heun improvement; on CIFAR-10, the entropic schedule gives the best tested five-step FID, \(186.3 \pm 4.0\), versus \(200.5 \pm 2.9\) for linear and \(238.0 \pm 5.3\) for cosine [2605.16126].

In Flow Language Models, the denoiser block \(m_{t,\ell}(x)\) is exactly a posterior marginal probability over clean tokens:
\[
(m_t(x))_{\ell,v} = \mathbb P(W_\ell=v\mid X_t=x).
\]
The marginal-conditioned bridge sampler replaces a simplex-valued conditional mean endpoint by a sampled one-hot endpoint from the factorized posterior
\[
q_t^I(x_0\mid x) := \prod_{\ell=1}^L q_{t,\ell}(x_{0,\ell}\mid x),
\]
and then uses the exact Ornstein–Uhlenbeck bridge kernel. Under exact posterior marginals, the endpoint approximation error is exactly the conditional multi-information among token positions, and the induced one-step bridge kernel preserves all token-wise posterior-predictive marginals while losing only the residual cross-position dependence [2605.13681].

In few-step 3D generation, MDT-dist defines “Marginal-Data Transport” as transport from a noisy marginal \(q_t(x_t)\) back to data. The primary objective is
\[
\mathcal{L}_{\text{primary}}(\theta)
=
\mathbb{E}_{t,x_0,z}\left[
D\!\left(
t\,\phi_\theta(x_t,t),
\int_0^t v_{\text{pretrain}}(x_\tau,\tau)\,d\tau
\right)
\right],
\]
which is converted into Velocity Matching and Velocity Distillation. On TRELLIS, the method reduces the sampling steps of each flow transformer from 25 to 1 or 2, achieving \(0.68\)s (1 step \(\times\) 2) and \(0.94\)s (2 steps \(\times\) 2) latency with \(9.0\times\) and \(6.5\times\) speedup on A800 [2509.04406].

## 6. Marginal flow in field theory and critical phenomena

In high-energy theory and critical phenomena, “marginal flow” refers to renormalization-group behavior generated by marginal or marginally irrelevant operators rather than probability transport. In holographic RG, a classically marginal operator with \(\Delta=d\) has vanishing classical beta function,
\[
\beta_{cl}=-(d-\Delta)\lambda,
\]
but quantum corrections produce
\[
\beta=\beta_{cl}+\beta_q,
\]
so a classically marginal deformation can become truly marginal, marginally relevant, or marginally irrelevant. The holographic dual is a 5D Einstein-scalar model with massless bulk scalar and domain-wall metric
\[
ds^2 = e^{2A(y)} \eta_{\mu\nu} dx^\mu dx^\nu + dy^2.
\]
The trivial branch \(\phi=\phi_0\), \(A(y)=y/R\) is pure AdS and corresponds to a truly marginal deformation, whereas the nontrivial scalar profile encodes a quantum-corrected RG flow [2102.01829].

A structurally different use appears in the “triple \(T\bar T\)-like flow,” where the one-parameter deformation
\[
\partial_\lambda \mathcal{L}=\mathcal{R}_\lambda^{1/\alpha}
\]
organizes irrelevant, marginal, and relevant branches. The marginal point is \(\alpha=1\), for which
\[
\partial_\lambda \mathcal{L}=\mathcal{R}_\lambda,
\]
reproducing the root-\(T\bar T\) / ModMax branch. The paper states: “However, the only marginal theory is ModMax, and it is unique” [2606.00536].

In endpoint criticality, marginal flow refers to a marginally irrelevant scaling field that produces logarithmically slow renormalization and delays asymptotic scaling. For the square-lattice \(J_1\)–\(J_2\) Ising endpoint, the generalized field-mixing framework uses one relevant field plus one marginally irrelevant one, with four-state Potts exponents
\[
y_t=\frac{3}{2}, \qquad q=-\frac{3}{4},
\]
so the scaling variable is
\[
\lambda(L)\sim \lambda\,L^{y_t}(\ln L)^q.
\]
The paper emphasizes that negative Binder dips and bimodal histograms are not decisive by themselves, because they are compatible with Potts criticality plus strong finite-size corrections [2605.25946].

Boundary conformal field theory supplies yet another marginal notion. In the presence of a boundary, Herzog and Shamir propose deformations of the form
\[
\delta S = \lambda \int d^d x\, z^{\Delta-d}\, \mathcal O_\Delta(x),
\]
which remain compatible with the preserved \(SO(d,1)\) symmetry when \(\Delta\) is protected. Here the boundary compensates for the mismatch between \(\Delta\) and \(d\), generalizing the notion of exact marginality beyond translation-invariant bulk deformations [1906.11281].

Across these literatures, the common denominator is precise but abstract: a “marginal flow” is a dynamics whose defining object is not the full microscopic configuration alone but the evolution, preservation, or deformation of marginals. What changes from domain to domain is whether those marginals are endpoint laws in optimal transport, all-time probability distributions, posterior token marginals, noisy generative intermediates, or RG couplings associated with marginal operators.

Source: https://www.emergentmind.com/topics/marginal-flow