In this paper
AbstractIntroductionRelated WorkManifold Attracting Flow MatchingProblem formulationFrozen endpoint modelGuided Manifold Attracting DynamicsProperties and sampling algorithmExperimentsExperimental setting and evaluationGeometric and partially observed constraintsConservation with dynamical consistencyEnergy-conditioned prior recoveryCore-mechanism ablationsConclusionReproducibility StatementEthics StatementAI Use StatementData, Conflicts, and FundingProofs and derivationsTarget-measure geometryEndpoint estimation and query-region conditionsLagrange-multiplier correctionProjected-adjoint effect and sparse observationsHistory weights for affine constraintsProof of Proposition 1Base-specialization local feedback stabilityFinite-step residual control and accumulated errorEndpoint stability on a common query regionAdditional algorithmic detailsOptional adjoint-step clippingPoisson adjoint scalingHow the anchor correction reaches the next queryExperimental protocolsSphere–plane intersectionPartially observed Poisson equationPeriodic viscous Burgers equationMass-conserving reaction–diffusion systemTwo-dimensional Euler flowEnergy-controlled Navier–Stokes flowSupplementary results and diagnosticsExtended metric tablesThree-constraint oracle comparisonAdditional diagnosticsInference-time computational costField SWD and matched CCFM comparisonsBurgers tangential history controlPCFM projection and mixing controlsShifted energy targetsNormal-contraction schedulesQualitative samplesAdditional inference-time baselinesScope and practical limitationsReferencesWorksComputer Science
Manifold Attracting Flow Matching: Physics-Constrained Sampling via Continuous Geometric Dynamics
Abstract
Generating scientific data under previously unseen equality constraints requires satisfying the prescribed constraints without destroying the physical structure learned from data. Existing inference-time approaches often enforce physical constraints by repeatedly correcting predicted endpoints, but such discrete corrections can distort learned generative structure and introduce unstable feedback. In this work, we propose Manifold Attracting Flow Matching (MAFM), which continuously evolves a persistent anchor through an ODE whose dynamics drive it analytically toward the constraint manifold. Specifically, its geometric correction preserves model-guided tangent motion while prescribing the normal motion to contract constraint violations toward the manifold. This construction separates model tracking from constraint attraction and provides theoretical guarantees for residual contraction and local feedback stabilization. Experiments across geometric and partial differential equation benchmarks demonstrate improved generation quality over variant constraint-guided baselines while maintaining low constraint residuals. MAFM provides a flexible framework for coordinating learned physical structure and explicit constraints through controllable sampling dynamics, without retraining the underlying generative model.
Introduction
Generative models have become an increasingly important tool for producing diverse and realistic samples across scientific and engineering domains. Yet in many applications, realism alone is not sufficient: we need to generate samples that satisfy what the task actually asks for. Crucially, many of these requirements are hard rather than preferential—a sample that violates them may be plausible under the learned data distribution, but still invalid for downstream use. For example, PDE reconstruction from sparse observations requires generated solution fields to agree with prescribed measurements or boundary values [17] (Shysheya et al. 2024); controllable image generation may require specified regions or pixels to obey a prescribed spatial or color pattern [12, 26]; and safety-critical decision making requires states or actions to remain within prescribed safety limits rather than merely reducing violations on average [1, 25, 16]. These examples highlight a common need: generating diverse samples while satisfying specific constraints exactly.
A particularly important setting arises when such constraints are specified only after training. A generative model may be trained once on a broad data distribution, but subsequently queried with new observations, boundary values, geometric specifications, or control targets [32, 13]. Collecting a dedicated dataset or retraining a conditional model for every new request would substantially limit the reuse of the learned generative prior. We therefore study inference-time constrained generation: an unconditional model learns the data distribution independently of downstream constraints, while an analytic equality constraint is supplied only to the sampler at inference time. Our goal is to generate a diverse set of feasible samples that obey the governing physical laws and, for PDE tasks, lie on the solution manifold learned by the model.
Existing approaches incorporate physical information at different stages. Physics-informed training and constrained fine-tuning modify the learning objective to account for known physical requirements [4, 28]. Inference-time methods instead reuse a pretrained model: DiffusionPDE guides generation using residual gradients [17], while ECI alternates endpoint extrapolation, physical correction, and interpolation [9]. Physics-Constrained Flow Matching (PCFM) corrects predicted flow endpoints and re-interpolates with the original source to enforce sampling-time constraints [30]. Despite these advances, satisfying the prescribed constraint is only one requirement: constraint enforcement should not drive generated samples away from the manifold learned from data. We therefore ask whether a sampler can satisfy a prescribed hard constraint while preserving fidelity to the learned data manifold. Accordingly, we evaluate two complementary objectives: constraint satisfaction and data-manifold fidelity. We report distributional statistics as supplementary comparisons against specified reference ensembles.
We introduce Manifold Attracting Flow Matching (MAFM), an inference-time method for imposing new equality constraints on a pretrained generative model without retraining. The key idea is persistent-anchor dynamics. Instead of injecting constraint guidance directly into the transient sampling state , as in gradient-guidance or projection-based methods, MAFM guides constrained generation through the continuous geometric evolution of a persistent anchor, whose dynamics analytically converge to the constraint manifold. Learned endpoint predictions and constraint feedback are jointly accumulated in this anchor, which serves as the evolving candidate solution ultimately returned by the method. Its dynamics separate the assimilation of constraint-compatible model information from attraction toward the constraint manifold, allowing learned structure to be preserved while feasibility is controlled at an independently prescribed rate. We characterize the resulting constraint-residual dynamics under explicit assumptions and analyze how endpoint-prediction and adjoint-estimation errors propagate through the anchor trajectory.
We evaluate MAFM across five scientific-computing benchmarks involving Poisson, Burgers, reaction–diffusion (RD), Euler, and Navier–Stokes (NS) systems. Together, these tasks test constraints arising from partial observations, conservation laws, prescribed physical quantities, and recovery of feasible samples while retaining learned data structure. On all five PDE benchmarks reported in Table 1, MAFM meets the prescribed constraint tolerance and achieves lower sample-level relative error than the baselines that meet the same tolerance. So our contributions can be summarized as follows:
| Method | Feas. | CE↓ | PDE RelL2↓ | Feas. | CE↓ | IC RelL2↓ | Feas. | CE↓ | IC RelL2↓ |
| (a) Partial observation | (b) Conservation | ||||||||
| Poisson, 64 sensors () | Burgers () | Reaction–diffusion () | |||||||
| Vanilla FM | No | 1.40 | 1.13% | No | 1.13% | No | 1.31% | ||
| FM + projection | Yes | 0 | 22.7% | Yes | 27.0% | Yes | 10.4% | ||
| PCFM-Base | Yes | 0 | 11.5% | Yes | 7.61% | Yes | 3.03% | ||
| PCFM-Relaxed | Yes | 0 | 10.3% | No | 7.61% | No | 2.46% | ||
| ECI* | Yes | 0 | 11.5% | Yes | 7.54% | Yes | 2.96% | ||
| Stop-grad. | Yes | 5.55% | Yes | 1.03% | Yes | 6.04% | |||
| Full-grad. (DPDE) | No | 0.610 | 1.05% | No | 17.2% | No | 1.56% | ||
| CCFM () | Yes | 0 | 22.78% | Yes | 5.73% | Yes | 6.83% | ||
| D-Flow | No | 0.555 | 1.03% | No | 0.995 | 39.01% | No | 0.0317 | 3.45% |
| PnP-Flow | No | 0.538 | 1.22% | No | 0.71% | No | 0.98% | ||
| LDF (198 NFE) | No | 14.96% | No | 4.54% | No | 21.81% | |||
| MAFM | Yes | 1.70% | Yes | 0.965% | Yes | 2.74% | |||
| + projection | Yes | 0 | 1.70% | Yes | 0.965% | Yes | 2.74% | ||
| (c) Energy-only held-out tests (512 samples per system) | |||||||||
| Euler | Controlled NS | ||||||||
| Method | Feas. | E↓ | IC RelL2↓ | Div.↓ | Mean↓ | Feas. | E↓ | IC RelL2↓ | Div.↓ Mean↓ |
| Vanilla FM | No | 3.68% | 0.0635 | 0.0131 | No | 3.46% | 0.0624 0.0111 | ||
| Terminal projection | Yes | 3.62% | 0.0636 | 0.0131 | Yes | 3.40% | 0.0624 0.0113 | ||
| PCFM | No | 13.6% | 0.229 | 0.0297 | No | 12.3% | 0.212 0.0301 | ||
| + projection | Yes | 13.6% | 0.2287 | 0.0298 | Yes | 12.3% | 0.2124 0.0302 | ||
| ECI | Yes | 13.6% | 0.232 | 0.0276 | Yes | 12.3% | 0.213 0.0301 | ||
| Stop-grad. guidance | No | 8.64% | 0.112 | 0.0214 | No | 3.47% | 0.0494 0.00893 | ||
| Full-grad. (DPDE) | No | 3.42% | 0.0604 | 0.0106 | No | 2.95% | 0.0515 0.00729 | ||
| CCFM () | Yes | 3.68% | 0.0650 | 0.0130 | Yes | 3.48% | 0.0640 0.0106 | ||
| D-Flow | No | 3.54% | 0.0626 | 0.0108 | No | 3.27% | 0.0599 0.00941 | ||
| PnP-Flow | No | 0.0581 | 11.33% | 0.203 | 0.0300 | No | 0.0554 | 10.25% | 0.189 0.0274 |
| LDF (198 NFE) | No | 7.13% | 0.165 | 0.0219 | No | 5.86% | 0.152 0.0184 | ||
| MAFM | Yes | 2.94% | 0.0483 | 0.0108 | Yes | 2.76% | 0.0474 0.00881 | ||
| + projection | Yes | 2.94% | 0.0483 | 0.0108 | Yes | 2.76% | 0.0474 0.00881 |
Table 1. Physical consistency under supplied constraints. (a) Poisson, (b) Burgers and reaction–diffusion, and (c) Euler and controlled NS.
We introduce a persistent-anchor sampling paradigm for imposing new equality constraints at inference time with a frozen flow model. The persistent anchor provides a shared endpoint representation that continuously integrates learned guidance from the pretrained flow with constraint feedback, directing both toward the eventual output.
We characterize the constraint-residual dynamics induced by the persistent-anchor updates, establish conditions for convergence toward feasibility, and analyze how endpoint-prediction and adjoint-estimation errors affect the anchor trajectory.
We evaluate MAFM across scientific-computing benchmarks involving partial observations, conservation laws, and prescribed physical quantities, demonstrating that hard constraints can be satisfied to numerical tolerance while preserving fidelity to the learned data support.
Related Work
Generative modeling for physical systems. Continuous normalizing flows and flow matching provide flexible generative models for high-dimensional physical states [8, 23, 21], with minibatch optimal transport often used to simplify conditional transport paths [29]. When the underlying geometry is known, Riemannian score models and flow matching can construct dynamics directly on the prescribed manifold [10, 7]. In contrast, our setting learns the data support from ambient samples and introduces a separate analytic constraint only at inference time.
Physical information has been incorporated either during training or during sampling. Residual-based objectives and physics-constrained fine-tuning bias the learned model toward known physical requirements ([24, 4, 18, 3, 28]). Inference-time approaches instead reuse a pretrained model: DiffusionPDE applies residual-gradient guidance ([17]), ECI alternates endpoint extrapolation with hard correction and interpolation ([9]), and PCFM repeatedly corrects predicted endpoints before re-interpolation ([30]). PnP-Flow ([22]) also uses re-interpolation, alternating data fidelity and denoising for inverse problems. Lagrangian Dual Flows ([19]) evolves a constraint dual variable with the sample. D-Flow ([5]) differentiates through the full generation ODE to optimize the source noise. FunDPS ([33]) uses gradients through a denoised estimate in function-space posterior sampling, a guidance operation tested on our FM backbone by the full-gradient baseline. However, constraint satisfaction alone does not ensure that these corrections preserve the physical relationships learned from data. While operating at inference time with a frozen flow model, MAFM maintains a persistent endpoint anchor across sampling steps, using learned endpoint guidance and constraint feedback to update a common candidate for the final output rather than attaching constraint control only to transient sampling states.
Geometric motivation and constraint stabilization. Stiff and fast–slow dynamical systems naturally separate rapid attraction toward a lower-dimensional set from slower evolution along it ([31, 14]). Classical constrained integration similarly uses algebraic multipliers to enforce or stabilize equality constraints ([15, 2]), with related ideas appearing in neural differential-algebraic models ([6, 11]). These perspectives motivate the separation used in MAFM: learned endpoint information primarily guides motion compatible with the feasible geometry, while multiplier-based feedback independently controls contraction of the known constraint residual. We use this viewpoint as algorithmic motivation; our analysis establishes residual dynamics for the prescribed constraint and does not assume persistence of the unknown learned data support.
Manifold Attracting Flow Matching
We first formulate inference-time constrained generation as sampling where a learned data support meets a new equality constraint. We then derive persistent-anchor dynamics that combine frozen-model endpoint guidance with multiplier-based constraint control. Finally, we give a discrete sampler and analyze residual contraction, adjoint guidance, and finite-step error.
Problem formulation
Let be the space of complete physical objects. We write the source and data endpoints as , , and denote the data support by . At generation time, an equality constraint specifies
The feasible intersection is as is shown in Figure 1. We use for a desired control distribution whose support is contained in , without prescribing probability weights on the intersection. The frozen unconditional model learns relationships in the broad data distribution; test-time constraints enter only the sampler. This assumption places the requested constraint within the physical range represented by the data. It allows the finite training set to contain no exactly feasible sample. We assess the generated output through two complementary objectives,
Figure 1. Constrained sampling on a learned data support. The broad data support (purple) meets the supplied constraint set (green) at the desired feasible intersection. The illustration denotes the data distribution by , its support by , and the constraint set by .
The unknown support makes the second objective difficult to compute directly. Geometry, PDE residuals, and independent rollouts test specified relationships in the data; distribution statistics provide auxiliary coverage diagnostics. An additional choice of probability weights and its corresponding evaluation appear in Appendix § 11.§ 1.
Global and local constraints. For a differentiable constraint, define the row-oriented Jacobian . The product gives the residual rate induced by a physical velocity , while gives a physical-space normal correction. Here contains one Lagrange multiplier per scalar constraint. A global constraint has a correction distributed broadly over the physical object, as for mass or energy. A local observation constraint has a correction supported at selected sensors, windows, or channels, as in . Even a single integral constraint can induce a correction across the entire field. For sparse observations, we use optional input guidance through the frozen model to carry constraint information to unobserved coordinates.
Frozen endpoint model
Let , with marginals and ; the coupling need not be independent. Vanilla flow matching uses the complete-space training interpolation
whose target velocity is . The frozen model defines the Vanilla flow from [21]. We extract endpoint information through
an endpoint-extrapolation form also used in PCFM (Utkarksh et al., 2026). Under finite second moments, for the population-optimal regression field ,
on the training path almost everywhere. Thus is a learned data-endpoint estimate used repeatedly by the anchor dynamics. Its proof, parameterization, and query-region conditions are given in Appendix § 11.§ 2.
Guided Manifold Attracting Dynamics
We construct the sampling dynamics from a persistent endpoint anchor, optional guidance through the frozen model, and a multiplier that controls the anchor’s constraint residual.
Query and persistent anchor. The new constraint concerns the final physical object. For each fixed source , MAFM maintains a network query and a persistent endpoint anchor , both in , with
The query starts at and is rebuilt after every anchor update. At the two states coincide, so the generated output is . Here without a superscript remains the data endpoint in Eq. (3). Repeated predictions from the frozen endpoint model guide this anchor, while the correction below controls its constraint residual.
Endpoint-guided candidate. For local observations, direct normal correction acts on the measured coordinates. The frozen endpoint model can also carry their mismatch to other coordinates through its input sensitivity. To obtain this additional guidance, define
This energy measures the constraint mismatch of the predicted endpoint; the normal correction below acts on the anchor residual . When this option is active, the input adjoint at is
The query relation in Eq. (6) has anchor derivative . Its chain rule therefore gives
The Jacobian transposes transfer the predicted endpoint’s residual to the complete query; Eq. (9) then transfers it to the anchor. The model parameters remain frozen. Here is the Jacobian of the endpoint predictor with respect to at fixed . In Eq. (8), we use a vector–Jacobian product (VJP), a standard operation in reverse-mode automatic differentiation, to apply without explicitly forming the model Jacobian.
Let be the tracking and guidance rates. For , the optional adjoint can be expressed as an endpoint displacement. Set and define
The factor follows from Eq. (9). For all nonnegative rates, the candidate velocity is defined by
When , this equals ; the virtual endpoint is an equivalent interpretation, not an additional state. At , Eq. (11) still gives . Setting skips the input VJP and retains exact endpoint tracking. For full-row-rank affine constraint and an exact, unregularized solve, we recover the PCFM projection and reinterpolation step when , the tangential tracking weight reaches its full-replacement limit , and the normal correction satisfies . Appendix A.5 gives the two recurrence relations. The Poisson experiment uses a fixed channel-scaled adjoint direction, specified in Appendix B.2; the multiplier construction is unchanged.
Constraint-compatible anchor dynamics. Let . An algebraic multiplier corrects the combined candidate velocity at the anchor while avoiding the amplified dynamics
The rate controls how quickly the anchor residual decays. Its time integral sets the cumulative contraction. regularizes the Gram solve. For full-row-rank , define . With an exact unregularized solve (), the dynamics become
Algorithm 1 Unified persistent-anchor MAFM sampling.
Require: source $x_0$, frozen $D_\theta$, constraint $C$, steps $N$, schedules $\gamma$, $\eta$, $\kappa$, ridge $\delta$
1: $h \leftarrow 1/N$; $x^{(0)} \leftarrow x_0$; $d^{(0)} \leftarrow D_\theta(x_0,0)$; $a^{(0)} \leftarrow d^{(0)}$
2: for $k = 0,\ldots,N-1$ do
3: $t_k \leftarrow kh$; $J^{(k)} \leftarrow J_C(a^{(k)})$
4: if $k > 0$ then
5: $d^{(k)} \leftarrow D_\theta(x^{(k)},t_k)$
6: end if
7: $q^{(k)} \leftarrow 0$
8: if $\eta(t_k)t_k > 0$ then
9: $q^{(k)} \leftarrow \operatorname{clip}_k(\nabla_x E_{t_k}(x^{(k)}))$ ▹ one input VJP
10: end if
11: $w^{(k)} \leftarrow (\rho_k/h)(d^{(k)}-a^{(k)})-\eta(t_k)t_kq^{(k)}$ ▹ tracking and guidance
12: solve $(J^{(k)})^\mathsf{T}\lambda^{(k)}+\delta I_m\lambda^{(k)}=- (J^{(k)})^\mathsf{T}w^{(k)}+\kappa(t_k)C(a^{(k)})$ ▹ normal attraction
13: $a^{(k+1)} \leftarrow a^{(k)}+h[w^{(k)}+(J^{(k)})^\mathsf{T}\lambda^{(k)}]$ ▹ advance persistent anchor
14: $x^{(k+1)} \leftarrow (1-t_{k+1})x_0+t_{k+1}a^{(k+1)}$ ▹ rebuild model query
15: end for
16: return $x^{(N)}=a^{(N)}$
The first term retains the candidate’s constraint-neutral component:
Thus the adjoint changes tangential motion only after projection; need not itself be tangent. The second term replaces the candidate’s normal component with the prescribed residual attraction. For , the multiplier still retains the tangential component but relaxes the exact normal replacement. The constrained-velocity interpretation and regularization effect are derived in Appendix § 11.§ 3.
Properties and sampling algorithm
We first identify the exact continuous residual dynamics and the adjoint’s instantaneous effect on constraint-neutral motion, then give the finite-step sampler and its residual bound.
Proposition 1 (Exact residual contraction). Suppose , has full row rank along an existing solution, is integrable, and Eq. (12) is solved exactly with . Then
In this exact setting, the multiplier fixes the residual rate independently of the candidate velocity: controls normal attraction, while and control tangent motion. Appendix § 11.6 proves this result and derives the additional algebraic terms caused by a ridge or an inexact multiplier solve.
Proposition 2 (Instantaneous projected-adjoint effect). Fix a source , anchor , and time , and evaluate at the common query . Suppose has full row rank and the multiplier is solved exactly with . Let be the corrected anchor velocity from Eqs. (11)–(13), and let use the same state and schedules with . Then
For and , the adjoint has no instantaneous effect if and only if , equivalently .
Together, Propositions 1 and 2 separate the two roles of the correction: the multiplier prescribes residual contraction, while the input adjoint can steer constraint-neutral motion through its tangent projection. For sparse observations, the endpoint model’s learned cross-coordinate sensitivity can carry information from measured to unmeasured coordinates through this correction. Appendix § 11.§ 5 gives the sparse-observation specialization, and the Poisson ablation in § 5.5 examines the adjoint’s effect.
Under local common-query-region and Lipschitz assumptions, endpoint and input-adjoint errors yield a pathwise anchor perturbation bound, stated and proved in Appendix § 11.9.
Discrete sampler. Algorithm 1 discretizes the anchor dynamics with , , and relaxed tracking weight . Its optional clip is the identity by default; Appendix B.1 gives the clipped variant. The query is rebuilt from the updated anchor as in Eq. (6). Appendix D.4 gives the computational complexity and measured sampling times.
Proposition 3 (Finite-step residual control). Consider Algorithm 1 with , , full-row-rank , and an exact multiplier solve. Set , , and . Suppose and is -Lipschitz in operator norm along the step segment. Then
The proof and the accumulated bound, including regularization and inexact linear solves, are in Appendix A.8. Under constant , , bounded step velocities, and exact unregularized solves, the curvature contribution to the residual bound is .
Experiments
We evaluate MAFM on six physical-space generation problems spanning geometric constraints, partial observations, conservation laws, and prescribed physical quantities. The experiments test whether hard constraints can be enforced at inference time while preserving the physical structure learned by the pretrained flow model. We first introduce the common experimental setup and evaluation protocol, and then present benchmark results and additional analyses.
Experimental setting and evaluation
Benchmarks. We evaluate MAFM on six physical-space generation tasks: sphere support recovery, partially observed Poisson fields, mass-constrained Burgers and reaction–diffusion trajectories, energy-conditioned Euler flows, and controlled Navier–Stokes (NS) flows. All methods generate the complete physical state. Table 3 in Appendix C distinguishes the physical structure learned from data from the constraints supplied at inference.
| Benchmark | Equation or data distribution | Structure learned from data | Explicit inference-time condition | Constraint type |
| Sphere–plane | Uniform unit-sphere distribution, . | Plane ; the desired support is the intersection circle. | Affine, single-coordinate algebraic | |
| Poisson | , | Joint samples satisfy the discrete Poisson equation and homogeneous boundary conditions. | ; only is observed, with no direct observations of . | Sparse, local linear observations |
| Burgers | Periodic viscous dynamics and their trajectory statistics. | Prescribed spatial mean at every frame. | Framewise global linear integral | |
| Reaction–diffusion | , | No-flux nonlinear dynamics, positive concentration support, and trajectory statistics. | Prescribed total mass at every frame. | Framewise global linear integral |
| Euler | Incompressible, zero-mean velocity trajectories generated by Euler dynamics. | Prescribed kinetic energy at every frame; incompressibility and zero mean are left to the learned prior. | Global nonlinear quadratic | |
| Controlled NS | Incompressible, zero-mean velocity trajectories generated by controlled NS dynamics. | Prescribed kinetic energy at every frame; incompressibility and zero mean are left to the learned prior. | Global nonlinear quadratic |
Table 3. Equations, learned structure, and supplied conditions for the six benchmarks.
Baselines and metrics. We compare vanilla FM with and without terminal projection, PCFM [30], ECI [9], stop-gradient guidance [17], full-gradient endpoint guidance [33], CCFM [20], D-Flow [5], PnP-Flow [22], and LDF [19]. We evaluate two primary objectives: constraint satisfaction and fidelity to the learned physical structure. Constraint satisfaction is measured by the corresponding constraint error, while physical fidelity is evaluated using PDE relative error. For time-dependent PDEs, IC RelL2 compares each sample with an independent rollout initialized from its generated initial field. If the training distribution has a density in the ambient space, it assigns zero probability to the feasible manifold defined by a regular equality constraint. Distributional metrics are reported as ancillary diagnostics. Field SWD results appear in Appendix § 14.§ 6. Appendix § 13 gives feasibility thresholds and reference construction. Appendix § 14 provides sample counts and full results.
Implementation. Within each benchmark, samplers share the frozen flow network, paired starting sources, supplied conditions, and evaluation set. Experiments were conducted on a workstation equipped with eight NVIDIA GeForce RTX 4090 GPUs. Appendix § 13 details the implementation and hyperparameters. Appendix § 14.11 describes D-Flow, PnP-Flow, and LDF. Appendix § 14.§ 5 reports inference costs.
Geometric and partially observed constraints
Learned support under a linear constraint. On sphere–plane, defines the plane and the learned unit-sphere structure selects its circular intersection. Terminal projection satisfies but achieves only 6.47% joint coverage. MAFM attains mean , radial , and the highest joint coverage (73.0%). Appendix § 14 reports full diagnostics and threshold sensitivity.
Joint fields under partial observation. The Poisson condition observes sparse values of , but the model must generate a coupled pair . Figure 3(a) shows why sensor agreement is insufficient: PCFM matches the observations yet leaves – inconsistency, while full-gradient guidance reduces the PDE discrepancy but misses the observation condition. Across 1,024 samples with 64 sensors, MAFM is feasible and lowers the best feasible PDE RelL2 from 5.55% to 1.70% (Table 1a). Terminal projection reaches zero observation error but has 22.7% PDE RelL2. This pattern is consistent with input guidance carrying observation information to unobserved coordinates while normal correction enforces the sensor constraints. With 256 sensors, MAFM gives the lowest feasible PDE error (2.25%; Appendix § 14).
Figure 3. Representative Poisson and fixed-energy controlled-NS outputs under shared conditions.
Conservation with dynamical consistency
Burgers fixes the spatial mean throughout 65 frames, and reaction–diffusion fixes total two-species mass. Neither condition determines how the field evolves. We evaluate physical consistency by computing the relative error against an independent PDE rollout initialized from each generated trajectory’s initial field. Table 1b shows that terminal projection meets the mass condition yet yields own-IC errors of 27.0% and 10.4%. MAFM attains numerical feasibility with own-IC errors of 0.965% and 2.74%, respectively, compared with the next feasible errors of 1.03% and 2.96%.
The row is operator-equivalent to PCFM-Base on Poisson; it uses the fixed ECI-2 configuration on Burgers and the registered ECI configuration on reaction–diffusion. All evaluated variants appear in the appendix.
Energy-conditioned prior recovery
The Euler and controlled-NS samplers receive only a kinetic-energy target; divergence, spatial mean, and time evolution are not supplied as conditions. We assess them separately to ask whether the samples still resemble the physical flows learned from data. For each case, we use 512 paired sources and set the framewise kinetic-energy target to the training energy. In the full comparison (Table 1c), MAFM has the lowest own-IC, divergence, and mean errors among distinct energy-feasible methods on both systems. Own-IC error falls from 3.62% to 2.94% on Euler and from 3.40% to 2.76% on controlled NS relative to the strongest feasible alternatives. Figure 3(b) shows one controlled-NS sample per method: generated and own-IC vorticity, their absolute difference, and the energy residual over time. The velocity relative and mean energy error values shown in the panels summarize the full held-out set.
The figure exposes two distinct failure modes. PCFM-Base nearly eliminates energy error, but its sampled flow departs from its own-IC rollout. Full-gradient guidance produces a closer rollout but misses the energy band. MAFM keeps the energy residual within that band while preserving a closer rollout. In this setting, the one-mix ECI update is equivalent to PCFM-Base.
Shifted energy targets. We test Euler and controlled NS at 0.8 and 1.2 times the training energy. MAFM exceeds the energy tolerance before projection. With the shared terminal projection, it meets the tolerance and achieves the lowest relative error among feasible methods in all four settings (Appendix § 14.8).
Core-mechanism ablations
Table 2 compares targeted changes to frozen models with matched sources, conditions, NFE = 100, and the main feasibility criteria; no variant is retrained or tuned. Dashes mark task–variant pairs that were not evaluated. Setting removes the input adjoint, and setting removes endpoint tracking. Both ablations retain normal attraction. All three Poisson variants meet the observation tolerance with the same CE (). The PDE relative error rises from 1.70% to 29.0% without endpoint tracking and to 38.0% without the input adjoint. The latter result is consistent with the role of adjoint guidance in joint – consistency in Corollary 4. Removing support tracking remains feasible yet increases own-IC error from 0.965% to 2.70% on Burgers and from 2.74% to 10.6% on reaction–diffusion. Resetting the anchor degrades both feasibility and dynamics, while removing normal correction makes both systems infeasible.
| Variant | PDE Rel↓ | Feas. | CE↓ | IC Rel↓ | Feas. | CE↓ | IC Rel↓ | ||||
| Full MAFM | 1.70% | Yes | 0.965% | Yes | 2.74% | ||||||
| w/o adjoint | 38.0% | — | — | ||||||||
| Reset anchor | — | No | 9.44% | No | 6.14% | ||||||
| w/o support | 29.0% | Yes | 2.70% | Yes | 10.6% | ||||||
| w/o normal | — | No | 0.270 | 1.29% | No | 2.19% |
Table 2. Core-mechanism ablations.
What the anchor history contributes. For the affine mass constraint, the tangential update blends the previous anchor with the latest endpoint prediction, carrying information from earlier predictions into later steps. To test the contribution of this history on Burgers, we replace the anchor’s tangential component at every step with that of the latest prediction and keep the normal update fixed. The paired per-step mass residuals differ by at most , while the relative rollout error rises from 0.965% to 7.68%. At comparable mass feasibility, this result shows that retaining tangential history helps preserve the Burgers trajectory dynamics. Appendices A.5 and D.6 give the recurrence and the full experimental protocol.
Conclusion
We study inference-time sampling from the intersection of a learned data support and an equality constraint supplied only at generation time. MAFM addresses this problem through the continuous evolution of a persistent physical anchor driven by a frozen endpoint model. Successive endpoint predictions are incorporated through finite-rate tracking, while a geometric correction separates model-guided tangent motion from normal constraint attraction. Under full-rank Jacobians and exact unregularized multiplier solves, the resulting dynamics yield a prescribed residual-contraction law, while the persistent-anchor relaxation admits a local feedback-stabilization analysis.
Across six benchmarks, MAFM achieves numerical feasibility while maintaining strong consistency with the physical structure learned by the frozen model. The ablations further support the complementary roles of persistent tracking, tangent guidance, and normal correction. While MAFM provides explicit control over constraint-residual dynamics, specifying and matching a particular probability law on the feasible intersection remains a separate problem. Extending the framework toward distributionally controlled constrained sampling and broader physical regimes is an important direction for future work.
Reproducibility Statement
The main paper provides the target definition, assumptions, sampler equations, pseudocode, and key experimental results, while Appendix A presents the theoretical derivations and proofs. Appendix C describes the experimental protocols, including physical tensors, constraints, and evaluation metrics. Appendix D provides the complete result tables and projection audits. We also record code and input hashes, logs, checkpoints, generated samples, and evaluation outputs, and clearly distinguish the single training seed from the number of generated samples. Negative or mixed outcomes are reported alongside improvements. Together, these materials provide the information and implementation needed for independent verification and reproduction of our reported results.
Ethics Statement
The work uses procedurally generated geometric and physical data and involves no personal data or human participants. A relevant downstream risk is treating a small declared residual as certification that a sample follows the correct physical distribution or governing dynamics. We therefore evaluate these properties separately and recommend independent verification for scientific or safety-critical use.
AI Use Statement
Generative AI tools assisted with language editing, translation, manuscript organization, LaTeX assembly, implementation of supplementary comparison scripts, and interpretation of archived results. The authors take responsibility for the final manuscript and its scientific claims.
Data, Conflicts, and Funding
All experiments use synthetic data described in the paper and appendix. The authors declare no competing interests and no external funding that creates a conflict of interest.
Proofs and derivations
Target-measure geometry
The main text specifies the support of through . A distributional target requires an additional choice of weights on that intersection. For a measurable set , one such choice is when . For a zero-probability constraint event, fix the residual norm and normalization and, when the denominator is positive and the weak limit exists, define the tubular conditional law
Suppose is a smooth -dimensional manifold with , has full row rank near , and has density with respect to . Subject to the regularity and integrability conditions for the normalized limit, the coarea formula gives
where is the Jacobian of in an orthonormal tangent basis of . The tube law depends on the chosen residual units and norm; reparameterizing the same zero set may change its limiting weights.
Let be the terminal law of the ideal anchor dynamics and a numerical output. When these laws and have finite second moments, the Wasserstein triangle inequality gives
The first term can reflect model and numerical errors; separating it further requires assumptions linking their coupled effects. The second term is the structural difference between ideal anchor dynamics and the additionally specified target law.
Endpoint estimation and query-region conditions
Conditional mean and regression error. For the linear bridge in Eq. (3), the population flow field is . The pointwise identity implies, after conditioning on ,
The conditional expectation is also the -optimal endpoint predictor. For finite second moments, its orthogonality decomposition is
The second term quantifies uncertainty about a paired endpoint even for an optimal predictor. Under an independent coupling at , , which can fall between data modes.
Endpoint extrapolation and ODE integration. Let solve the frozen Vanilla ODE from . Its terminal state and the endpoint extrapolation are
If the velocity along this trajectory is differentiable with for , then
This local extrapolation bound depends on the stated trajectory regularity. PCFM also uses endpoint extrapolation [30]; the persistent MAFM anchor incorporates successive predictions across changing queries.
Parameterization and source law. For , a directly trained endpoint predictor induces the velocity . The two parameterizations have corresponding population optima under the linear path, while their cross-time finite-model losses carry different weights. The conditional-mean identity requires finite moments and the linear path, rather than a standard-Gaussian source. More general flow matching permits other source laws [29]. MAFM draws from the source distribution used to train the frozen Vanilla model; task-specific Gaussian covariances are recorded with their training and sampling protocols.
Query region. For a fixed , let contain the compared anchor paths and define . The stability result uses endpoint and adjoint error bounds on this common query region. These are local model assumptions: endpoint regression on the training path alone does not supply uniform error or Jacobian bounds over every later query.
Lagrange-multiplier correction
At a fixed anchor and time, write and , and let be the candidate in Eq. (11). The base specialization sets . Under full row rank, the exact unregularized velocity is the unique solution of
For the Lagrangian , stationarity gives . Substituting into the constraint gives , which yields the main-text multiplier system in Eq. (12). The correction lies in and retains the tangent component of the candidate velocity.
For , the regularized system instead minimizes
Stationarity is . Setting gives and . Regularization therefore implements a quadratic penalty on the prescribed residual rate.
Base-specialization endpoint filtering. Let denote the exact unregularized base-MAFM velocity using endpoint field . At the same anchor, source, and time,
For the pointwise perturbation in Eq. (27), the two velocities share , , , and hence , , and . Subtracting their base-specialization forms in Eq. (14) leaves . In particular, errors in have no instantaneous effect on the velocity. With regularization , is replaced by : normal errors are attenuated rather than eliminated. Its tangent eigenvalues are one and its normal eigenvalues are , so .
Projected-adjoint effect and sparse observations
Proof of Proposition 2. At the fixed anchor and time in the proposition, write , , and . The candidate velocities with and without the adjoint satisfy
(14) gives and the same expression with for . Subtracting cancels the normal attraction term and yields . Since , this difference induces no first-order residual change. Moreover, is the orthogonal projector onto , with . For and , the velocity difference therefore vanishes exactly when .
Corollary 4 (Sparse-observation pullback). After reordering coordinates, let with , partition the physical query as . Write . Then
Thus the adjoint can affect unobserved coordinates through the sensitivity of the predicted observed endpoint to those coordinates.
Proof. Here and . The input adjoint is . Partitioning this gradient into its and blocks and applying gives Eq. (29).
For the Poisson state , in this corollary contains both unobserved coordinates and the forcing field . A nonzero provides a model-mediated route from an observed- residual to a tangent update of . The ablation in § 5.5 is consistent with this mechanism; the identity alone does not guarantee improved joint consistency.
Scope and diagnostics. At a common anchor, let , , and . For an exact regularized multiplier solve with , the same fixed-state comparison gives
Thus regularization does not fully remove the adjoint’s normal component. For a finite step with nonlinear , curvature can also make the next-step residuals differ, as in Eq. (17).
The per-unit- instantaneous speed is . A relative diagnostic, when the base tracking speed is appreciable, is
The denominator uses base tracking rather than the guided . Neither score establishes that guidance is beneficial. In the discrete sampler, the realized tangent displacement also includes ; this quantity should be logged when assessing adjoint activity.
History weights for affine constraints
For with full-row-rank , the constant tangent projector satisfies . Applying it to Algorithm 1 removes the multiplier correction. For the base specialization , an exact unregularized update gives
The tangential identity holds for any multiplier values, including regularized or inexact solves. For the normal identity, the exact unregularized solve gives ; affinity then gives the stated recurrence. Writing and , repeated substitution gives
Empty products equal one. For , all weights are nonnegative and sum to one. The initial-state weight is . This makes the role of the attraction schedule explicit: it determines how much past information remains in the tangential anchor. The endpoint estimates themselves depend on evolving queries. Active adjoint guidance adds to the tangent recurrence, with as in Algorithm 1; the normal recurrence remains the one in Eq. (32).
Relation to relaxed endpoint projection. For an affine equality, let denote the orthogonal projection of the current endpoint prediction. A damped projection moves the prediction partway toward , giving with . Its residual is , and its tangential component is . The damping controls how much of the current prediction’s residual is removed.
A relaxed iteration on the anchor blends the previous anchor with the projected prediction, . Since and , this gives
Here the same weight controls how much new tangential information enters the anchor and how much of its residual is removed. In the exact, unregularized MAFM step with in Eq. (32), these fractions are and and can be set independently. For instance, and retain part of the previous tangential anchor while removing the full affine residual in that step.
The affine recurrence also makes the PCFM connection in the main text explicit. If , , and with an exact, unregularized solve, the next anchor has tangential component and satisfies . Thus , where . This is the orthogonal endpoint projection for an affine equality. Interpolation with the same fixed source then gives the corresponding PCFM query update.
Proof of Proposition 1
By the chain rule and Eq. (13),
With and the exact multiplier solution, . Substitution yields . Solving this linear vector ODE gives Eq. (15).
For , use and to obtain
If the numerical multiplier leaves algebraic residual , then adds a further forcing term to the dynamics.
Base-specialization local feedback stability
To isolate anchor memory, fix a source , time , and affine constraint . Write , with and , and define . Direct replacement uses , while the relaxed persistent anchor uses .
Proposition 5 (Local feedback stabilization). Suppose is continuously differentiable near a fixed point , and let . For , the relaxed update has linearization , with eigenvalues
The fixed point is locally asymptotically stable if . In particular, a real mode is damped when .
Proof. Fix , , and the feasible affine slice as in the proposition. For , orthogonal projection of an endpoint onto is . Thus its tangential direct-replacement map is , and the frozen-time MAFM map is . For , if and only if . Differentiating at gives . When the endpoint estimator is differentiable at the associated query , . The spectral mapping identity for this affine polynomial in gives Eq. (37).
If every eigenvalue of has modulus less than one, there is an equivalent norm on whose induced matrix norm satisfies . Continuity of then makes a contraction in a sufficiently small ball around in this norm. Its iterates converge to from this ball, proving local asymptotic stability. The spectral condition does not require a symmetric ; for nonnormal matrices it need not imply contraction at every step in the Euclidean norm.
For a possibly complex eigenvalue ,
Hence a mode is strictly damped exactly when and , subject also to for the relaxed update considered here. This must hold for every mode to obtain the proposition’s stability result. For real the condition reduces to , whereas direct replacement has amplification factor and is unstable in that direction. For , the relaxed factor lies between and one, so relaxation slows convergence in this mode. Real remains unstable for every .
The scalar example , illustrates this spectral mechanism. The proposition concerns a fixed-time local map; the sampler uses a changing time and query, for which a uniform stability analysis would require additional bounds on the sequence of linearizations.
Finite-step residual control and accumulated error
Proof of Proposition 3. For , the fundamental theorem of calculus gives , where
The exact unregularized solve gives , proving Eq. (17). For an affine constraint the Jacobian is constant, so . The factor has magnitude less than one precisely when , and is nonnegative when .
For a full-row-rank affine constraint , exact unregularized normal correction can also be written as a split step:
Since , this step has the exact affine residual law
The explicit Euler update in Algorithm 1 uses . With frozen , the alternatives and give exponential residual decay and one-step affine feasibility, respectively. The split form also applies when .
For a regularized or inexact solve, let and define the algebraic residual . With , direct substitution gives
Here the inverse exists for , or for with full-row-rank . The two terms in separate regularization from linear-solve error. If the smallest eigenvalue of is , then
Set and , using a common Lipschitz bound over the step segments. Iteration yields
In particular, for constant , , , and , this becomes
Under these uniform bounds, the estimate quantifies both the contraction of the initial residual and the accumulated effects of curvature and numerical corrections for the explicit anchor step in Algorithm 1.
Endpoint stability on a common query region
Proposition 6 (Local model-perturbation bound).** Let use a reference endpoint field and its input adjoint , and let use and . Couple the paths through the same source, constraint, and schedules, with , exact multiplier solves, and full-row-rank along a common trajectory neighborhood. Suppose the anchor vector field has an integrable -Lipschitz bound there and, at a common state in , and , with finite error integrals. Then
Proof. Let denote the exact unregularized anchor vector field after inserting (6). At a common anchor,
because the orthogonal projector has norm at most one. Comparing the two paths and using the anchor-Lipschitz bound gives
Grönwall’s inequality gives (47). □
For exact unregularized solves, (27) also permits replacing in the trajectory bound by a uniform bound on over the same queried region. For , the adjoint-error term vanishes. If the query region extends beyond the training-path support, the reference field requires a specified extension with the assumed regularity. The optional target-law comparison in (20) addresses a separate question from this pathwise model-perturbation bound.
Additional algorithmic details
Optional adjoint-step clipping
The default in Algorithm 1 is the identity. For full-row-rank , an optional radius and norm define
Taking recovers the default. A finite radius bounds the projected adjoint displacement in ; the VJP is skipped when $\eta(t_k)t_k=0.
Poisson adjoint scaling
The main text uses the ordinary residual norm and input gradient. The reported partially observed Poisson sampler uses fixed channel scales from the training data. With observed entries and , its endpoint energy and physical guidance direction are
Its discrete adjoint step uses , with the reported per-step guidance coefficient corresponding to in the split update of Eq. (40). The channel factors adjust the relative and motion; they are part of this numerical specialization, not needed for the core dynamics. The multiplier still enforces the unscaled observation equation . The projected-adjoint identity remains valid with substituted for . The Poisson clipping norm is the root mean square of componentwise , where equals or by channel; its radius is the configured trust factor times the norm of the tangent tracking displacement .
How the anchor correction reaches the next query
In Figure 2, the frozen endpoint model takes the current query and predicts . The sampler keeps across steps as its current candidate for the physical endpoint. The multiplier acts on this anchor. For a full-row-rank constraint Jacobian at the anchor and an exact unregularized solve, its velocity correction is , where . The input VJP in Eq. (8) instead differentiates the loss of the predicted endpoint through the frozen model to build the candidate velocity.
Figure 2. One MAFM sampling step, illustrated with an affine constraint and an exact, unregularized solve. (A) Predict the physical endpoint. (B) Compute optional input guidance. (C) Combine it with endpoint tracking to form the candidate velocity. (D) The anchor update retains the candidate’s tangential component and replaces its normal component to shrink the anchor residual. (E) The fixed source and updated anchor give the next model query . At , the query equals the final anchor.
For an affine constraint, the tangential update preserves the current constraint value and the normal update contracts its residual. For example, if a Burgers frame has mean 0.8 and the target is 0.9, a normal step that halves the residual moves the mean to 0.85. The tangential update can use the new endpoint prediction to change the waveform while preserving the frame mean. At fixed and , an anchor displacement changes the next query by . Intermediate queries can therefore remain outside the feasible set. At the query is the final anchor and has the same constraint residual.
Experimental protocols
This section specifies the physical data, equality conditions, and evaluation for the six examples in § 5. In every case, the unconditional model and each constrained sampler act on the same complete physical object. The numerical PDE solvers generate reference data and measure physical consistency; they do not supply an unobserved field to the sampler. Table 3 separates structure learned from training data from information explicitly supplied at inference. Here denotes physical time, while denotes the flow or sampling time. The notation means the spatial average, evaluated as the corresponding grid average, and denotes the Burgers spatial coordinate. The Euler and controlled-NS entries describe their fixed-energy, energy-only tests.
Shared comparison and metrics. Methods within a case use the same frozen unconditional model, paired Gaussian sources, prescribed conditions, and nominal number of function evaluations (NFE). A constraint error (CE) measures the residual of the condition supplied at sampling. It is distinct from a physical-consistency error: for PDE trajectories, we evolve each generated initial state with an independent numerical solver and compare its later frames with the generated trajectory (own-IC relative ); for Poisson, we solve from the generated and compare with the generated . Distributional and paired-truth diagnostics are reported separately. The Poisson protocol requires both mean and q99 observation CE below . For concise comparisons, we mark mass CE below and fixed-energy error below as numerically feasible; these two bands are reporting conventions. The sphere’s plane tolerance belongs only to its joint-support diagnostic, not to a universal feasibility rule. Once a method reaches the applicable numerical band, the physical and distributional metrics distinguish its samples.
Sphere–plane intersection
The training law and the inference-time plane condition are
We draw a standard Gaussian vector and normalize it to unit length, then train an unconditional velocity MLP on full Cartesian three-vectors with a Gaussian source and linear flow-matching bridge. The width-192, depth-three MLP uses velocity MSE, batch size 512, and 100,000 optimizer updates for its frozen checkpoint. It receives no sphere equation or plane condition. At inference the only supplied condition is the plane equation above; its intersection with the learned support is the unit circle in that plane. There is no physical-time evolution or boundary condition in this algebraic example. The paired 10,000-sample comparison uses 100 NFE and independent uniform-circle references. We report plane residual, radial and angular distribution diagnostics, sliced Wasserstein distance (SWD), and joint support coverage over several tolerances. The radius is an evaluation diagnostic, not an additional constraint given to the sampler.
Partially observed Poisson equation
On , the data satisfy
Each physical state is the joint pair on the interior grid (); boundary nodes are fixed rather than generated. To draw , independent grid Gaussian noise is smoothed by a reflected Gaussian kernel of width three grid cells, scaled to spatial RMS about 20, and given an independent Gaussian constant offset with standard deviation 5. A float64 five-point Dirichlet solve supplies . The joint physical-field network predicts both channels and minimizes a channel-scaled full-field endpoint MSE. It uses 8,192 training and 1,024 validation pairs; the width-32, depth-three joint U-Net trains with batch size 32. The final 40,000-update AdamW run selects its checkpoint by validation loss. Fixed channel scales balance the two physical units and do not change the generated state space.
At inference, the supplied observation equation is
which selects either 64 or 256 distinct interior values; is never observed. Two fixed sensor layouts are evaluated for each count, with 64 independently generated conditions and eight paired draws per condition, at 100 NFE. The held-out pair is used only to form observations and evaluation targets. Observation CE is normalized by the truth- RMS; PDE consistency is , where is the same discrete boundary-value solver. Errors against the unobserved and are supplementary paired-truth diagnostics, not conditional-distribution distances. The Poisson-specific adjoint scaling and tangent-step radius are defined in Appendix B.2.
Periodic viscous Burgers equation
We solve
on with periodic boundary conditions, recording 65 frames over on 512 grid points. Each initial field is : , , and is a zero-mean, unit-RMS smooth periodic Gaussian field built from sine and cosine frequencies 1–8 with amplitude proportional to . A float64 Cole–Hopf solve generates the physical trajectories. Its Fourier calculations are numerical solver operations; the jointly trained endpoint network sees complete trajectories. Training uses 4,096 trajectories and 512 validation trajectories. A joint circular-convolution U-Net mixes all frames as channels and uses a full-trajectory endpoint MSE with batch size 32. The reported model is the selected 52,000-update checkpoint after the registered time-allocation continuation.
The inference condition prescribes the spatial mean of every generated frame. Held-out tests use , with 256 independent sources at each value and 100 NFE. For each raw generated initial field, an independent Burgers solve produces the own-IC future reference. We compare the remaining 64 frames by relative ; mean-subtracted fluctuation error and distributional statistics check whether a low error merely reflects correct means. Mean CE is the framewise RMS deviation from , normalized by .
At each prescribed mean we independently generate 256 reference initial fields with that mean and solve Burgers. Field SWD compares the generated and reference full trajectories separately at each mean, using the same 64 fixed slicing directions. The aggregate is the average over the three means. This reference ensemble is separate from the solver rollout initialized from each generated sample.
Mass-conserving reaction–diffusion system
On with no-flux boundaries, the two concentrations obey
The opposite reaction signs and no-flux boundary conserve the spatial mean of . Initial states are positive: a smooth random total concentration is normalized to a mass drawn uniformly from , then split into the two species by a smooth random fraction with one to three reflected Gaussian bumps. A conservative cell-centered Neumann solver uses diffusion substeps and Runge–Kutta reaction steps to produce 33 frames over on a native grid. The joint endpoint U-Net learns complete trajectories from 4,096 training examples, with 512 validation examples and 60,000 optimizer updates. Its width is 48, its batch size is eight, and full-field endpoint MSE trains both species and all frames together; validation loss selects the frozen checkpoint.
The sampler is told only the desired total mass at every frame. The held-out values are 2.15, 2.25, and 2.35, each with 128 paired sources at 100 NFE. CE is the framewise residual of the mean of : an independent rollout from each generated first frame gives own-IC relative over the remaining 32 frames. Species-wise errors, distributional distances, and the fraction of negative generated concentrations are supplementary checks. Negative values are counted on the raw output rather than clipped.
Two-dimensional Euler flow
The data solve
on the periodic torus . Smooth random velocity fields combine randomly phased low-frequency patterns and smoothed noise; they are projected to zero-mean, divergence-free fields and normalized to the common kinetic-energy level before numerical rollout. The resulting training objects are nine complete two-component velocity frames on a grid over . A physical-field endpoint network learns their joint distribution using full-field MSE and an auxiliary full-field spectral error. It has width 48, four spectral blocks, and 12 modes per spatial direction; these features are internal computations, not generated states. Training has 4,096 histories, 1,024 validation histories, batch size 16, and 48,000 updates.
The energy-only inference test supplies the target kinetic energy at every frame; divergence-free and zero-mean structure must still come from the learned law. Guidance strengths for the original fixed-energy comparisons were selected on a disjoint 64-sample validation set. On 512 held-out paired sources, we measure energy error, divergence, spatial mean, field and feature distribution distances, and own-IC rollout error from each generated first frame. In Table 1(c), the forward budget is 100 per sample for most methods. Stop-gradient guidance uses 199, LDF uses 198, and D-Flow uses 4,100 including recomputation (Appendix § 14.11). Before the reference solve, the generated first frame is projected to a divergence-free, zero-mean field and normalized to the specified energy. The rollout error compares the reference with the unmodified generated future frames. For energy CE, we take the maximum relative energy deviation over frames for each sample and then average over samples. The separate joint-oracle comparison supplies divergence and zero mean as additional conditions and is reported in Table 9; it does not enter the energy-only ranking.
| Case | Method | Feature SWD | Field SWD | RelL2 | Div. | Mean | Energy |
| Euler | Vanilla FM | 0.152 | 0.0662 | 0.0368 | 0.0635 | 0.0131 | 0.0186 |
| Terminal projection | 0.152 | 0.0663 | 0.0332 | ||||
| PCFM-Base | 0.424 | 0.115 | 0.125 | ||||
| PCFM-Relaxed | 0.427 | 0.116 | 0.124 | 0.00766 | 0.00182 | ||
| ECI (operator-equivalent) | 0.424 | 0.115 | 0.125 | ||||
| Stop-grad. guidance | 0.427 | 0.0985 | 0.0429 | 0.0598 | 0.0161 | 0.0262 | |
| Full-grad. guidance | 0.184 | 0.0667 | 0.0341 | 0.0602 | 0.0106 | 0.0160 | |
| MAFM | 0.157 | 0.0676 | 0.0320 | ||||
| MAFM + projection | 0.157 | 0.0676 | 0.0320 | ||||
| NS | Vanilla FM | 0.0690 | 0.0495 | 0.0346 | 0.0624 | 0.0111 | 0.0181 |
| Terminal projection | 0.0634 | 0.0495 | 0.0309 | ||||
| PCFM-Base | 0.375 | 0.0943 | 0.112 | ||||
| PCFM-Relaxed | 0.387 | 0.0947 | 0.112 | 0.00707 | 0.00179 | ||
| ECI (operator-equivalent) | 0.375 | 0.0943 | 0.112 | ||||
| Stop-grad. guidance | 0.405 | 0.0797 | 0.0355 | 0.0486 | 0.00878 | 0.0201 | |
| Full-grad. guidance | 0.252 | 0.0622 | 0.0289 | 0.0504 | 0.00692 | 0.0173 | |
| MAFM | 0.0961 | 0.0506 | 0.0294 | ||||
| MAFM + projection | 0.0961 | 0.0506 | 0.0294 |
Table 9. Three-constraint oracle comparison for Euler and controlled NS (64 samples each).
Energy-controlled Navier–Stokes flow
The controlled system uses the same periodic domain, grid, nine-frame horizon, and initial-field family as Euler, with
Here is the divergence-free, zero-mean Leray projection; the feedback offsets instantaneous energy change. The solver constructs complete Cartesian velocity histories, and the same physical-field architecture and training sizes as Euler learn them jointly. At inference, only framewise energy is imposed. The fixed-energy 512-sample held-out comparison uses the same forward budgets and constraint, distributional, and own-IC diagnostics as Euler. The controlled-NS reference additionally bandlimits the initial field. The original fixed-energy tests use the training energy; Appendix § 14.8 reports the separate shifted-target controls.
Supplementary results and diagnostics
The tables below give the extended metrics behind the compact main-text comparison. They include the 256-sensor Poisson setting, matched-model ablations, and the separate three-constraint flow comparison. The subsequent diagnostics and sample panels clarify particular behaviors without changing the evaluation conditions in Appendix § 13.
Main-figure visualization protocol. In Figure 3(a), circles mark the shared observed sites; the columns show generated fields, sensor mismatch, and . The numerical solver is used only for evaluation, and no hidden paired field is supplied as a visual target. The illustrated PCFM row uses PCFM-Relaxed in the Poisson panel and PCFM-Base in the controlled-NS panel, the registered variants for those tasks. Fields and residual maps show individual samples; the tables report full evaluation sets.
Extended metric tables
Table 4’s plane indicator uses the tolerance inside Joint coverage. In Table 5, CE is the mean observation residual and PDE is the relative discrepancy between the generated and the numerical solution from its generated ; two fixed sensor layouts contribute to each density. In the Burgers table CE is the mean-trajectory mass residual. Burgers and reaction–diffusion relative entries are percentages, including their fluctuation and q95 columns.
| Method | mean | q99 | Radial | SWD | MMD | Joint |
| Vanilla FM | 0.5009 | 0.2877 | 0.2158 | 0.1281 | 0.05516 | 0.06% |
| Terminal projection | 0 | 0 | 0.2158 | 0.1078 | 0.03237 | 6.47% |
| PCFM-Base | 0 | 0 | 0.006273 | 0.009357 | 0.000559 | 56.57% |
| PCFM-Relaxed | 0.006328 | 0.009551 | 0.000562 | 56.08% | ||
| ECI (operator-equivalent) | 0 | 0 | 0.006273 | 0.009357 | 0.000559 | 56.57% |
| Stop-grad. guidance | 0 | 0 | 0.006310 | 0.01885 | 0.000768 | 57.35% |
| Full-grad. guidance | 0.003888 | 0.02417 | 0.000930 | 70.52% | ||
| MAFM | 0.004929 | 0.009568 | 0.000534 | 72.97% | ||
| MAFM + projection | 0 | 0 | 0.004929 | 0.009568 | 0.000534 | 72.97% |
Table 4. Complete sphere–plane results (10,000 samples).
| Method | 64 sensors | 64 sensors | 64 sensors | 256 sensors | 256 sensors | 256 sensors |
| Method | CE | PDE RelL2 | CE | PDE RelL2 | ||
| Vanilla FM | 1.395 | 1.128% | 1.425 | 1.128% | ||
| Terminal projection | 0 | 22.73% | 0 | 46.31% | ||
| PCFM-Base | 0 | 11.51% | 0 | 18.05% | ||
| PCFM-Relaxed | 0 | 10.33% | 0 | 16.07% | ||
| ECI | 0 | 11.51% | 0 | 18.05% | ||
| ECI-2 | 0 | 11.50% | 0 | 18.14% | ||
| ECI-4 | 0 | 11.50% | 0 | 18.19% | ||
| Stop-grad. guidance | 5.554% | 5.636% | ||||
| Full-grad. guidance | 0.610 | 1.050% | 0.371 | 0.974% | ||
| MAFM | 1.705% | 2.252% | ||||
| MAFM + projection | 0 | 1.705% | 0 | 2.252% |
Table 5. Complete Poisson results at two sensor densities.
Table 6: Complete periodic Burgers results (768 independent samples). CE is the mean-trajectory mass error. RelL2 and fluctuation RelL2 are percentages. Relative std. error is the norm of the difference between the generated and reference pointwise standard-deviation fields, divided by the norm of the reference field.
| Method | RelL2 | CE | Fluct. RelL2 | Field SWD | Relative std. error |
| Vanilla FM | 1.134% | 3.163% | 0.2695 | 0.2323 | |
| Terminal projection | 26.97% | 74.48% | 0.07782 | 0.0883 | |
| PCFM-Base | 7.610% | 13.48% | 0.1776 | 0.5160 | |
| PCFM-Relaxed | 7.610% | 13.47% | 0.1777 | 0.5163 | |
| ECI (operator-equivalent) | 7.610% | 13.48% | 0.1776 | 0.5160 | |
| ECI-2 | 7.537% | 13.38% | 0.1766 | 0.5125 | |
| ECI-4 | 7.890% | 13.93% | 0.1834 | 0.5333 | |
| ECI-5 (resampled) | 2.708% | 6.965% | 0.06150 | 0.1347 | |
| Stop-grad. guidance | 1.030% | 16.80% | 0.2876 | 0.8484 | |
| Full-grad. guidance | 17.18% | 23.78% | 0.2901 | 0.8569 | |
| MAFM | 0.9648% | 4.828% | 0.1574 | 0.4556 | |
| MAFM + projection | 0.9648% | 4.828% | 0.1574 | 0.4556 |
Table 6.
| Method | Field SWD | RelL2 | CE | q95 RelL2 | Negative fraction |
| Vanilla FM | 0.09650 | 1.312% | 5.501e−2 | 5.201% | 4.48e−6 |
| Terminal projection | 0.08529 | 10.39% | 5.837e−8 | 41.51% | 8.75e−5 |
| PCFM-Base | 0.1303 | 3.030% | 5.894e−8 | 10.26% | 1.79e−3 |
| PCFM-Relaxed | 0.1157 | 2.458% | 3.720e−4 | 8.482% | 1.37e−3 |
| ECI | 0.1246 | 2.962% | 5.855e−8 | 10.18% | 1.78e−3 |
| Stop-grad. guidance | 0.1220 | 6.040% | 5.922e−8 | 23.45% | 1.53e−6 |
| Full-grad. guidance | 0.06375 | 1.563% | 1.695e−3 | 5.878% | 4.88e−6 |
| MAFM | 0.06659 | 2.740% | 1.134e−7 | 11.07% | 2.33e−4 |
| MAFM + projection | 0.06659 | 2.740% | 6.773e−8 | 11.07% | 2.33e−4 |
Table 7. Complete mass-conserving reaction–diffusion results (384 independent samples). RelL2 and q95 RelL2 are percentages.
The tables report values to at most four significant digits. Table 5 adds the 256-sensor comparison. Table 8 reports 10,000-resample paired intervals; Poisson resamples conditions while retaining layouts and draws, and the dynamical tasks resample sample IDs within each prescribed-mass stratum. Its column is ablation minus Full MAFM: Poisson uses PDE-consistency relative , while the dynamical cases use own-IC relative . Field SWD was not part of this Poisson ablation comparison.
| Task | Variant | CE | Physical RelL2 | Field SWD | Δ RelL2 | Paired 95% CI |
| Poisson | Full MAFM | 1.721e−7 | 0.01705 | – | – | – |
| w/o adjoint | 1.721e−7 | 0.3803 | – | 0.3632 | [0.3521, 0.3751] | |
| w/o support | 1.721e−7 | 0.2899 | – | 0.2728 | [0.2534, 0.2937] | |
| Burgers | Full MAFM | 4.216e−8 | 0.009648 | 0.1574 | – | – |
| Reset anchor | 0.008997 | 0.09437 | 0.1767 | 0.08473 | [0.07948, 0.09028] | |
| w/o support | 1.181e−7 | 0.02703 | 0.3135 | 0.01738 | [0.01652, 0.01828] | |
| w/o normal | 0.2698 | 0.01286 | 0.2750 | 0.003207 | [0.002873, 0.003559] | |
| Reaction–diffusion | Full MAFM | 1.134e−7 | 0.02740 | 0.06659 | – | – |
| Reset anchor | 0.04413 | 0.06145 | 0.2110 | 0.03405 | [0.02654, 0.04189] | |
| w/o support | 1.147e−7 | 0.1058 | 0.2102 | 0.07839 | [0.07624, 0.08044] | |
| w/o normal | 0.03186 | 0.02190 | 0.09998 | −0.005500 | [−0.007283, −0.003750] |
Table 8. Core-ablation aggregates with paired confidence intervals.
Three-constraint oracle comparison
Table 1(c) reports the 512-sample energy-only comparison, including D-Flow and PnP-Flow. Their protocols and extended results are in Appendix § 14.11. The corresponding joint-oracle comparison below supplies energy, divergence, and zero mean simultaneously. It records projection behavior and the effect of additional analytic information.
Additional diagnostics
Matched ablations. The variants in Table 8 share each case’s frozen checkpoint, paired sources, conditions, and 100 NFE. Each own-IC reference is solved from the initial condition produced by that variant. This isolates the inference mechanism from changes in model training or reference selection.
Terminal projection. An optional final projection sharpens numerical feasibility without explaining the consistency advantage: sphere SWD and the Burgers and reaction–diffusion own-IC errors barely change. In the 512-sample flow tests, mean energy error falls from about to about for both Euler and controlled NS, while own-IC error and field SWD are effectively unchanged.
Sphere threshold sensitivity. Figure 4 compares radial , mean plane residual, and field SWD on separate axes. Full-gradient guidance attains a smaller radial than MAFM and a higher field SWD. Terminal projection reduces MAFM’s mean plane residual to zero, with the same reported radial and field SWD. MAFM has the highest joint coverage at the strict 0.0025 and 0.005 support tolerances; conclusions at looser thresholds are reported as sensitivity analysis rather than universal support claims.
Figure 4. Sphere–plane diagnostics. Each column has its own scale. Lower values are better on all three metrics.
Burgers uncertainty. The independent-sample bootstrap preserves MAFM’s advantage in own-IC rollout error. The analysis also exposes a remaining failure mode: generated fluctuation amplitude is slightly contracted even when the mean trajectory is exact.
Reaction–diffusion nonnegativity. Nonnegativity is not supplied to any sampler. MAFM’s negative-value fraction is : better than PCFM variants but worse than Vanilla and stop-gradient guidance. This auxiliary diagnostic does not reverse the primary ranking and remains a target for future work.
PCFM normalization. Changing the relaxed-PCFM normalization can improve selected distribution distances, but the same changes can worsen feasibility and own-IC rollout error. The paper therefore reports the official (6) arm and labels operator-equivalent duplicates instead of counting them as independent evidence.
Inference-time computational cost
Reusing the initial endpoint prediction gives model forward calls for steps in Algorithm 1. Each step that uses input adjoint guidance adds one vector–Jacobian product (VJP). Storing the anchor and interpolating it with the fixed source cost memory and work, respectively.
We focus on , with scalar constraints and physical dimension . The MAFM multiplier solve uses the Jacobian at the anchor and the right-hand side in Eq. (12). The Gauss–Newton projection in PCFM ([30]) uses the Jacobian and residual at the predicted endpoint. Given the Jacobian, each dense correction takes to form the Gram matrix and to factor and solve the system. A gridwise PDE constraint can make comparable to , bringing the generic dense cost to . The cost of obtaining the Jacobian is separate. Sensor selection in Poisson gives a diagonal Gram matrix. The mass and energy experiments instead use framewise mean and radial corrections, respectively. In the main tests, we impose the task-specific constraints and evaluate PDE consistency with an independent solver.
All samplers in a given case reuse the same frozen physical-field model, so the comparisons below concern inference rather than repeated model training. Table 10 transcribes recorded remote sampling times for two representative tasks: one fixed 64-sensor Poisson layout with 64 conditions and eight draws per condition, and the 384-sample reaction–diffusion test over three prescribed masses. The timers cover sample generation and transfer to host memory, but exclude independent PDE-reference solves and metric aggregation. Time units are stated per row because the two tasks use different physical states and batch protocols; their absolute times should not be compared across tasks.
| Case | Sampler | NFE | Input VJPs | Sampling time | CE | Physical RelL2 |
| Poisson (64 sensors) | Vanilla FM | 100 | 0 | 6.615 s/512 | 1.366 | 1.128% |
| Poisson (64 sensors) | PCFM-Relaxed | 100 | 0 | 15.77 s/512 | 0 | 10.26% |
| Poisson (64 sensors) | MAFM | 100 | 100 | 17.88 s/512 | 1.710% | |
| Reaction–diffusion | PCFM-Base | 100 | 0 | 0.04249 s/sample | 3.030% | |
| Reaction–diffusion | ECI | 100 | 0 | 0.04361 s/sample | 2.962% | |
| Reaction–diffusion | MAFM | 100 | 0 | 0.04375 s/sample | 2.740% | |
| Reaction–diffusion | Full-grad. guidance | 100 | 100 | 0.08584 s/sample | 1.563% |
Table 10. Recorded inference cost and physical consistency for two frozen-model evaluations. Poisson values use one fixed 64-sensor layout (512 samples); reaction–diffusion values cover 384 samples. CE is the supplied-constraint error. Lower physical RelL2 is preferable among numerically feasible methods.
The recorded Poisson implementation executes 100 input VJPs, including the first call where the guidance coefficient is zero. MAFM uses 100 forward calls and takes 17.88 seconds for the 512 outputs, compared with 15.77 seconds for PCFM-Relaxed. Both satisfy the observation tolerance, while MAFM reduces PDE RelL2 from 10.26% to 1.710%. The unguided Vanilla sampler is faster, but its observation CE is far outside the feasible band.
Paired Poisson timing. In a separate ablation on two 64-sensor layouts, both variants use the same frozen model and paired inputs, with 512 samples per layout. With the input adjoint off, MAFM uses 100 forward calls and zero input VJPs and takes 5.23 s per layout on average. With it on, MAFM uses 100 forward calls and 100 input VJPs and takes 14.04 s. The timing difference includes the full input-adjoint update.
On reaction–diffusion, base MAFM needs no input VJP and takes 0.04375 seconds per sample, close to ECI’s 0.04361 and PCFM-Base’s 0.04249, while reducing feasible own-IC RelL2 to 2.740% from 2.962% and 3.030%, respectively.
These two evaluations show that MAFM can improve feasible physical consistency with limited additional sampling time relative to constrained baselines. The gain is especially pronounced on Poisson, where the adjoint also increases cost. The records do not establish a uniform runtime or memory advantage across all six tasks.
In a separate energy-only archive with 512 samples per case on an RTX 4090, base MAFM took 7.25 and 7.28 seconds on Euler and controlled NS. PCFM-Base took 6.72 and 6.73 seconds, respectively. Both samplers use 100 forward calls and no input VJPs in these tests. PCFM projects each predicted endpoint radially, while MAFM tracks the endpoint tangentially and contracts the radial deviation of the persistent anchor. The recorded times cover that batch and exclude PDE-reference evaluation.
Field SWD and matched CCFM comparisons
Field SWD. We flatten each full trajectory in the generated and reference ensembles and project both onto the same fixed directions. For direction , let and be the sorted projections of the generated and reference fields. For equal ensemble sizes and directions, the reported distance is
This diagnostic measures agreement with the chosen reference ensemble along the evaluated directions. It is defined even when the reference law is singular. The constraint specifies the feasible set and the reference sampling protocol specifies how to sample on it. For Burgers and reaction–diffusion (Table 13), the reference trajectories are generated independently at each prescribed mass (Appendices § 13.§ 3 and § 13.§ 5). For fixed-energy Euler and controlled NS (Table 14), we use held-out trajectories at the training energy. Own-IC relative uses a separate solver reference for each generated trajectory.
| Method | Burgers | Reaction–diffusion |
| Vanilla FM | 0.270 | 0.0965 |
| FM + projection | 0.0778 | 0.0853 |
| PCFM-Base | 0.178 | 0.130 |
| PCFM-Relaxed | 0.178 | 0.116 |
| ECI{sup}* | 0.177 | 0.125 |
| Stop-grad. | 0.288 | 0.122 |
| Full-grad. (DPDE) | 0.290 | 0.0637 |
| MAFM | 0.157 | 0.0666 |
| MAFM + projection | 0.157 | 0.0666 |
Table 13. Field SWD for the conservation rows in Table 1b.
| Method | Euler | Controlled NS |
| Vanilla FM | 0.0662 | 0.0495 |
| Terminal projection | 0.0662 | 0.0495 |
| PCFM-Base | 0.114 | 0.0945 |
| PCFM-Relaxed | 0.115 | 0.0948 |
| ECI† | 0.114 | 0.0945 |
| Stop-grad. guidance | 0.118 | 0.0792 |
| Full-grad. (DPDE) | 0.0667 | 0.0630 |
| MAFM | 0.0712 | 0.0533 |
| MAFM + projection | 0.0712 | 0.0533 |
Table 14. Field SWD for the original submission’s fixed-energy comparisons.
Tables 13 and 14 retain the Field SWD values from the conservation and energy-only comparisons. On Burgers, resampled ECI has mean Field SWD 0.06150 and own-IC 2.708%, compared with 0.1574 and 0.965% for MAFM. The sphere–plane diagnostics in Appendix § 14 retain the distinct radial and full-field comparisons.
We adapt CCFM’s Gaussian projection to each frame’s mass equality by imposing two one-sided marginal chance constraints. At candidate time , the two schedules use for . With 512 independent standard Gaussian source entries per frame, we clamp the candidate frame mean to a band centered at , with half-width , where is the standard normal CDF. The band reduces to exact mass at . Each method uses the same frozen model and 768 paired sources (256 per mass) at 100 forward evaluations. This is a Burgers mass-equality adaptation of CCFM. Its published NS setup supplies an initial condition and a global conservation constraint.
| Mass | Sampler | CE | Own-IC (%) | Field SWD |
| 0.55 | CCFM () | 5.394 | 0.06016 | |
| CCFM () | 7.563 | 0.06381 | ||
| MAFM | 1.092 | 0.16484 | ||
| 0.90 | CCFM () | 3.365 | 0.05831 | |
| CCFM () | 4.848 | 0.05910 | ||
| MAFM | 0.829 | 0.14856 | ||
| 1.05 | CCFM () | 3.491 | 0.07068 | |
| CCFM () | 4.776 | 0.07377 | ||
| MAFM | 0.973 | 0.15871 | ||
| Mean | CCFM () | 4.083 | 0.06305 | |
| CCFM () | 5.729 | 0.06556 | ||
| MAFM | 0.965 | 0.15737 |
Table 11. Burgers CCFM comparison by target mass. Own-IC is relative in percent. The last three rows average the three prescribed masses.
Table 12 extends the comparison to the other PDE benchmarks using their original frozen models, paired sources and 100 forward calls. Reaction–diffusion uses the affine total-mass condition, and Poisson uses affine sensor selection. For Euler and controlled NS, we linearize the framewise energy equality at the predicted endpoint and use the variance along that affine constraint under the original Gaussian source. Each CCFM run applies an exact terminal projection for its supplied constraint. Table 1 reports the common schedule across tasks.
| Benchmark | ||||
| CE | Relative | CE | Relative | |
| Controlled NS | 4.05% | 3.48% | ||
| Euler | 4.20% | 3.68% | ||
| Burgers | 4.08% | 5.73% | ||
| Reaction–diffusion | 6.49% | 6.83% | ||
| Poisson (64 sensors) | 0 | 22.74% | 0 | 22.78% |
| Poisson (256 sensors) | 0 | 45.45% | 0 | 46.47% |
Table 12. CCFM schedule comparison across the PDE benchmarks. The relative errors use own-initial-condition rollouts for time-dependent PDEs and an independent solve from the generated source for Poisson.
Burgers tangential history control
The two arms share the frozen model, 768 paired sources, initial anchor, normal contraction and 100 forward calls. The intervention sets for the tangential update while retaining the affine normal update. The maximum difference between paired per-step mass residuals is . CE is with finite tracking and with full replacement. Own-IC is 0.965% and 7.68%, respectively, with a paired difference of 6.72 percentage points (95% interval [6.36, 7.08], from 10,000 paired bootstrap draws stratified by mass). Field SWD is 0.1574 and 0.1776. The original reset in Table 2 also changes feasibility. Setting in Eq. (32) sets the weight of the previous tangential anchor to zero at that step. In the reported affine implementation, both arms use the same exponential normal substep, which contracts the same initial mass residual by the same factor at each step. This accounts for the comparable mass enforcement in § 5.5.
PCFM projection and mixing controls
Each case uses the same 512 paired sources as Table 1c and the same frozen model. PCFM-Relaxed uses Eq. (6)-style refinement with 20 inner steps and penalty weight 1. The added terminal projection acts on the exact replayed trajectories. The two-mix controls use 50 steps and two forward calls per step. In the noise-refresh arm, the reinterpolation source is redrawn from the original prior every fifth call. Both mixing arms use the same energy-only terminal projection. The 95% paired intervals for refreshed minus fixed own-IC are [−0.25, 0.48] percentage points on Euler and [−0.20, 0.38] on controlled NS. The official PCFM operator equivalence check is limited to the Poisson sparse-selector setting, where the stepwise and whole-sampler tests gave zero maximum absolute difference.
The ECI row in Table 1(c) reuses the one-mix update equivalent to PCFM-Base in this setting. Terminal projection of vanilla starts from trajectories whose own-IC errors are already close to their post-projection values. PCFM corrects intermediate predictions, which also affect later model queries. The observed rollout gap persists under both mixing schedules and with comparable final energy errors. These controls do not separately identify the effects of per-step correction strength and projection schedule.
The constraint error in Appendix J of PCFM [30] is the norm of a prescribed residual, averaged over samples. The PCFM ensemble metrics compare generated and reference sets. Here own-IC relative compares each generated trajectory with an independent PDE rollout initialized from its own generated first frame, prepared as in Appendices § 13.§ 6 and § 13.6. A trajectory can therefore have small energy CE and a large rollout error.
The initial-frame RMS correction from the generated field to the solver input is 0.03755 and 0.03509 for PCFM-Base on Euler and controlled NS, versus 0.01103 and 0.01076 for terminal projection of vanilla. These are diagnostics of the generated first frame, and the own-IC comparison uses the unmodified future frames.
| Case | Sampler | Energy CE | Own-IC (%) | Divergence | Field SWD |
| Euler | PCFM-Relaxed replay | 13.56 | 0.2285 | 0.11503 | |
| + terminal projection | 13.56 | 0.2287 | 0.11506 | ||
| Two mix, fixed source | 13.41 | 0.2266 | 0.11407 | ||
| Two mix, refreshed source | 13.51 | 0.2303 | 0.09906 | ||
| Controlled NS | PCFM-Relaxed replay | 12.29 | 0.2123 | 0.09479 | |
| + terminal projection | 12.29 | 0.2124 | 0.09485 | ||
| Two mix, fixed source | 12.13 | 0.2086 | 0.09376 | ||
| Two mix, refreshed source | 12.21 | 0.2168 | 0.09892 |
Table 15. Fixed-energy control runs. Own-IC is relative in percent.
Shifted energy targets
We use 128 paired sources per case and target, the original frozen checkpoints, and the fixed training-energy baseline settings. We adjust independent held-out initial fields to each target and evolve them with the original solver for ensemble evaluation. Own-IC uses a separate solver rollout from each generated sample’s initial field prepared at the target energy. For PCFM-Relaxed and MAFM, Table 16 gives the same generated outputs before and after a shared framewise radial projection. On the shifted PCFM outputs, the radial solution agrees with the official Newton–Schur terminal solver to within in float64. The table evaluates the common float32 radial projection for both methods.
| 0.8× training energy | 1.2× training energy | |||||
| Method | Energy CE | IC RelL2 | Div. RMS | Energy CE | IC RelL2 | Div. RMS |
| Vanilla FM | 12.49% | 0.0621 | 9.93% | 0.0621 | ||
| Vanilla + projection | 4.01% | 0.0556 | 4.60% | 0.0682 | ||
| PCFM-Base / ECI-1 | 11.44% | 0.1810 | 19.79% | 0.3544 | ||
| PCFM-Relaxed (pre-proj.) | 11.75% | 0.1884 | 20.44% | 0.3642 | ||
| + terminal projection | 11.76% | 0.1885 | 20.44% | 0.3642 | ||
| ECI-2 (fixed source) | 11.33% | 0.1777 | 19.36% | 0.3460 | ||
| ECI-2 (refreshed source) | 11.84% | 0.1933 | 18.24% | 0.3333 | ||
| Stop-grad. (199 calls) | 5.82% | 0.0677 | 13.36% | 0.2080 | ||
| Stop-grad. (99 calls) | 5.33% | 0.0603 | 12.54% | 0.1904 | ||
| Full-gradient guidance | 12.01% | 0.0659 | 9.57% | 0.0596 | ||
| CCFM () | 4.70% | 0.0646 | 5.41% | 0.1102 | ||
| CCFM () | 4.01% | 0.0565 | 4.82% | 0.1027 | ||
| MAFM (pre-proj.) | 2.96% | 0.0400 | 3.60% | 0.0666 | ||
| + terminal projection | 2.96% | 0.0400 | 3.60% | 0.0666 | ||
| Controlled NS | 0.8× training energy | 1.2× training energy | ||||
| Method | Energy CE | IC RelL2 | Div. RMS | Energy CE | IC RelL2 | Div. RMS |
| Vanilla FM | 12.40% | 0.0622 | 9.86% | 0.0622 | ||
| Vanilla + projection | 3.92% | 0.0558 | 4.37% | 0.0683 | ||
| PCFM-Base / ECI-1 | 11.11% | 0.1872 | 12.61% | 0.2613 | ||
| PCFM-Relaxed (pre-proj.) | 11.37% | 0.1879 | 14.01% | 0.2923 | ||
| + terminal projection | 11.38% | 0.1881 | 13.98% | 0.2913 | ||
| ECI-2 (fixed source) | 11.04% | 0.1844 | 12.22% | 0.2530 | ||
| ECI-2 (refreshed source) | 11.20% | 0.1915 | 11.67% | 0.2479 | ||
| Stop-grad. (199 calls) | 8.59% | 0.0752 | 9.00% | 0.0799 | ||
| Stop-grad. (99 calls) | 8.39% | 0.0659 | 8.61% | 0.0575 | ||
| Full-gradient guidance | 9.09% | 0.1127 | 8.84% | 0.0562 | ||
| CCFM () | 4.56% | 0.0657 | 4.89% | 0.1072 | ||
| CCFM () | 3.99% | 0.0587 | 4.25% | 0.1017 | ||
| MAFM (pre-proj.) | 2.87% | 0.0399 | 3.45% | 0.0685 | ||
| + terminal projection | 2.87% | 0.0399 | 3.45% | 0.0685 |
Table 16. Full comparisons at shifted energy targets (128 paired samples per target). Energy feasibility uses mean CE . The two stop-gradient rows report their actual forward counts. All other rows use 100 forwards, including those that reuse a parent sampler and add a terminal projection.
For a compact comparison with one setting per baseline, we select the ECI and CCFM settings by their equally weighted mean relative errors across the four 0.8× and 1.2× system–target pairs in Table 16. For ECI, two mixes with source refresh give 13.23%, compared with 13.49% for two mixes with fixed source and 13.74% for one mix. For CCFM, gives 4.27% and gives 4.89%. Across the four settings, MAFM’s mean energy error ranges from to before projection and from to after the shared projection. The projected row has the lowest relative error among feasible methods in all four settings, as reported in § 5.4.
Doubled energy. Table 17 compares five methods at twice the training energy with 128 paired sources per system and 100 forward calls per sample. We retain the ECI and CCFM configurations selected at the two moderate shifts. With the shared terminal projection, MAFM meets the energy tolerance and has the lowest relative among the feasible methods shown. Its rollout errors increase to 9.85% on Euler and 10.01% on controlled NS. Doubling kinetic energy requires increasing the velocity norm by about 41%. The result is consistent with less accurate endpoint guidance under a larger shift, even though terminal projection still enforces the energy target.
| Method | Euler Energy | Euler CE | Euler Rel. | Euler Div. RMSE | Controlled NS Energy | Controlled NS CE | Controlled NS Rel. | Controlled NS Div. RMSE |
| PCFM-Relaxed + terminal projection | 37.92% | 0.805 | 25.20% | 0.745 | ||||
| ECI-2 (refreshed source) | 35.03% | 0.785 | 25.56% | 0.731 | ||||
| Full-gradient guidance | 30.72% | 0.061 | 30.53% | 0.066 | ||||
| CCFM () | 22.96% | 0.655 | 19.25% | 0.646 | ||||
| MAFM + terminal projection | 9.85% | 0.210 | 10.01% | 0.222 |
Table 17. Comparisons at twice the training energy, with 128 paired samples per system and 100 forward calls per sample. Bold marks the lowest CE and the lowest relative among methods meeting the energy tolerance (mean CE ).
Normal-contraction schedules
In the ideal dynamics, sets the cumulative log contraction of the constraint residual. The discrete normal budgets for sphere–plane, Poisson, Burgers and reaction–diffusion are , , 32 and , respectively. For Euler and controlled NS the budget is , applied to the framewise radius deviation during the radial substep after tangential tracking. With a constant budget over equal steps, the exponential normal substep multiplies the relevant residual or radius deviation by at each step. For Burgers, over 100 steps gives a per-step factor of . The rate sets how quickly feasibility is approached. Rapid attraction relative to tangential motion can require smaller steps in explicit integration.
Qualitative samples
These panels illustrate individual outputs from the six cases. The sphere panel checks recovery of the circular intersection from a supplied plane and a learned sphere prior; the radius was never imposed during sampling. The Poisson and panels show corresponding joint-field samples. The trajectory and vorticity panels show selected outputs rather than the full evaluation set, so quantitative conclusions follow from Figure 4, Table 4, and the threshold sensitivity in Figure 5.
Figure 5. Sphere–plane joint coverage at varying radial tolerances and fixed plane tolerance . The MAFM curves with and without terminal projection coincide at all reported tolerances.

