---
title: Function Projection for Flow Matching
url: https://www.emergentmind.com/topics/function-projection-for-flow-matching-fp-fm
type: topic
---

# Function Projection for Flow Matching

Searching arXiv for the specified papers and closely related work to ground the article.
arXiv search query: 2605.06272 FP-FM; 2305.17209 Functional Flow Matching; 2602.22742 ProjFlow; 2511.12898 Functional Mean Flow in Hilbert Space
Function Projection for Flow Matching (FP-FM) is a flow-matching method for generative modeling over a family of target distributions in which each distribution-specific velocity field is treated as an element of a function space, approximated in a learned basis, and adapted to unseen distributions by a least-squares projection computed from example samples rather than gradient-based retraining. In the current literature, the term most specifically denotes the many-shot adaptation algorithm introduced in 2026, while closely related work uses projection ideas in infinite-dimensional functional flow models and in projection-based constrained sampling during flow integration [2605.06272].

## 1. Problem setting and flow-matching formulation

FP-FM is posed on a data space \(\mathcal{X} \subset \mathbb{R}^n\), but the target is not a single distribution. Instead, one considers a family
\[
\{p_X^\iota\}_{\iota \in \mathcal{I}},
\]
with training only on a finite subset \(\mathcal{T} \subset \mathcal{I}\). For each \(\iota \in \mathcal{T}\), the available data are i.i.d. samples
\[
\mathcal{D}^\iota = \{x^{\iota,i}\}_{i=1}^m \sim p_X^\iota.
\]
The objective is twofold: generate from each training distribution \(p_X^\iota\), and, more importantly, adapt at inference time to a new distribution \(p_X^\iota\) for \(\iota \in \mathcal{I}\setminus\mathcal{T}\), given only a finite set of samples \(x^{\iota,1},\dots,x^{\iota,m}\) [2605.06272].

The underlying generative mechanism is standard flow matching. For each distribution \(p_X^\iota\), the construction uses
\[
X_0^\iota \sim \mathcal{N}(0,I),\qquad X_1^\iota \sim p_X^\iota,\qquad X_t^\iota = (1-t)X_0^\iota + tX_1^\iota,
\]
and defines the ideal velocity field
\[
v^\iota(x,t) = \mathbb{E}[X_1^\iota - X_0^\iota \mid X_t^\iota = x].
\]
If \(v^\iota\) were known exactly, then the ODE
\[
X_0' \sim \mathcal{N}(0, I),\qquad X_t' := X_0' + \int_0^t v^\iota(X_\tau', \tau)\, d\tau
\]
would transport the Gaussian base to \(p_X^\iota\). The novelty of FP-FM lies in learning a representation of the family
\[
\mathcal{V} = \{v^\iota : \mathcal{X}\times[0,1]\to\mathbb{R}^n \mid \iota\in\mathcal{I}\}
\]
that supports efficient post-training adaptation to unseen members of that family.

This setting differs from classic conditional diffusion or flow models, which expect a conditioning variable such as a class label or text. FP-FM instead conditions on a set of samples from the target distribution. The paper motivates this by applications where there may be no clean conditional variable but there are example datapoints, and where finetuning per new distribution is too expensive and slow [2605.06272].

## 2. Function-space projection of velocity fields

The central construction adapts the Function Encoders viewpoint to flow matching. Each \(v^\iota\) is regarded as an element of a Hilbert space of velocity fields over \(\mathcal{X}\times[0,1]\), equipped with the distribution-weighted inner product
\[
\langle f,g\rangle_{p_{t,X_t^\iota}} = \mathbb{E}_{t,X_t^\iota}\big[f(X_t^\iota,t)^\top g(X_t^\iota,t)\big].
\]
This choice matches the MSE geometry of flow matching, because the standard flow-matching objective minimizes squared error under the joint law of \((t,X_t^\iota)\) [2605.06272].

FP-FM learns shared basis functions \(g^1,\dots,g^k\) and represents each distribution-specific velocity field as
\[
v^\iota(x,t) \approx \sum_{i=1}^k c^{\iota,i} g^i(x,t).
\]
For static coefficients, the coefficient vector \(c^\iota\) is the least-squares solution
\[
c^\iota =
\begin{bmatrix}
\langle g^1, g^1 \rangle_{p_{t,X_t^\iota}} & \dots & \langle g^1, g^k \rangle_{p_{t,X_t^\iota}} \\
\vdots & \ddots & \vdots \\
\langle g^k, g^1 \rangle_{p_{t,X_t^\iota}} & \dots & \langle g^k, g^k \rangle_{p_{t,X_t^\iota}}
\end{bmatrix}^{-1}
\begin{bmatrix}
\langle v^\iota, g^1 \rangle_{p_{t,X_t^\iota}} \\
\vdots \\
\langle v^\iota, g^k \rangle_{p_{t,X_t^\iota}}
\end{bmatrix}.
\]
A key observation is that \(\langle v^\iota, g\rangle_{p_{t,X_t^\iota}}\) can be estimated from samples alone:
\[
\langle v^\iota, g \rangle_{p_{t,X_t^\iota}}
=
\mathbb{E}_{t, X_1^\iota, X_0^\iota}
\left[
(X_1^\iota - X_0^\iota)^\top g((1-t)X_0^\iota + tX_1^\iota,t)
\right].
\]
Accordingly, inner products with the unknown \(v^\iota\) are replaced by Monte Carlo averages over paired noise and data samples [2605.06272].