Figure 8. Poisson source fields paired with Figure 7, with the same representative ECI column.

Figure 7. Poisson generated solution fields under partial observations. One representative ECI column is shown; the ECI-2 and ECI-4 variants remain in Table 5.

Figure 6. Sphere–plane samples.
Figure 9. Periodic Burgers samples.

Figure 10. Reaction–diffusion samples.
Figure 11. Euler vorticity samples at fixed energy.
Figure 12. Controlled-NS vorticity samples at fixed energy.
Additional inference-time baselines
Table 18 compares D-Flow [5], PnP-Flow [22], and Lagrangian Dual Flows (LDF) [19] with CCFM and MAFM on the same frozen checkpoints, paired test inputs, and prescribed constraints. The two energy tests use 512 samples each. Burgers and reaction–diffusion use 768 and 384 samples, respectively, with equal weight for each of three target masses. Each Poisson sensor density uses two layouts with 512 samples per layout.
The data-fidelity terms use the supplied mass or sensor equality, or the target per-frame velocity radius for the energy equality. D-Flow optimizes the source noise through the full 100-step generation ODE using L-BFGS with a 20-iteration budget and a learning rate of 0.1. It uses 4,100 model forward evaluations (including recomputation) and 2,000 input VJPs per sample. PnP-Flow alternates a data-fidelity step, interpolation with fresh prior noise, and a frozen endpoint prediction. Its fidelity step size is , with selected on a separate development set. It uses 100 forward evaluations and no input VJPs. We evaluate both methods’ raw outputs. LDF evolves the sample and equality multipliers with the explicit midpoint method at the authors’ default stepsize of 0.01. We read the last saved sample before after 198 forward evaluations, with terminal projection disabled. We select the residual weight on independent development inputs for each task. CCFM uses . CCFM and both MAFM rows use 100 forward evaluations. The projected MAFM row applies a terminal projection to the same samples as the preceding row.
On Euler and controlled NS, MAFM gives the lowest relative and divergence RMSE among the methods in this table. D-Flow or PnP-Flow give lower relative on some other tasks with larger constraint errors. Both miss the prescribed numerical feasibility thresholds in these comparisons. MAFM gives lower constraint and PDE errors than LDF across all six settings. Our full-gradient endpoint baseline tests the guidance operation shared by FunDPS [33] and DiffusionPDE [17], namely differentiating a loss on a denoised prediction back to the current state. DiffusionPDE also evaluates an explicit PDE residual in its guidance loss.
| Method | Euler Energy CE | Euler Rel. | Euler Div. RMSE | Controlled NS Energy CE | Controlled NS Rel. | Controlled NS Div. RMSE |
| CCFM () | 2.33e−7 | 3.68% | 0.06499 | 2.35e−7 | 3.48% | 0.06402 |
| D-Flow | 0.00751 | 3.54% | 0.06256 | 0.00748 | 3.27% | 0.05994 |
| PnP-Flow | 0.0581 | 11.33% | 0.20279 | 0.0554 | 10.25% | 0.18868 |
| LDF (198 NFE) | 5.85e−4 | 7.13% | 0.16506 | 5.35e−4 | 5.86% | 0.15182 |
| MAFM | 6.84e−6 | 2.94% | 0.04829 | 6.89e−6 | 2.76% | 0.04736 |
| MAFM + terminal projection | 2.37e−7 | 2.94% | 0.04829 | 2.43e−7 | 2.76% | 0.04736 |
| Method | Burgers Mass CE | Burgers Rel. | Reaction–diffusion Mass CE | Reaction–diffusion Rel. | Poisson (64) Obs. CE | Poisson (64) Rel. | Poisson (256) Obs. CE | Poisson (256) Rel. |
| CCFM () | 5.39e−8 | 5.73% | 5.96e−8 | 6.83% | 0 | 22.78% | 0 | 46.47% |
| D-Flow | 0.995 | 39.01% | 0.0317 | 3.45% | 0.555 | 1.03% | 0.567 | 1.04% |
| PnP-Flow | 0.00149 | 0.71% | 0.00221 | 0.98% | 0.538 | 1.22% | 0.234 | 1.00% |
| LDF (198 NFE) | 7.22e−3 | 4.54% | 2.69e−3 | 21.81% | 3.84e−2 | 14.96% | 6.65e−2 | 17.53% |
| MAFM | 4.22e−8 | 0.965% | 1.13e−7 | 2.74% | 1.72e−7 | 1.70% | 1.75e−7 | 2.25% |
| MAFM + terminal projection | 5.32e−8 | 0.965% | 6.77e−8 | 2.74% | 0 | 1.70% | 0 | 2.25% |
Table 18. Supplemental comparisons on five PDE benchmarks. CE is the supplied-constraint error. Rel. is the own-initial-condition rollout error for time-dependent PDEs and the error against an independent solve from the generated source for Poisson. Div. RMSE measures deviation from zero divergence. Bold denotes the lowest value in each column at the displayed precision.
Scope and practical limitations
The residual-contraction law describes ideal continuous dynamics with a full-rank constraint Jacobian and exact multiplier solves. In a numerical sampler, Gram regularization, solve error, and time discretization can alter that law. A finite attraction budget also gives a finite reduction unless the sampler starts feasible or applies an exact normal step. Thus a small measured constraint error supports numerical feasibility, while matching a separately prescribed law on the feasible intersection remains a distinct question (Eq. (20)).
The quality of the guidance depends on the frozen endpoint model. Its conditional-mean prediction may average modes or become less reliable away from the training distribution; the adjoint is useful when the predicted-endpoint residual and input sensitivity convey a stable correction (Appendix § 11.§ 5). Each active adjoint step adds one input VJP, so its benefit must be read together with the sampling-time comparison in Table 10. The model parameters remain frozen.
The empirical evidence is limited to one training seed per task. The main Euler and controlled-NS comparisons use the training energy. Appendix § 14.8 tests the same checkpoints at 0.8, 1.2, and 2 times the training energy. The shared terminal projection brings MAFM within the reported energy tolerance at the two moderate shifts. At twice the training energy, projected MAFM still meets the tolerance, but the PDE relative errors rise to 9.85% on Euler and 10.01% on controlled NS. These results cover the three tested targets and one checkpoint per system. The Burgers samples show mild fluctuation-amplitude contraction, and reaction–diffusion samples retain a small negative-value tail. These observations define the scope of the present results and motivate broader seed and condition studies.
References
- [1]Aaron D. Ames, Xiangru Xu, Jessy W. Grizzle, and Paulo Tabuada. Control barrier function based quadratic programs for safety critical systems. IEEE Transactions on Automatic Control, 62 (8):3861–3876, August 2017. ISSN 1558-2523. doi: 10.1109/tac.2016.2638961. URL http://dx.doi.org/10.1109/TAC.2016.2638961.
- [2]Uri M Ascher and Linda R Petzold. Stability of computational methods for constrained dynamics systems. SIAM Journal on Scientific Computing, 14(1):95–120, 1993.DOI
- [3]Giacomo Baldan, Qiang Liu, Alberto Guardone, and Nils Thuerey. Physics vs distributions: Pareto optimal flow matching with physics constraints. In International Conference on Learning Representations, volume 2026, pp. 101215–101243, 2026.arxiv.org/abs/2506.08604
- [4]Jan-Hendrik Bastek, WaiChing Sun, and Dennis Kochmann. Physics-informed diffusion models. In International Conference on Learning Representations, volume 2025, pp. 3360–3385, 2025.arxiv.org/abs/2403.14404
- [5]Heli Ben-Hamu, Omri Puny, Itai Gat, Brian Karrer, Uriel Singer, and Yaron Lipman. D-flow: Differentiating through flows for controlled generation, 2024. URL https://arxiv.org/abs/2402.14017.
- [6]Tue Boesen, Eldad Haber, and Uri M Ascher. Neural daes: Constrained neural networks. SIAM Journal on Scientific Computing, 47(2):C291–C312, 2025.arxiv.org/abs/2211.14302
- [7]Ricky TQ Chen and Yaron Lipman. Flow matching on general geometries. In International Conference on Learning Representations, volume 2024, pp. 47922–47945, 2024.arxiv.org/abs/2302.03660
- [8]Ricky TQ Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural ordinary differential equations. Advances in neural information processing systems, 31, 2018.arxiv.org/abs/1806.07366
- [9]Chaoran Cheng, Boran Han, Danielle Maddix, Abdul Fatir Ansari, Andrew Stuart, Michael W Mahoney, and Bernie Wang. Gradient-free generation for hard-constrained systems. In International Conference on Learning Representations, volume 2025, pp. 100510–100539, 2025.arxiv.org/abs/2412.01786
- [10]Valentin De Bortoli, Emile Mathieu, Michael Hutchinson, James Thornton, Yee Whye Teh, and Arnaud Doucet. Riemannian score-based generative modelling. Advances in neural information processing systems, 35:2406–2422, 2022.
- [11]Justin S Diamond and Markus A Lill. Neural shake: geometric constraints in neural differential equations: J. diamond, m. lill. Journal of Cheminformatics, 17(1):115, 2025.DOI
- [12]Yuki Endo. Masked-attention diffusion guidance for spatially controlling text-to-image generation: Y. endo. The visual computer, 40(9):6033–6045, 2024.arxiv.org/abs/2308.06027
- [13]Ruiqi Feng, Chenglei Yu, Wenhao Deng, Peiyan Hu, and Tailin Wu. On the guidance of flow matching. arXiv preprint arXiv:2502.02150, 2025.arxiv.org/abs/2502.02150
- [14]Neil Fenichel. Geometric singular perturbation theory for ordinary differential equations. Journal of Differential Equations, 31(1):53–98, 1979. ISSN 0022-0396. doi: https://doi.org/10.1016/0022-0396(79)90152-9. URL https://www.sciencedirect.com/science/article/pii/0022039679901529.
- [15]Charles William Gear. Differential-algebraic equation index transformations. SIAM Journal on Scientific and Statistical Computing, 9(1):39–47, 1988.DOI
- [16]Peiyan Hu, Xiaowei Qian, Wenhao Deng, Rui Wang, Haodong Feng, Ruiqi Feng, Tao Zhang, Long Wei, Yue Wang, Zhi-Ming Ma, et al. From uncertain to safe: Conformal adaptation of diffusion models for safe pde control. arXiv preprint arXiv:2502.02205, 2025.arxiv.org/abs/2502.02205
- [17]Jiahe Huang, Guandao Yang, Zichen Wang, and Jeong Joon Park. Diffusionpde: Generative pde-solving under partial observation. Advances in Neural Information Processing Systems, 37:130291–130323, 2024.arxiv.org/abs/2406.17763
- [18]Christian Jacobsen, Yilin Zhuang, and Karthik Duraisamy. Cocogen: Physically consistent and conditioned score-based generative models for forward and inverse problems. SIAM Journal on Scientific Computing, 47(2):C399–C425, 2025.arxiv.org/abs/2312.10527
- [19]Vince Kurtz and Alexander Davydov. Constrained flow matching via lagrangian dual flows, 2026. URL https://arxiv.org/abs/2607.04513.
- [20]Jinhao Liang, Yixuan Sun, Anirban Samaddar, Sandeep Madireddy, and Ferdinando Fioretto. Chance-constrained flow matching for high-fidelity constraint-aware generation, 2025. URL https://arxiv.org/abs/2509.25157.
- [21]Yaron Lipman, Ricky TQ Chen, Heli Ben-Hamu, Maximilian Nickel, and Matt Le. Flow matching for generative modeling. arXiv preprint arXiv:2210.02747, 2022.arxiv.org/abs/2210.02747
- [22]Ségolène Martin, Anne Gagneux, Paul Hagemann, and Gabriele Steidl. Pnp-flow: Plug-and-play image restoration with flow matching, 2025. URL https://arxiv.org/abs/2410.02423.
- [23]George Papamakarios, Eric Nalisnick, Danilo Jimenez Rezende, Shakir Mohamed, and Balaji Lakshminarayanan. Normalizing flows for probabilistic modeling and inference. Journal of Machine Learning Research, 22(57):1–64, 2021.
- [24]Maziar Raissi, Paris Perdikaris, and George E Karniadakis. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational physics, 378:686–707, 2019.DOI
- [25]Ming Shi, Yingbin Liang, and Ness Shroff. A near-optimal algorithm for safe reinforcement learning under instantaneous hard constraints. In International Conference on Machine Learning, pp. 31243–31268. PMLR, 2023.arxiv.org/abs/2302.04375
- [26]Ka Chun Shum, Binh-Son Hua, Duc Thanh Nguyen, and Sai-Kit Yeung. Color alignment in diffusion. In 2025 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 28446–28455. IEEE, 2025.
- [28]Jan Tauberschmidt, Sophie Fellenz, Sebastian Vollmer, and Andrew Duncan. Physics-constrained fine-tuning of flow-matching models for generation and inverse problems. In International Conference on Learning Representations, volume 2026, pp. 143992–144037, 2026.arxiv.org/abs/2508.09156
- [29]Alexander Tong, Kilian Fatras, Nikolay Malkin, Guillaume Huguet, Yanlei Zhang, Jarrid Rector-Brooks, Guy Wolf, and Yoshua Bengio. Improving and generalizing flow-based generative models with minibatch optimal transport. arXiv preprint arXiv:2302.00482, 2023.arxiv.org/abs/2302.00482
- [30]Utkarsh Utkarsh, Pengfei Cai, Alan Edelman, Rafael Gomez-Bombarelli, and Christopher Rackauckas. Physics-constrained flow matching: Sampling generative models with hard constraints. Advances in Neural Information Processing Systems, 38:160217–160252, 2026.arxiv.org/abs/2506.04171
- [31]Gerhard Wanner and Ernst Hairer. Solving ordinary differential equations II, volume 375. Springer Berlin Heidelberg New York, 1996.
- [32]Long Wei, Peiyan Hu, Ruiqi Feng, Haodong Feng, Yixuan Du, Tao Zhang, Rui Wang, Yue Wang, Zhi-Ming Ma, and Tailin Wu. Diffphycon: A generative approach to control complex physical systems. Advances in Neural Information Processing Systems, 37:4090–4147, 2024.arxiv.org/abs/2407.06494
- [33]Jiachen Yao, Abbas Mammadov, Julius Berner, Gavin Kerrigan, Jong Chul Ye, Kamyar Azizadnesheli, and Anima Anandkumar. Guided diffusion sampling on function spaces with applications to pdes, 2026. URL https://arxiv.org/abs/2505.17004.