Training is a joint optimization over the basis parameters. For each training distribution \(\iota\), one samples \(x_1^{\iota,i}\sim\mathcal{D}^\iota\), \(x_0^{\iota,i}\sim\mathcal{N}(0,I)\), and \(t^i\sim\mathrm{Unif}([0,1])\), constructs \(x_t^{\iota,i}=(1-t^i)x_0^{\iota,i}+t^i x_1^{\iota,i}\), solves for \(c^\iota\), forms
\[
\hat v^\iota(x,t) = \sum_{i=1}^k c^{\iota,i} g^i(x,t),
\]
and minimizes the reconstruction error \(\|v^\iota-\hat v^\iota\|^2_{p_{t,X_t^\iota}}\). The paper characterizes this as a meta-learning style joint optimization: the inner problem is a closed-form function-space regression for coefficients, and the outer problem learns the shared basis so that these projections reconstruct all training velocity fields well [2605.06272].

## 3. Static, temporal, and dynamic variants

FP-FM is presented as a family of models distinguished by how the coefficient function depends on time and state. All variants use the same shared basis \(\{g^i\}_{i=1}^k\), but differ in expressivity and compute.

| Variant | Coefficient dependence | Inference cost |
|---|---|---|
| Static FP-FM | \(c^{\iota,i}\) | one solve per distribution |
| Temporal FP-FM | \(c^{\iota,i}(t)\) | one solve per ODE time step |
| Dynamic FP-FM | \(c^{\iota,i}(x,t)\) | one solve per sample and ODE time step |

In Static FP-FM, the approximation is
\[
v^\iota(x,t) \approx \sum_{i=1}^k c^{\iota,i}\, g^i(x,t).
\]
The coefficients are constant for a given \(\iota\), independent of both \(x\) and \(t\). This makes inference fast, since the \(k\times k\) system is solved only once for a new distribution. The paper states that this variant works well on training distributions but struggles with unseen mixtures and new supports, because it assumes a fixed global linear combination of the basis fields [2605.06272].

Temporal FP-FM relaxes this by allowing the coefficients to vary with time:
\[
v^\iota_t(x) \approx \sum_{i=1}^k c^{\iota,i}(t)\, g^i_t(x).
\]
For each fixed \(t\), the coefficient vector is computed from a least-squares problem under the time-slice distribution \(p_{X_t^\iota|t}\). This yields a more expressive approximation of flows whose geometry changes over the course of transport, at the cost of solving a \(k\times k\) system once per integration step [2605.06272].

Dynamic FP-FM allows local dependence on both state and time:
\[
v^\iota(x,t) \approx \sum_{i=1}^k c^{\iota,i}(x,t)\, g^i(x,t).
\]
At a fixed \((x,t)\), the Gram matrix becomes pointwise,
\[
\langle g^i, g^j\rangle_{x,t} = \frac{1}{n} g^i(x,t)^\top g^j(x,t),
\]
so the remaining task is to estimate the conditional mean displacement
\[
\mathbb{E}[X_1^\iota-X_0^\iota\mid X_t^\iota=x]
\]
and project it onto the span of \(\{g^i(x,t)\}_{i=1}^k\) in \(\mathbb{R}^n\). This is the most expressive variant and also the most expensive, since the coefficient solve is performed per sample and per ODE time step [2605.06272].

The paper further interprets these variants through regularity of the coefficient function: static coefficients are 0-Lipschitz in \((x,t)\), dynamic coefficients have no such constraint, and temporal coefficients are 0-Lipschitz in \(x\) but not in \(t\). This suggests a continuum of intermediate models, though such variants are left for future work.

## 4. Adaptation to unseen distributions

Adaptation is the defining operation of FP-FM. Once the basis \(\{g^i\}\) has been trained, no gradient updates to the basis networks are used for a new target distribution. Instead, adaptation consists of solving a small linear system using the sample set \(\mathcal{D}^\iota\) from that new distribution [2605.06272].

For Static FP-FM, the same least-squares formula used in training is reused at inference time, with Monte Carlo approximations computed from the new distribution’s samples and fresh Gaussian noise draws. The resulting adapted field
\[
\hat v^\iota(x,t) = \sum_{i=1}^k c^{\iota,i} g^i(x,t)
\]
is then used in standard ODE sampling. Temporal FP-FM repeats this coefficient calculation at each time step, solving for \(c^\iota(t)\) under \(p_{X_t^\iota|t}\). Dynamic FP-FM recomputes coefficients locally during integration at each sample point \(x_t\) and time \(t\) [2605.06272].

The main theoretical device enabling Dynamic FP-FM is Theorem 1, which rewrites the conditional mean displacement as a self-normalized importance sampling expectation. For fixed \(X_t=x\), define
\[
X_0^* = \frac{x - t X_1}{1-t}.
\]
Then
\[
\mathbb{E}[X_1 - X_0 \mid X_t = x]
=
\mathbb{E}_{X_1}\left[(X_1 - X_0^*) \frac{ p(X_0^*)}{\mathbb{E}_{X_1'}[p(X_0^{*\prime})]}\right].
\]
Operationally, this gives the following Monte Carlo estimator for each \(x_t\): sample \(x_1^{\iota,i}\) from \(\mathcal{D}^\iota\), compute
\[
x_0^{\iota,i} = \frac{x_t - t x_1^{\iota,i}}{1-t},
\qquad
w^{\iota,i}=p(x_0^{\iota,i}),
\]
normalize
\[
\tilde w^{\iota,i}=\frac{w^{\iota,i}}{\sum_{j=1}^m w^{\iota,j}},
\]
and estimate
\[
\mathbb{E}[X_1^\iota-X_0^\iota\mid X_t^\iota=x_t]
\approx
\sum_{i=1}^m (x_1^{\iota,i} - x_0^{\iota,i})\, \tilde w^{\iota,i}.
\]
Dynamic FP-FM then projects this local estimate onto the instantaneous basis span. The result is a fully training-free adaptation rule in coefficient space rather than parameter space [2605.06272].

A practical implication is that FP-FM occupies a middle ground between fixed conditional models and per-distribution finetuning. Static adaptation is extremely cheap, Temporal adaptation is moderate, and Dynamic adaptation is the most computationally demanding. The details explicitly state, however, that all three remain cheaper and simpler than finetuning or training per-distribution guided models.

## 5. Relation to functional flow models and other projection-based uses

FP-FM sits within a broader research line that brings flow matching into functional or projected settings, but the role of projection differs across papers. Functional Flow Matching (FFM) formulates flow matching directly on a real separable Hilbert space \(\mathcal{F}\), defines a path of measures \((\mu_t)_{t\in[0,1]}\subset\mathcal{P}(\mathcal{F})\), and learns a functional vector field \(u_t:\mathcal{F}\to\mathcal{F}\) that generates this path through an ODE in function space. Its practical implementation discretizes the domain and uses Fourier Neural Operators, which the details describe as already a form of projection onto a finite-dimensional subspace spanned by implicit Fourier modes up to a cutoff [2305.17209].

That functional perspective also makes explicit how a projection-based variant can be formalized. The details for FFM describe choosing a finite-dimensional subspace
\[
V_K=\mathrm{span}\{\phi_1,\dots,\phi_K\},
\]
projecting functions with \(P_K\), pushing forward the reference and data measures into coefficient space, and then performing flow matching in \(\mathbb{R}^K\). This is presented as conceptually equivalent to FFM’s practical discretization, but with basis choice and projection made explicit. A plausible implication is that the named FP-FM algorithm of 2026 and the projection interpretation of FFM share a common Hilbert-space intuition while addressing different problems: one is many-shot adaptation across a family of distributions, the other is generative modeling of data that already live in function spaces [2305.17209].

Functional Mean Flow in Hilbert Space extends this line to a one-step setting. It defines a two-parameter flow \(\phi_{t\to r}\), a mean velocity
\[
\bar u_{t\to r}(g)=\frac{1}{r-t}\big(\phi_{t\to r}(g)-g\big),
\]
and corresponding one-step generators in Hilbert space. Its implementations again rely on finite-dimensional representations: FNOs for functional data, sparse/dense operator hybrids for images, and Perceiver-style latent representations for signed distance fields. The details explicitly describe these as concrete realizations of projections \(P:\mathcal F\to H_P\) to a finite-dimensional Hilbert subspace, followed by re-embedding or decoding [2511.12898].

ProjFlow uses projection in yet another sense. It modifies flow-matching sampling by predicting a clean endpoint \(\hat x_1\) with Tweedie’s formula and then projecting that endpoint onto a linear constraint set under a kinematics-aware metric,
\[
\hat{x}_1^\star = \arg\min_x \frac12 \|x - \hat{x}_1\|_R^2 + \frac12 \|y - A x\|_{\Sigma^{-1}}^2.
\]
Here the projection is not onto a basis of velocity fields, but onto a constraint manifold during sampling. The details therefore support a narrow and a broad use of “function projection for flow matching”: narrowly, the many-shot adaptation algorithm of 2026; more broadly, a design pattern in which flow matching is combined with explicit projection operators, either in representation space or in constrained sampling space [2602.22742].

A common misconception is to collapse these formulations into a single method. The literature instead distinguishes at least three roles for projection: basis projection of velocity fields for distribution adaptation, finite-dimensional projection of infinite-dimensional function-space models, and analytic projection onto linear constraint manifolds during sampling. This suggests that “projection” is a unifying lens rather than a single standardized architecture.

## 6. Empirical behavior, computational profile, and limitations

The 2026 FP-FM paper evaluates the method on 2D Arcs, MNIST, and ImageNet, using three regimes: TD (Training Distribution), UD (Unseen Distribution), and US (Unseen Support). Baselines include unconditional flow matching on the union of training data, conditional flow matching with explicit conditioning, classifier-guided methods, distribution-guided methods, and finetuning. The reported metrics are Precision, Recall, FID, and Generation Time [2605.06272].

On 2D Arcs, Dynamic FP-FM is reported as the best match to target distributions across TD, UD, and US. For UD, its Precision is \(0.976\), Recall is \(0.962\), and Time is \(11.24\) s, while Temporal FP-FM attains UD Precision \(0.690\), Recall \(0.979\), and Time \(0.98\) s. The paper interprets the pattern as many baselines overestimating support, whereas Dynamic FP-FM achieves high precision while maintaining high recall [2605.06272].

On MNIST, Dynamic FP-FM again gives the strongest reported results. In TD, it achieves Precision \(0.935\), Recall \(0.925\), and FID \(10.44\). In US, corresponding to digit 9, it achieves Precision \(0.903\), Recall \(0.937\), and FID \(11.25\). The conditional model is described as strong on TD and somewhat on UD but struggling on US, while finetune and guided methods are significantly worse in FID and/or precision. The ablations further report that FID improves with more shots, that Dynamic FP-FM precision and recall are relatively stable, and that performance is fairly robust across the number of basis functions \(k\), with generation time growing mildly with \(k\), especially for Dynamic FP-FM [2605.06272].

On ImageNet, the strongest gains are on unseen classes. In TD, Dynamic FP-FM achieves Precision \(0.669\), Recall \(0.667\), and FID \(126.1\), compared with the conditional model’s Precision \(0.509\), Recall \(0.225\), and FID \(156.3\), and finetune (LoRA)’s Precision \(0.489\), Recall \(0.143\), and FID \(162.6\). In US, Dynamic FP-FM achieves Precision \(0.699\), Recall \(0.682\), and FID \(117.0\), while the conditional model is reported at Precision \(0.012\), Recall \(0.394\), and FID \(378.7\), and finetune at Precision \(0.344\), Recall \(0.251\), and FID \(193.8\). The abstract summarizes the overall result as greatly improved precision and recall relative to baselines across synthetic and image-based datasets, with especially strong gains on unseen distributions [2605.06272].

The implementation details reflect the dataset scale. The basis architecture is an MLP for 2D Arcs, a U-Net for MNIST, and a latent ViT backbone with a pretrained VAE latent space for ImageNet. Optimization uses Adam or AdamW with learning rate \(1e{-3}\) or \(5e{-4}\), with constant or cosine scheduling. The paper states that 2D Arcs and MNIST were run on an RTX 3080, and ImageNet on 8 RTX Pro 6000 Blackwell GPUs [2605.06272].

The stated limitations are structural. FP-FM requires samples from the new distribution, and performance degrades with too few or unrepresentative samples. It assumes that velocity fields across distributions lie approximately in a low-dimensional linear subspace spanned by the learned bases, so static and temporal variants may underfit if the true family of flows is far from linear. Dynamic FP-FM is compute-heavy because it recomputes coefficients per sample and time step. The ImageNet results further indicate that basis quality and batch size matter: insufficient class context or poor basis training can make static and temporal variants perform poorly [2605.06272].

Taken together, these results locate FP-FM as a sample-conditioned alternative to symbolic conditional generation and to per-task finetuning. Its main contribution is not a new transport equation, but a new decomposition of distribution-specific flow fields into shared basis functions plus distribution-dependent projections. In that sense, FP-FM turns adaptation to unseen distributions into a problem of function-space approximation and coefficient inference rather than optimizer-driven parameter updates.

Source: https://www.emergentmind.com/topics/function-projection-for-flow-matching-fp-fm