WorksComputer Science
Characterizing and Mitigating Distributional Bias in Physics-Informed Generative Models
Abstract
Physics-informed generative models augment a data-fitting objective with residual penalties that encourage physical constraints to hold in generated samples. However, improving constraint satisfaction need not improve fidelity to the data distribution. We study this conflict in residual-regularized diffusion models and identify two possible consequences. First, the same prediction error can incur different residual costs near different feasible states, preferring states with lower residual sensitivity (avoidance). Second, this preference can extend to feasible states outside the data support, where the residual also vanishes (leakage). Motivated by this analysis, we propose a data-anchored penalty that weights prediction errors by the residual Jacobian at the clean training sample and normalizes the resulting magnitude. This removes the incentive to relocate to less sensitive states without changing the model architecture or sampling procedure. Experiments on a controlled synthetic system, three PDE systems, and molecular transition-state generation with flow matching demonstrate the benefits of anchoring. Code is available at https://github.com/TanjaBien/anchored_diffusion.
Introduction
Diffusion and flow matching models learn vector fields that guide the transformation of samples from a simple reference distribution into samples resembling the training data. They are increasingly applied in scientific machine learning ([4, 37, 3, 39, 8]), where generated samples are often expected to satisfy known physical constraints. These may be expressed through governing partial differential equations (PDEs), as in physical field generation, or through force-based conditions, as in molecular transition-state generation. Learning from physically valid examples, however, does not guarantee that generated samples satisfy these constraints.
To encourage constraint satisfaction, physics-informed generative models add a physical residual penalty to the training loss ([3, 1]). A residual measures how much a prediction violates a constraint and vanishes when the constraint is satisfied. The additional loss is intended to improve physical accuracy while retaining the distribution learned from data. However, a lower expected residual does not imply a better approximation of that distribution ([1, 6]).
In this work, we examine how this conflict arises from the residual loss favoring some feasible states over others. The residual is evaluated at the diffusion model’s prediction, and its sensitivity to prediction errors can vary across states. An error of the same magnitude and direction can therefore incur a large residual near one feasible state and a small residual near another, while the standard squared prediction error remains unchanged. Moving a prediction toward a less sensitive state can then reduce the combined loss even when it increases the distance to the clean training target. We call this preference avoidance. Furthermore, physical constraints specify which states are admissible, but not which occur in the data or how frequently they occur. The residual can therefore vanish at states outside the data support, allowing the preference for less sensitive states to extend to states absent from the data support. We call this possibility leakage.
We formalize these mechanisms by comparing predictions under the same perturbations applied to different feasible states. This gives an exact condition under which the reduction in residual loss compensates for the additional denoising error. For small perturbations, the comparison is governed by the residual Jacobian, which describes how the residual changes as the predicted state changes. The analysis applies to differentiable residual maps and does not require a PDE.
These observations motivate a data-anchored residual loss. Instead of evaluating the residual at the prediction, we use the Jacobian of the residual at the clean training sample to weight the prediction error. The Jacobian remains fixed as the prediction changes, removing the incentive to move toward a state with a less sensitive Jacobian. We normalize this weighting to limit the influence of large Jacobian magnitudes. The resulting objective requires no change to the model architecture or sampling procedure. We characterize its optima for individual training samples and after averaging over the set of possible clean targets given a noisy input. Finally, we evaluate residual accuracy and fidelity to the data on a controlled synthetic system and the Burgers, Darcy, and advection equations, as well as molecular transition-state generation with flow matching.
Background and Setup
Partial differential equations
Let be a field defined at spatial position and physical time . Its governing PDE, with differential operator , is
The PDE generally admits a family of solutions, with initial and boundary conditions selecting a particular field. On a fixed grid, this field is represented by . Each sample contains the complete discretized space–time trajectory , and is the total number of field values on this grid. The residual operator measures violations of the discretized PDE, with residual equations Xu et al. (2018). A discrete field satisfies the PDE when .
Physics-constrained diffusion models
Diffusion models learn to reverse a fixed corruption process [36] (Ho et al. 2020). Given a clean sample , the forward process produces
The variance schedule is chosen so that the terminal is approximately standard Gaussian. A network learns to recover the clean sample from .
Physics-constrained training [3, 31] adds the squared residual of the clean-sample prediction to the denoising loss:
Here weights denoising and weights the residual, written as a constant scale times the fixed time-dependent schedule of Bastek et al. [3]. At fixed , only their ratio matters and we write it as below. We use the clean sample parameterization Karras et al., [21].
Setup
We assume that the data samples satisfy the governing PDE, so almost surely for . Here denotes the distribution the model is meant to learn. It is fixed by the application rather than by the equation, so it typically covers a restricted part of the solution set. We distinguish the support of the data distribution from the zero set of the residual :
We assume that is continuous, which gives . When the inclusion is strict, contains fields that satisfy the PDE but do not occur in the data distribution. While the governing PDE permits a broad family of solutions, the data of interest are collected under a restricted range of initial conditions, boundary conditions, and physical parameters, so that is the realistic setting.
Analysis of the residual loss
The residual vanishes at every feasible solution. However, the same prediction error can produce a large residual near one solution and a small residual near another. The differences matter when denoising is imperfect, as the combined objective may favor predictions near a solution that is less sensitive to errors, even if that solution is farther from the training target. We first derive the condition for this preference, then explain its relation to the residual Jacobian and the data distribution.
Comparing predictions around two solutions
Fix a clean training sample and a noise level . Dividing the objective in Eq. (2) by , the loss of a prediction becomes
Here , with . To isolate the role of the residual term, we compare two predictions that are centered at different feasible solutions but perturbed in the same way. Let be a second solution, so that . Let be a random perturbation with and . We keep its distribution fixed and compare the predictions and , which differ only in their centers. We assume that both expected squared residuals are finite. For a given , the prediction around attains the lower loss if and only if
We now compare the expected losses, requiring . Using , this is equivalent to
Thus, predictions centered at have lower expected loss precisely when the weighted reduction in expected squared residual exceeds the additional denoising cost . Figure 1 illustrates the comparison between denoising and residual losses. Appendix B provides a detailed derivation.
Figure 1. Illustration of avoidance. The training solution and an alternative solution both satisfy , but the same zero-mean perturbation produces a smaller expected residual penalty near the less sensitive solution . Shifting predictions from to therefore reduces the residual penalty while adding an expected denoising cost of . The combined objective prefers this shift when the weighted residual reduction exceeds the added denoising cost. If the favored solution lies outside the data support, this preference results in leakage.
Why the residual cost depends on the solution
To understand why the expected residual loss can differ between the two solutions, consider a small perturbation around a feasible solution. Assume that is twice continuously differentiable near and . Since , Taylor expansion gives
Each entry of the residual Jacobian measures how one residual component changes when one component of the field is varied, so is the first-order response of the residual to the perturbation . The Jacobian can differ between solutions, so the same perturbation can produce different residual responses around and .
To control the approximation after averaging, consider , where is bounded, and is small. Under the smoothness assumption above, replacing the residual by its linear approximation changes its expected squared norm by . Applying this approximation to both solutions gives the approximate comparison
The difference in expected residual loss between the two centers depends on how strongly their Jacobians respond to the same perturbations. A smaller average response at reduces the expected residual penalty. The approximate comparison predicts a lower combined loss only when this reduction, weighted by , exceeds the displacement cost . We call this preference for less sensitive solutions avoidance.
Feasibility does not imply data support
The comparison in Sec. 3.1 requires only that the competing solution is feasible, , not that it is supported by the data. Every element of meets this requirement, so the competing solution can also lie in . We refer to the possibility that the combined objective favors such a solution as leakage.
The next section addresses avoidance and leakage by fixing the residual Jacobian at the clean training sample, so that moving the prediction cannot change the Jacobian used to penalize its error.
Data-anchored residual loss
The preceding analysis shows that evaluating the residual at the prediction alone can favor different solutions with lower residual sensitivity, including solutions outside the data support. The penalty can therefore decrease as the prediction moves away from its clean training target. To remove this incentive, we penalize the prediction error using the residual Jacobian evaluated at the clean sample .
Since , the first-order Taylor approximation of the residual at a prediction is
We use the squared norm of this approximation as the data-anchored residual loss:
For a given training sample, the Jacobian remains fixed as the prediction changes. The prediction therefore cannot obtain a smaller penalty simply by moving toward a solution with a less sensitive Jacobian.
Normalization. The magnitude of the residual Jacobian can vary across training samples. This can make the anchored penalty much larger for some samples than others, even when their prediction errors have the same size. To control this scale, we divide by the squared Frobenius norm of the Jacobian and write the full training objective as:
The constant prevents division by zero when the Jacobian vanishes. We use the denoising weight as the schedule of the residual term, , so the ratio is the same at every noise level.
This normalization gives a direct bound:
Thus the normalized residual term cannot exceed the squared prediction error before the loss weights are applied.
Effect on avoidance
We now repeat the comparison of § 3.1 for the anchored loss in Equation (7) and show that a prediction centered away from can no longer attain a lower expected loss. As before, we compare the predictions and , which share the same perturbation with . The prediction around therefore attains the lower expected loss if and only if
which is the anchored counterpart of Equation (5). The left-hand side is never positive, since it is the negative of a squared norm divided by a positive constant, while the right-hand side is strictly positive for . The condition therefore never holds, and is the unique minimizer of the expected anchored loss over all centers. Appendix § 11 provides a detailed derivation.
Intuitively, the standard loss measures the sensitivity of the residual at the prediction, whereas the anchored loss always measures it at the clean training sample. For a prediction around , the standard penalty is therefore governed by , so a less sensitive solution can reduce it enough to outweigh the added denoising cost (§ 3.2). The anchored penalty uses for both predictions, so the shared perturbation incurs the same expected cost around either center, and moving the center can only add to the penalty. Figure 2 illustrates this behavior and compares the anchored loss with the standard loss.
Figure 2. Comparison of the standard and data-anchored objectives for the displacement illustrated in Figure 1. Curves show the change in expected loss relative to the predictions at , with the perturbation distribution held fixed. The dashed curve shows the added denoising cost. (a) The standard residual penalty can decrease enough to outweigh this cost, favoring predictions centered at . (b) Anchoring the residual Jacobian at removes this saving, so displacement can only increase the expected combined loss, whose minimum remains at .
Alignment with the denoising gradient
Reducing the PDE residual does not necessarily bring a prediction closer to its clean target. Anchoring prevents this conflict at the level of prediction-space gradients. For a fixed feasible target , the gradients of the standard and normalized anchored physics penalties with respect to are
The standard gradient depends on the residual geometry at the prediction. The anchored gradient instead weights the prediction error using the fixed local sensitivity at the clean target.
Taking its inner product with the denoising gradient gives
Thus an infinitesimal descent step on the anchored penalty cannot increase the squared prediction error. The standard residual gradient has no such guarantee.
Anchoring also preserves the leading local residual gradient. Since , Taylor expansion of and its Jacobian around gives
The anchored gradient, therefore, agrees with the standard residual gradient to first order, up to normalization, while remaining aligned with denoising even away from the target.
Experiments
Datasets. We use one synthetic dataset, three PDE systems, and one molecular dataset.
The shocked circle is a synthetic dataset whose samples are uniformly distributed around a unit circle. We embed this circle in by placing it in the first two coordinates and setting all remaining coordinates to zero (App. F.1.1). We define the residual as , where is positive. The residual therefore vanishes at every point on the unit sphere . The factor controls how sensitive the residual is to prediction errors without changing this feasible set. Along the data circle, the sensitivity is . We use a graded profile, which makes sensitivity vary by a factor of around the circle, and a flat control with and constant sensitivity. Comparing these profiles isolates the effect of varying residual sensitivity. We use to examine the role of feasible states outside the data support. The data lie on the unit circle in the plane of the first two coordinates, while the residual vanishes on the whole hypersphere. This allows us to study leakage toward feasible states absent from the data.
Advection is the linear 1D advection equation with on a space–time grid. Its residual is linear in , so the residual Jacobian is the same for every sample.
Burgers is the nonlinear 1D viscous Burgers equation with on a space–time grid. Its trajectories develop steep fronts (shocks), and its residual Jacobian depends on the state through the nonlinear term . The two time-dependent PDE datasets, advection and Burgers, are generated with Liu et al. [27] on the periodic domain from random multi-mode initial conditions. Each contains 10 000 trajectories, split 90/10 into training and held-out data, with each sample representing a full space–time trajectory (App. F.1).
Darcy describes steady flow through a porous medium, on the unit square, with permeability , pressure , zero-flux boundaries, and a source and a sink in two opposite corners. The log-permeability is a Gaussian random field with length scale 0.1, and is the solution for that . The model generates and jointly on a grid.
For the molecular task, we evaluate the generation of transition states (TSs) of chemical reactions on Transition1x-2x3px4p (Darouich et al. [9]). The dataset contains about 14 000 gas-phase reactions of small organic molecules with up to 7 heavy atoms and up to 23 atoms, including elements up to the fourth period. All structures are computed at the semi-empirical GFN2-xTB level of theory (Bannwarth et al. [2]).
Metrics. On the shocked circle, we report the median distance to the feasible sphere, , and to the data plane, . The latter measures departures from the plane containing the data and serves as a diagnostic for leakage.
On the PDE datasets, physical accuracy is measured by the mean absolute residual , averaged over residual entries and generated samples. Maximum mean discrepancy (MMD) assesses distributional fidelity by comparing the joint distributions of field features, including amplitude and maximum gradient, between generated and held-out samples. The ratio compares their median residual sensitivities, with values below one indicating less sensitive generated states. The field standard-deviation ratio compares their mean within-field standard deviations, using for Burgers and advection and for Darcy. Both ratios ideally equal one.
For molecular TSs, we compare each generated structure with the reference TS of the same reaction. RMSD and DMAE measure structural errors. Physical validity is assessed by the energy difference , the maximum atomic force , the Hessian MAE, and the valid TS rate, defined as the percentage of generated structures whose Hessian has exactly one negative eigenvalue. Appendix F.2 gives the full definitions.
Weights. The numerical penalty weights are not directly comparable between PIDM and the anchored objective. PIDM penalizes the residual in its original scale, whereas the anchored objective divides its linearized residual penalty by the squared Frobenius norm of the residual Jacobian. A larger anchored coefficient can compensate for this normalization rather than impose a stronger constraint. To compare the methods, we approximately match their local penalty scales near the training data, accounting for both Jacobian normalization and different weighting schedules across noise levels. This gives the pairings , with conversion factors of for advection, approximately for Burgers, and approximately for Darcy. We evaluate a range of weights to examine the resulting trade-offs between physical accuracy and data fidelity.
Results
Shocked circle. Figure 3 shows PIDM on the graded circle at . Darker shading indicates higher residual sensitivity. Errors of the same size incur larger residuals. As increases, the residual decreases, but samples increasingly avoid sensitive regions. The model thus favors states where the same error is penalized less, as predicted by Eq. (5). This effect is absent in the flat control, where sensitivity is constant and the angular density remains uniform even at . Meanwhile, the distance to the data plane increases despite the lower residual. Since all data lie in this plane, this distance measures departure from the data manifold. PIDM therefore lowers the residual both by avoiding sensitive regions and by moving along , where the residual vanishes and cannot distinguish data-supported states from other feasible states. The anchored objective retains coverage of the entire circle (App. § 15.§ 1).
Figure 3. PIDM on the shocked circle at . Top, generated samples projected onto the data plane, with shading indicating residual sensitivity. Bottom, their angular density compared with the data distribution (dashed) and the residual sensitivity (grey). The first column uses the flat residual as a control. Right, median radial residual and distance to the data plane as functions of the penalty weight.
Burgers’ equation. Only the anchored objective dominates DM. At it lowers the residual from to and the MMD from to , and its and ratios rise from and to and . It thus counteracts the tendency of DM toward smooth fields. No weight of PIDM reaches the MMD of DM. At its smallest weights PIDM lowers the residual to at an MMD of , and larger weights shrink the fields until the ratio falls below . Its very low residuals at therefore come from weak, smooth fields with an MMD of . The anchored objective reaches the same residual of at an MMD of $0.44 and keeps an ratio of at least up to . Wherever both methods reach the same residual, the anchored samples are closer to the data. Detailed results can be found in Appendix § 15.§ 2.
Darcy’s equation. Both objectives match the MMD of DM and lower its residual from 6.0 to 0.28 for PIDM and 0.35 for the anchored objective. The anchored objective reaches the lowest MMD of all runs (0.028 against 0.046 for PIDM and 0.054 for DM), with and std() ratios closer to one. At larger weights PIDM flattens the pressure, which makes errors in cheaper, and its MMD rises to 0.20 at (Table 8). At the comparable weight the anchored objective still keeps the pressure, with a std() ratio of 0.92, and reaches a residual of 0.24 at an MMD of 0.079. At the largest weights both objectives flatten the pressure (App. § 15.§ 3).
Table 8: Darcy. Rows of PIDM and the anchored objective with comparable weights are aligned. The anchored objective reaches a lower residual at comparable MMD.
| forward error | MMD | ratio | std() ratio | std() ratio | ||
| DM | 6.0 | 3.4e-2 | 5.4e-2 | 0.84 | 1.1 | 0.75 |
| PIDM | ||||||
| 1.2 | 4.3e-2 | 7.3e-2 | 0.80 | 1.2 | 0.72 | |
| 0.96 | 5.5e-2 | 4.7e-2 | 0.85 | 1.1 | 0.74 | |
| 0.28 | 0.19 | 4.6e-2 | 0.83 | 0.98 | 0.73 | |
| 0.33 | 0.39 | 0.20 | 0.91 | 0.64 | 0.75 | |
| 0.14 | 0.87 | 0.66 | 0.79 | 0.14 | 0.66 | |
| Anchored | ||||||
| 2.0 | 5.9e-2 | 5.3e-2 | 0.84 | 1.1 | 0.75 | |
| 0.56 | 3.6e-2 | 5.8e-2 | 0.83 | 1.1 | 0.74 | |
| 0.35 | 4.7e-2 | 2.8e-2 | 0.90 | 0.99 | 0.80 | |
| 0.24 | 0.22 | 7.9e-2 | 0.82 | 0.92 | 0.71 | |
| 0.36 | 1.0 | 0.90 | 0.79 | 0.31 | 0.79 |
Table 8.
Advection equation. For the linear advection equation the residual Jacobian is the same for every field, so the anchored residual equals the standard one up to a constant, and neither avoidance nor a shifted target can occur (App. § 12). The two objectives then differ only in their weighting over noise levels. As expected, they behave alike (Figure 4). Both lower the residual at the cost of amplitude, and at the largest weights they coincide (Table 9). The smaller loss of amplitude of the anchored objective at low weights comes from PIDM’s ratio growing at high noise, where the zero field is an exact solution.
Figure 4. Trade-offs between distributional fidelity and physical accuracy on Burgers (left), Darcy (middle), and advection (right). Each point shows the MMD and mean absolute residual for one reported setting. Both axes are logarithmic, and lower left is better. Stars denote DM, orange squares PIDM, and blue circles the anchored objective. Dashed lines connect nondominated settings within each regularized method. A setting is nondominated if no other tested weight of the same method reduces one metric without increasing the other. The line segments serve as visual guides. Rings and labels mark the lowest-MMD setting for each regularized method, breaking MMD ties by lower residual. The labeled values are the coefficients used in each method’s objective.
Table 9: Advection. PIDM (left) and the anchored objective (right) with comparable weights in the same row. DM reaches e-2, an MMD of 0.28 and a std() ratio of 0.51.
| PIDM | Anchored | ||||||
| MMD | std() ratio | MMD | std() ratio | ||||
| 4.6e-3 | 0.45 | 0.37 | 5.3e-3 | 0.29 | 0.50 | ||
| 2.2e-3 | 0.59 | 0.24 | 4.2e-3 | 0.37 | 0.41 | ||
| 1.3e-3 | 0.84 | 5.6e-2 | 1.6e-3 | 0.61 | 0.17 | ||
| 1 | 9.2e-4 | 0.87 | 7.2e-3 | 9.1e-4 | 0.87 | 4.1e-3 |
Table 9.
| Method | MMD | ratio | Field std. ratio | ||
| Burgers | |||||
| DM | – | 0.25 | 0.12 | 0.82 | 0.81 |
| PIDM | None | – | – | – | – |
| Anchored (ours) | 0.23 | 0.037 | 0.91 | 0.90 | |
| Darcy | |||||
| DM | – | 6.0 | 0.054 | 0.84 | 1.1 |
| PIDM | 0.28 | 0.046 | 0.83 | 0.98 | |
| Anchored (ours) | 0.35 | 0.028 | 0.90 | 0.99 |
Table 1. Results at the weight that minimizes the residual subject to MMD being no higher than the DM baseline. “–” indicates that no tested weight can match the MMD of the DM baseline. Bold marks the best-displayed value within each PDE, with ratios compared by their distance from it. The field standard-deviation ratio uses for Burgers and for Darcy.
Transition1x-2p3p4p. To test the anchored loss beyond PDEs, we generate TSs of chemical reactions. A TS is a first-order saddle point of the PES, at which all forces vanish, so a natural residual is the force . Since evaluating GFN2-xTB during training is too expensive, we use the machine-learned interatomic potential HIP [5] as a surrogate, which provides energies, forces, and Hessians at a fraction of the cost.
We train React-OT [11] with the plain flow matching loss (FM), with the standard residual Table 2: TS generation on Transition1x-2p3p4p. All metrics except the valid TS rate are medians over the generated structures. The Hessian MAE is computed against the GFN2-xTB reference Hessians, and the valid TS rate is the percentage of generated structures whose Hessian has exactly one negative eigenvalue.
| RMSD () | D-MAE () | (kcal/mol) | (kcal/mol/) | Hessian MAE (kcal/mol/) | Valid TS (%) | |
| FM | 0.134 | 0.060 | 2.53 | 33.50 | 8.40 | 57.0 |
| FM + residual | 0.140 | 0.066 | 8.11 | 67.80 | 12.56 | 36.0 |
| FM + anchored (ours) | 0.135 | 0.059 | 2.36 | 31.22 | 8.09 | 60.0 |
Table 2. TS generation on Transition1x-2p3p4p. All metrics except the valid TS rate are medians over the generated structures. The Hessian MAE is computed against the GFN2-xTB reference Hessians, and the valid TS rate is the percentage of generated structures whose Hessian has exactly one negative eigenvalue.
loss added to it (FM + residual), and with the anchored residual loss added to it (FM + anchored), as detailed in Appendix F.3. All three models reach similar structural accuracy (Table 2). RMSD and DMAE weigh all geometric errors equally, but the energy is far more sensitive to some displacements, such as bond stretches, than to others, such as torsions. As with shocked and smooth PDE solutions, errors of the same size can therefore have very different physical costs, and the energetic metrics separate the models clearly. Although FM + residual penalizes the force directly, it roughly triples the energy error of FM, doubles its maximum force, and increases its Hessian error, while FM + anchored improves all three. The valid TS rate drops from 57% for FM to 36% for FM + residual and rises to 60% for FM + anchored. This is consistent with leakage, since the standard residual cannot distinguish a TS from a minimum, whereas the anchored loss evaluates the Jacobian at the reference TS, whose Hessian carries the single direction of negative curvature.
Related work
Physics at inference. One line of work integrates physics during inference and steers the samples of a trained model with the gradients of the PDE residual ([35, 18, 20, 13]), by projections onto the constraint set ([7, 40] (Xu et al. 2026)), or by running the diffusion in a transformed space in which the map back to the data space carries the constraint ([25, 12]). For diffusion guidance in general, Geyfman et al. [14] show that common approximations can bias sampling away from the intended Bayesian posterior. We instead study residual penalties during training, with sampling left unchanged.
Physics during training. Bastek et al. [3] introduce the penalty we study, adding the residual loss to the denoising loss. Later work varies how the residual enters. Zeng et al. [46] propose a different weighting of the residual across noise levels, Sawhney et al. [32] pass the residual field to spectral attention instead of the loss, and Yeom-Song et al. [44] add the constraint gradient to the predicted clean sample inside the forward pass. Another group penalizes the residual on a sampled output rather than on the posterior mean, by distilling the trained model into a few-step generator or fine-tuning it on multi-step trajectories ([47, 22, 6]), or by treating the residual as a reward and fine-tuning a pretrained model against it ([45, 38]), at the cost of a second training stage. These corrections reduce the prediction error but leave the residual evaluated at the model’s own output, so the preference derived (§ 3.1) persists whenever the prediction is not exact. An extended overview over related work can be found in App. § 13.
Discussion
Limitations. The anchored objective requires a residual Jacobian–vector product and estimates the normalizer at every training step, potentially increasing the computational cost relative to PIDM (Table 5). Its benefit depends on the residual structure. For linear PDEs such as advection, the anchored and standard penalties coincide up to a constant, leaving only their weighting across noise levels to distinguish the objectives. The gains are clearest when the residual depends nonlinearly on the state. Anchoring also guarantees neither exact constraint satisfaction nor preservation of the data distribution. It mitigates avoidance, but sample-dependent Jacobian weighting can still shift the conditional denoising optimum (App. § 12). Empirically, generated samples retain residuals above those of the data, and large penalty weights still smooth Burgers shocks and flatten Darcy pressure fields, although anchoring reduces these distortions over much of the tested range of weights. The penalty weight, therefore, remains an important choice in balancing physical accuracy and distributional fidelity.
| DM | PIDM | Anchored | |
| Advection | 526 | 531 (+1.0%) | 539 (+2.5%) |
| Burgers | 1067 | 1071 (+0.4%) | 1082 (+1.5%) |
| Darcy | 41 | 57 (+38%) | 92 (+123%) |
Table 5. Wall-clock time in seconds per 1000 training iterations on one A40 GPU at batch size 8, for the training step alone. In parentheses the increase over DM.
Future work. Since the anchored objective keeps the samples close to the data distribution, it is a good starting point for a correction after sampling, such as a final projection, which could provide the guarantees that training alone cannot. A time weighting chosen for the physics term, rather than inherited from the data term, is also likely to improve the method. Further directions are efficient approximations of the Jacobian and applying the physics term only at the noise levels where it helps most.
AI use statement
In this work, we used generative AI tools to aid and polish writing, to draft sections of the paper, and to support research execution through code generation for analysis and evaluation scripts, generation of datasets and creation of figure. We have not used generative AI tools for design methodology and experiments, develop theoretical models or conceptual frameworks and assist with translation, clean and reformat dataset are not applicable to this work, summarize and analyze existing literature, format references. Additionally, we used generative AI tools for creating and editing figures and draft part of the research paper, search for additional relevant literature. We have reviewed all AI-assisted work. All code and text has been manually reviewed by the authors. We take responsibility for the final content of this work, including text, claims, or artifacts produced with the aid of generative AI.
See the AISTATS 2027 AI Policy for Authors for more details. This statement should not be more than 1 page.
Acknowledgements
This work was supported by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany’s Excellence Strategy – EXC 2120/1 – 390831618. The authors thank the International Max Planck Research School for Intelligent Systems (IMPRS-IS) for supporting Tanja Bien, Samir Darouich, Lluís Pastor-Pérez, and Vinh Tong. We also acknowledge support from the Ministry of Science, Research and the Arts Baden-Württemberg through the Artificial Intelligence Software Academy (AISA), as well as from the Stuttgart Center for Simulation Science (SimTech). L. Mualem was supported by a postdoctoral scholarship from the Planning and Budgeting Committee (PBC) of the Council for Higher Education in Israel. The authors gratefully acknowledge the computing time provided on the high-performance computer HoreKa by the National High-Performance Computing Center at KIT (NHR@KIT). This center is jointly supported by the Federal Ministry of Education and Research and the Ministry of Science, Research and the Arts of Baden-Württemberg, as part of the National High-Performance Computing (NHR) joint funding program (https://www.nhr-verein.de/en/our-partners). HoreKa is partly funded by the German Research Foundation (DFG).
CHECKLIST
For all models and algorithms presented, check if you include:
(a) A clear description of the mathematical setting, assumptions, algorithm, and/or model. Yes, all assumptions and definitions are stated in Section 3 and 4 and Appendix A, B, C include the detailed step-by-step derivations and more details.
(b) An analysis of the properties and complexity (time, space, sample size) of any algorithm. Yes, Appendix F.4 analysis the training cost of the different methods.
(c) (Optional) Anonymized source code, with specification of all dependencies, including external libraries. Yes.
For any theoretical claim, check if you include:
(a) Statements of the full set of assumptions of all theoretical results. Yes
(b) Complete proofs of all theoretical results. Yes
(c) Clear explanations of any assumptions. Yes
For all figures and tables that present empirical results, check if you include:
(a) The code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL). Yes, code and data are added as supplemental material.
(b) All the training details (e.g., data splits, hyperparameters, how they were chosen). Yes, in Appendix F.3 Implementation details.
(c) A clear definition of the specific measure or statistics and error bars (e.g., with respect to the random seed after running experiments multiple times). Yes, in Appendix F.2 Metrics
(d) A description of the computing infrastructure used. (e.g., type of GPUs, internal cluster, or cloud provider). Yes, we name the type of GPU used for the respective experiments in the training and sampling settings table.
If you are using existing assets (e.g., code, data, models) or curating/releasing new assets, check if you include:
(a) Citations of the creator If your work uses existing assets. Yes, we cite all datasets and software we use.
(b) The license information of the assets, if applicable. Yes
(c) New assets either in the supplemental material or as a URL, if applicable. Not Applicable.
(d) Information about consent from data providers/curators. Not Applicable.
(e) Discussion of sensible content if applicable, e.g., personally identifiable information or offensive content. Not applicable
If you used crowdsourcing or conducted research with human subjects, check if you include:
(a) The full text of instructions given to participants and screenshots. Not Applicable
(b) Descriptions of potential participant risks, with links to Institutional Review Board (IRB) approvals if applicable. Not Applicable
(c) The estimated hourly wage paid to participants and the total amount spent on participant compensation. Not Applicable
Conditional target of the combined loss
In physics-constrained training, the governing equation satisfied by the data is known, and its residual is added to steer predictions toward physically plausible samples Bastek et al. [3]. Consider the idealized case in which the diffusion model already reproduces . Its generated samples then satisfy the PDE, so the residual has no distributional defect to correct. We ask whether adding the residual loss nevertheless changes the optimal denoiser’s predictions.
To answer this, we compare the minimizer of the denoising loss with the minimizer of the combined loss. At a fixed noisy input , the first is the conditional mean , and the second, is
The displacement from the denoising optimum to the combined optimum is , with when only the denoising objective is used.
To find the minimizer of Eq. (12) we ask how far a prediction must shift from to reach it, so we write every candidate as and search for the displacement at which the gradient of the combined objective vanishes. Setting the gradient of Eq. (12) to zero gives a condition for , and its Taylor expansion around to leading order in is (App. A.2, App. A.3)
If the product of the Jacobian of the residual and the residual is nonzero , the denoising optimum cannot minimize the combined objective for any . Thus , even though is already the optimal denoising prediction. This can occur when every clean sample satisfies the PDE, because their conditional mean need not satisfy a nonlinear equation.
The remainder of this section derives these statements. App. § 9.§ 1 reduces the conditional denoising objective to Eq. (12), App. § 9.§ 2 and App. § 9.§ 3 give the stationarity condition and its expansion for small weight, App. § 9.§ 4 bounds the magnitude of , and App. § 9.§ 5 examines when the conditional mean of feasible samples fails to satisfy the equation. App. § 9.§ 6 gives an example in which every increase of the weight lowers the residual and moves the target farther from the data. App. § 9.§ 7 relates the infeasibility of the conditional mean to the Jensen gap.
The conditional denoising objective
Fix and write and . With finite conditional second moments, expand . Since , the cross term has zero expectation and
The covariance term is independent of , giving the objective in Eq. (12).
The displacement condition
Let be differentiable. Its Jacobian has entries . Write a candidate prediction as . After this substitution, the function minimized inside the braces in Eq. (12) becomes
The derivative of the denoising term is
For the residual term, write its squared norm componentwise as
Because , differentiation with respect to gives
Collecting these components yields
The gradient of the full objective is therefore
At the minimizing displacement , the first-order condition is
Rearranging gives the implicit stationarity condition
The small-weight displacement
Define . Then and . If is sufficiently smooth, the implicit function theorem gives a local solution near . Differentiating at yields
which gives Eq. (13). For continuous , global minimizers exist by coercivity and approach as . With local smoothness, they lie on this branch for small enough weight.
The displacement bound
Since minimizes the objective in Eq. (12), its value cannot exceed the value at . Substituting gives directly
The second inequality uses . In particular, implies for every .
The conditional residual gap
A nonzero residual at is necessary for the combined objective to displace the optimal denoising prediction, as shown by Eq. (24). This may seem unlikely when every clean sample satisfies the PDE. The optimal denoiser predicts , rather than one of the feasible clean samples. It averages the clean samples compatible with noisy input . Although each of these samples satisfies the PDE, their average need not do so. This can happen when the PDE solution set is not convex, since an average of solutions may lie outside it. If is affine, conditional expectation preserves feasibility,
For a nonlinear residual, feasibility of the conditional mean need not follow. Let . Taylor expansion of each residual component around gives
where as . Provided the conditional expectation of the remainder exists, almost surely and give
The remainder vanishes for quadratic , making the identity exact. Nonlinearity and posterior spread can therefore produce a nonzero residual at the optimal denoising prediction, although neither guarantees it.
Neither ingredient is sufficient. Let with a symmetric conditional law on and , . The mean is feasible and both Hessian and covariance are nonzero, but their contraction vanishes, so the displacement is zero at every weight despite a full-row-rank Jacobian at the mean. The affine case is a sufficient exact control, not the only zero-displacement case.
The circle identity and the origin. For feasible circle data and , exactly, and , radially outward, partly reversing the contraction caused by averaging distinct circle points, and vanishing with the spread. At , however, and the objective has minimizer for , so nonzero residual must not be identified with nonzero first-order displacement.
An exact example of the trade-off
Let with , , on the sphere of radius , with a rotationally symmetric conditional law, so . The residual depends only on while is minimized on the positive axis, so global minimization reduces to , with derivative , negative on and positive on . All minimizers lie in , where stationarity is
increasing continuously from zero to infinity, so every positive weight has exactly one stationary point in the interval, it is the global minimizer, and increases from toward . Every data point is equidistant from an axis point, so
the added squared distance tending to as the residual tends to zero, so every increment of weight improves the physics and takes the target farther from every data state.
The influence of the Jensen gap
For a nonlinear function the value at an average is not the average of the values, and the difference is the Jensen gap. The gap has already been held responsible for the trade-off between physical and distributional accuracy, since the residual is imposed on the posterior mean rather than on a clean sample, and both Zhang et al. [47] and Baldan et al. [1] seek to reduce it by evaluating the residual closer to a clean sample. A denoiser makes such an average unavoidable, since it sees only and must answer with one prediction for every clean state compatible with it. Both terms in the objective Eq. (2) then carry a gap. The denoising term carries the spread of the clean samples compatible with , the part of the expected denoising loss that no prediction removes (App. § 9.§ 1). The residual term can carry a nonzero residual at their average (Eq. (26)), since each sample is feasible but their average need not be. The two gaps differ in origin but not in effect. Each one implies a nonzero prediction error , and the comparison in § 3.1 depends on the model only through the distribution of , and once the residual cost is linearized and the error has no preferred direction, only through .
That is the whole role of the gap. At a feasible clean sample a prediction with zero error already minimizes both loss terms, so a nonzero error is needed before they can favor different predictions. The gap is one source of such error, so reducing it reduces both biases. Finite capacity, finite data and finite training are others, and they persist when the averaging is removed. A perfect one-step generator would carry no error and therefore no bias, while a real one is imperfect for those reasons, which is all the comparison requires. The gap also supplies no direction and the discussed biases are based on properties of the residual.
Derivation of the loss comparison
We derive Equation (5) from the per-sample loss of Equation (3). Fix a clean training sample and a noise level , and write the loss of a prediction as
As in § 3.1, let be a random perturbation with and , and let be a second center. We assume that and are finite.
Step 1: Losses of the two predictions. Substituting and gives
Step 2: Expanding the denoising square. Only the denoising term can be expanded, since is a general nonlinear map evaluated at the prediction,
The residual term is kept as it stands and is treated in § 3.2 by linearization.
Step 3: Taking expectations. The vector is deterministic and , so the cross term vanishes,
The expected losses are therefore
Step 4: Difference of the expected losses. The term appears in both expressions and is finite, so it cancels,
The magnitude of the perturbation therefore does not enter the comparison, only the difference in expected residual between the two centers.
Step 5: The condition for a lower loss around . The prediction around attains the lower expected loss if and only if . Moving the residual term to the other side gives
which is (5).
Step 6: Why the condition can hold. In contrast to the anchored case of App. § 11, the left-hand side is not sign-constrained. The residual is evaluated at the prediction, so the two centers are scored by the residual geometry at two different places, and the expected residual cost around can be smaller than the one around . The derivation uses neither nor and holds for every . Feasibility of the two centers enters only in § 3.2, where it removes the zeroth-order term from the expansion of the residual.
The centered-error assumption
The assumption enters at Step 3 alone. We repeat that step for a general perturbation with mean . The cross term is now , so (29) becomes
and the condition for a lower loss around reads
The right-hand side is no longer positive for every . Completing the square gives , so the condition is equivalent to
Two consequences follow. First, with the center is no longer the mean of the prediction, since has mean . The comparison then ranks predictions whose means are and , and the denoising term alone is minimized by the center that places the mean prediction on the target, , with value . This is a matter of bookkeeping rather than a bias, because once the error carries a mean the decomposition of a prediction into a center and an error is no longer unique. Second, the displacement cost in Equation (31) is then measured from and is negative throughout the open ball of radius around that point, so a center other than can appear preferable without the residual term contributing anything. Centering removes the ambiguity by making the center equal to the mean prediction, so that a preference for a center other than can come only from the residual term.
The same substitution applies to the anchored comparison. Repeating Step 3 of App. C with leaves
since both cross terms carry the factor . The function is a strictly convex quadratic with , vanishing only at , so is minimized uniquely at , the same center as for the denoising term alone. The mean error therefore shifts the reference center of both comparisons by the same amount and does not favor one objective over the other. Centering fixes that reference at , which is why it is assumed in § 3.1 rather than carried through every expression.
Derivation of the anchored comparison
We derive Equation (8) from the anchored per-sample loss. Fix a clean training sample and write and with , so that . The anchored loss of a prediction is
Both and depend only on , so they are the same for every prediction and do not depend on . As in § 3.1, let be a random perturbation with and , let be an arbitrary center, and write the displacement of the center as .
Step 1: Losses of the two predictions. Substituting and gives
Step 2: Expanding the squares. Expanding both squared norms in the first loss gives
Step 3: Taking expectations. All expectations are finite, since by the Cauchy–Schwarz inequality. Because and are deterministic and , both cross terms vanish:
The expected losses are therefore
Step 4: Difference of the expected losses. The terms and appear in both expressions and are finite, so they cancel in the difference:
Step 5: The condition for a lower loss around . The prediction around attains the lower expected loss if and only if . Moving the anchored term to the other side gives
which is Equation (8).
Step 6: The condition never holds. For , the left-hand side is at most zero, because it is the negative of a squared norm divided by . For , the right-hand side is strictly positive. The condition therefore fails for every , and equivalently for all . Hence is the unique minimizer of . The derivation uses neither nor any linearization of , so the result holds for every and is exact.
The conditional target of the anchored loss
Write
so that the residual term of Eq. (7) is with . For a fixed clean target the combined loss is minimized uniquely at , since its gradient is and the matrix is positive definite.
The comparison in § 4.1 fixes a clean target . The network, however, receives only the noisy input and the noise level . Several clean samples may be compatible with that input, so the best prediction minimizes the loss averaged over their conditional distribution. For ordinary squared-error denoising this prediction is the conditional mean . Anchoring can change this optimum because different clean samples may have different weighting matrices .
To see this, fix and let denote the network prediction. Assuming finite conditional second moments, its expected anchored loss is
At the optimum the average weighted prediction error must be zero. Differentiating with respect to and rearranging gives
The matrix on the left is positive definite, so this equation uniquely determines the shift from the ordinary denoising target.
For the optimum remains exactly when
The deviations average to zero by definition. The condition requires that they still average to zero after each is weighted by its sample’s matrix . A sufficient condition is that is the same for all clean samples in the conditional support. It can then be taken outside the expectation, leaving . This is what happens for a fixed affine residual , where and, at a feasible , the anchored residual equals the original one, , so does not depend on the sample. If the weighting varies across samples, the cancellation may fail and the optimal prediction can move away from .
For the latitude example of App. § 9.§ 6 with , and rotational symmetry give , so even the normalized anchored loss can increase the distance to the data in this conditional example.
Anchoring therefore removes the preference for moving toward another solution in the centered, fixed-perturbation comparison. It does not generally preserve the ordinary denoising optimum after averaging over possible clean targets.
Additional related work
Generative models for physical systems. Diffusion and flow matching models are increasingly used to learn distributions over physical states, with applications ranging from turbulent and aerodynamic flows [28] (Li et al. 2024) and inverse PDE problems [17] to particle physics [29] and the generation of molecules and proteins [33, 4, 10]. Unlike deterministic surrogates, they represent the full distribution of solutions, which makes them suited to uncertainty quantification and ensemble generation. The idea of enforcing physics through the training objective comes from physics-informed neural networks [30], which add the PDE residual to the loss of a deterministic model, and whose optimization is known to suffer from conflicts between the loss terms [23, 26].
The trade-off between physics and distribution. Baldan et al. [1] state that trade-off explicitly and report it as a Pareto front. They attribute part of it to the Jensen gap, which they narrow by unrolling several steps before the residual is evaluated, and they resolve the remaining disagreement between the two objectives at the level of the gradients, with a conflict-free update [26]. We locate that conflict and the resulting displacement in the residual term itself and change the loss, anchoring the residual at the clean training sample, which removes part of the conflict instead of balancing it. Also Yeom-Song et al. [44] argue that a residual regulariser breaks the distributional guarantees of the model and move the constraint into the forward pass instead. Chang et al. [6] also observe that the residual term can lead to a collapse onto smooth samples that are less sensitive under the residual, and they respond with a training scheme rather than with a different penalty, learning the distribution first and fine-tuning it under the residual afterwards, with the decoder that produces the coefficient field frozen so that the residual cannot change it. Yuan et al. [45] call the trade-off reward hacking and report a fine-tuned model that reaches the lowest residual and the most distorted field, which they contain by updating only part of the network and penalizing the drift of the weights away from the pretrained ones. Tauberschmidt et al. [38] steer a pretrained model toward the residual-tilted distribution and anchor it to the pretrained one, and report the same trade-off along that anchor, although their base model is trained on low-fidelity data, so for them the departure is intended. Xu et al. (2026) also relate the distortion to the sensitivity of the constraint, but for inference methods that enforce a hard constraint post hoc on a fixed pretrained model by projection or guidance and thereby omit a co-area factor . The works above and ours instead place the residual in the training objective. Prior work establishes that physical residual objectives can distort a learned distribution and motivates methods that restrict or balance their influence. Our contribution is to characterize sensitivity-dependent relocation through a controlled, fixed-perturbation comparison, distinguish feasibility from membership in the data support, and construct a target-anchored quadratic penalty that removes the relocation preference in this comparison. We also characterize the conditional-target shift that can remain after anchoring.
Experimental setup
Datasets
The shocked circle
What the dataset is for. We identify two conditions for the described distributional biases, (1) a residual cost that varies along the data and (2) a solution set larger than the data support. Both are properties of the pair . On a PDE they are hard to read off and cannot be varied one at a time. This dataset makes both explicit. The data are a circle, and the residual is satisfied on the whole sphere that contains this circle. A positive factor multiplying the residual changes the penalty an error incurs without changing a single feasible state, as visualized in Figure 5.

Figure 5. Data support and zero set of the residual, drawn in three dimensions for visualization. The residual is satisfied on the whole sphere, and the data are only the circle where the sphere meets the data plane. The experiments use .
Figure 6 summarizes the three cases. A prediction that belongs at a state where the residual is stiff can do three things. It can predict the sample as accurately as it is able and incur the penalty its error attracts there, which is the intended behaviour. It can move to a state at which the same error is penalized less, which is avoidance, and that state may lie on the data circle or off it. Or it can leave the data plane along the sphere, which reaches zero residual at a state the data never produce, and that is leakage. A penalty built from alone cannot distinguish either from success, because both land on .

Figure 6. The three things a penalized prediction can do, drawn in three dimensions. In black, where the sample should be, at a state where the residual is sensitive. (A) Correct prediction. (B) Leakage, which leaves the data plane and therefore the data support along the zero set, where . (C) Avoidance, where the prediction moves to a region of lower stiffness, which may or may not lie on the data support.
Data and residual. The data manifold is the unit circle in the first two coordinates of ,
Samples are with . The training set contains 20 000 such points. The residual is
a scalar, so . Since , the zero set is . Hence and . Eight directions lead from the data along the zero set, and the residual cannot see a sample drifting along any of them.
Why the stiffness is the residual cost. vanishes on all of , which contains , so the derivative of along the data vanishes and is purely radial. At a data point the factor eliminates the term. This leaves and hence exactly, which we verify numerically to . An error of size made at angle therefore produces a residual . The stiffness profile is not a proxy for the cost. It is the cost itself, and it can be read directly from Figure 7.
Figure 7. One data circle, two residuals. Top, the residual in the data plane, where the zero set is the same circle for both. Bottom, the residual cost along the data, which spans a factor of 101 for graded and is constant for flat.
The stiffness. In Eq. (36), is a sum of four von Mises–Fisher bumps on the direction ,
so the -th center meets the data circle at . Since for the geodesic angle , each bump is a Gaussian of angular width to leading order. Writing it in the dot product rather than in keeps finite at . The radial mask with satisfies and . It removes a tangential singularity that would otherwise carry at the origin. Without it we measure at . This matters because the -prediction lies near the origin at high noise. Since , the stiffness on is unchanged. Each bump is a localized spherical cap rather than a wedge constant along .
The two residuals. Both share the data and differ only in , so both have the same feasible set (Figure 7). graded places four sensitive regions of increasing strength on the circle. flat sets and is the plain hypersphere residual . Table 3 lists the parameters.
| graded | flat (control) | |
| heights | 4, 12, 35, 100 | — |
| widths | 0.10 | — |
| along | 2202 (101) | 2 (1) |
| bump HWHM | 4.8° | — |
Table 3. The two residual profiles of the shocked circle.
PDE datasets
Both datasets are generated with torchfsm [27] on with periodic boundary conditions and generator seed 42. Each contains 10 000 trajectories, split 90/10 into training and held-out data with a fixed seed.
Advection. , , and 255 steps, so each sample is a field spanning . The initial conditions are with , and . With probability 0.1 the initial condition is replaced by with a random sign, and with probability 0.1 it is multiplied by .
Burgers. , , and 255 steps, so each sample is a field spanning . The initial conditions are with and . They are made mean-free and rescaled to with . Every trajectory thus starts with comparable energy and zero mean, and the periodic dynamics conserve the mean.
Darcy. The domain is the unit square with grid points per axis, including the boundary, so and each sample is a pair of fields . The log-permeability is a Gaussian random field with covariance , , represented by its first 64 Karhunen–Loève modes with standard normal coefficients, and . The source is on and on , and zero elsewhere. For each , the pressure solves with zero-flux boundaries and zero mean, discretized with second-order finite differences and solved in the least-squares sense. We use the dataset of Bastek et al. [3], which contains 10 000 training and 1 000 held-out samples.
Residuals. The residuals are evaluated on the generated field . Time derivatives use second-order finite-difference stencils along the non-periodic time axis. For advection, with a second-order periodic spatial stencil. For Burgers, the spatial operators are spectral, consistent with the generating solver,
where is the 2/3 dealiasing filter. It is applied to the quadratic term only, so that aliasing errors do not appear as spurious residual. One-sided stencils near the boundary are excluded from the residual. For Burgers these are the first and last five time rows. For advection, the first and last five rows in time and in space are excluded. For Darcy, the residual is the strong form
with second-order finite-difference stencils.
Metrics
Let be the generated samples and the reference data samples.
Mean residual. With the residual entries not excluded at the boundary (App. § 14.1.2),
Maximum mean discrepancy. Each field is mapped to a vector of per-sample features , standardized with the mean and standard deviation of the features of the reference data, . With the Gaussian kernel , where is the median distance between all pairs of the pooled generated and reference features, we report the unbiased estimate [15]
set to zero if negative, with . On Advection and Burgers the features are , the total variation along summed over , and . On Darcy they are , , and the mean, standard deviation and correlation at a lag of 0.1 of .
Wasserstein distance. For two distributions and on with cumulative distribution functions and ([41, 34]),
Forward error. For darcy dataset, for a generated pair we solve with zero-flux boundaries, using the finite-difference system of the data generator, and report the median over samples of , where is the mean of . The pressure is defined only up to a constant under these boundary conditions, so the mean is removed. On the held-out data the forward error is , the precision of the stored fields.
Sensitivity ratio. The residual sensitivity of a state is the state-dependent part of the residual Jacobian,
where , , is estimated with two Jacobian–vector products ([19]). and the sensitivity ratio is
Amplitude ratio. With and ,
Distance to the data plane. For ,
reported as the median over the generated samples.
Transition-state metrics. Each generated structure with atomic positions is compared with the reference TS of the same reaction. The root mean square deviation measures differences in atomic positions,
computed after optimal rigid alignment of the two structures. The distance matrix absolute error measures the mean absolute difference in interatomic distances ,
and is invariant to rotations and translations. The energy difference , evaluated at the GFN2-xTB level, measures energetic agreement. The maximum force , with , measures the departure from stationarity on the potential energy surface (PES). The Hessian MAE, the mean absolute difference between the entries of the generated and reference Hessians, measures agreement in the local curvature of the PES. The valid TS rate is the percentage of generated structures whose Hessian has exactly one negative eigenvalue, as required for a first-order saddle point.
Implementation details
For each system, DM, PIDM and the anchored objective share the same denoiser, optimizer, noise schedule and training budget, and differ only in the physics term. The unpenalized baseline, denoted DM, sets in Eq. (2). All models use the clean-sample parameterization, so is the network output. The noise level is drawn uniformly, and the cosine variance schedule is used for . The penalty is applied to every sample at every training step, without thresholding or gating. Table 4 lists the settings.
| Shocked circle | Advection and Burgers | Darcy | |
| Denoiser | MLP | U-Net | U-Net |
| Architecture | , SiLU | channels 32, 64, 128, 256; 2 ResNet blocks per level, linear attention per level, attention in the bottleneck | as Burgers |
| Input channels | – | 1 () | 2 (, ) |
| Time input | , repeated to 64 dims | sinusoidal, then MLP (128) | sinusoidal, then MLP (128) |
| Trainable parameters | 1.09M | 8.9M | 8.9M |
| Diffusion steps | 1000 | 100 | 100 |
| Variance schedule | cosine | cosine | cosine |
| Denoising weight | |||
| Optimizer | Adam | Adam | Adam |
| Learning rate | |||
| Batch size | 512 | 8 | 8 |
| Iterations | 100 000 | 100 000 | 100 000 |
| Gradient clipping | 1.0 | 1.0 | 1.0 |
| EMA decay | 0.999 | 0.999 (Advection), none (Burgers) | none |
| Training samples | 20 000 | 8744 | 10 000 |
| Sampler | DDPM, 1000 steps | DDPM, 100 steps | DDPM, 100 steps |
| Generated samples | 40 000 | 1000 | 1000 |
| Seed | 0 | 0 | |
| GPU | RTX 4090 | A40 | A40 |
Table 4. Training and sampling settings. The same settings are used for DM, PIDM and the anchored objective.
Weights of the two loss terms. The denoising weight is , which makes the denoising term equal to the standard noise-prediction loss. On Advection and Burgers it is clipped, . For PIDM, the residual weight is the schedule of Bastek et al. [3], , where is the posterior variance of the forward process and its value at is replaced by that at . The anchored objective uses the denoising weight for both terms (Eq. (7)), so the ratio of the two terms is at every noise level.
Residual terms. On Advection and Burgers, both residual terms are averaged over the residual entries. PIDM uses . The anchored term is computed with one forward-mode Jacobian–vector product, with detached. The normalization is estimated with Hutchinson’s estimator using one Gaussian probe per sample and step, and it is excluded from the gradient. The constant in the denominator is . On the shocked circle the residual is scalar, so and its norm are computed exactly.
Training. We train with Adam, without weight decay or learning-rate schedule, and clip the gradient norm at 1. Every model is trained for 100 000 iterations and evaluated at its last checkpoint, without early stopping. On Advection, Darcy and Burgers, 256 of the 9000 training fields are held out as a stopping set and not used for training, so each model sees 8744 fields.
Sampling. Samples are generated with ancestral DDPM sampling over the full schedule, without noise in the last step.
Transition state generation. We follow the procedure of Darouich et al. [8]. As the surrogate potential, we use the EquiformerV2 HIP checkpoint (Burger et al., [5]) fine-tuned on GFN2-xTB Hessians of Transition1x-2p3p4p, which reaches a Hessian MAE of 3.51 kcal/mol/Å on this dataset. For TS generation, we start from the adapted OA-ReactDiff checkpoint of Darouich et al. [9], which covers elements beyond H, C, N, and O, and fine-tune it for 200 epochs with the React-OT flow matching loss at a learning rate of . From this shared starting point, FM, FM + residual, and FM + anchored are each trained for a further 200 epochs at the same learning rate, with a batch size of 16 on a single A100 GPU. Following Darouich et al. [8], both residual variants minimize
where is the reference TS, the single-step estimate of the clean endpoint, and the weight downweights the imprecise estimates obtained at high noise. Note that flow matching places the clean sample at , so here corresponds to in the main text. FM + residual uses the force predicted by HIP, , and FM + anchored uses the anchored penalty with the HIP Hessian at the reference TS, , which is precomputed once per training structure. For both variants, the weight and the exponent are optimized on the validation set using Bayesian optimization.
Training cost
Table 5 compares the training time of the three objectives. PIDM evaluates the residual at the prediction and differentiates through it. The anchored objective additionally needs one Jacobian–vector product at for and one for the estimate of .
On Advection and Burgers the anchored objective takes 2.5% and 1.5% more time per iteration than DM, and PIDM takes 1.0% and 0.4% more. There the step is dominated by the forward and backward pass of the U-Net, so the two additional Jacobian–vector products add little. Darcy has the smallest fields and the cheapest step, so the residual is a large share of it. There PIDM takes 38% more time than DM and the anchored objective 123% more, which is still less than a tenth of a Burgers step in absolute terms.
Additional results
Shocked circle
Figure 8 and Table 6 show the anchored objective on the graded circle at . Unlike PIDM, the anchored samples cover the circle uniformly at every weight, and their distance to the data plane stays at the level of DM, three to nine times smaller than that of PIDM. The anchored objective therefore does not lower the residual through avoidance or leakage, yet its residual is still below that of DM at every weight.
Figure 8. Anchored on the shocked circle at . Top, samples in the data plane with the residual sensitivity as shading. Bottom, angular density of the samples against the data (dashed) and (grey). The first column uses flat. Right, residual vs. distance to the data plane which measures leakage.
| ↓ | WD ↓ | ratio | ↓ | ||
| DM | – | 0.978 | |||
| PIDM | 0.582 | ||||
| PIDM | 0.356 | ||||
| PIDM | 0.231 | ||||
| PIDM | 1 | 0.201 | |||
| Anchored | 0.973 | ||||
| Anchored | 0.980 | ||||
| Anchored | 0.980 | ||||
| Anchored | 1 | 0.990 |
Table 6. Shocked circle, graded, . measures physical accuracy, WD (circular, on the angle) distributional accuracy, the ratio avoidance and the distance to the data plane leakage.
Burgers
The PIDM results fall into three regimes (Table 7). At and the physics term works as intended. The residual halves from 0.25 for DM to 0.11, at the price of smoother fields, with a ratio of 0.65 against 0.82 and an MMD of 0.57 against 0.12. From to the fields keep getting smoother and their amplitude shrinks, to a ratio of 0.075, but the residual no longer falls and varies between 0.15 and 0.41. The samples are then neither close to the data nor solutions of the PDE. A likely explanation is that during training the model only sees noisy versions of real fields, and on these inputs its residual does fall monotonically. During sampling, however, the model predicts an almost constant field from pure noise already in the first step for , so all later steps receive inputs it never saw in training (Figure 10). From on the residual drops below 0.04, but the MMD stays at 1.2. The model is collapsed and generates weak, smooth fields, which leave a small residual but no longer resemble the data. A low residual of PIDM is therefore no sign of better physics here. The ratio falls with the amplitude, from 0.65 to below 0.1, which is the avoidance predicted in § 3.
| MMD | ratio | std() ratio | ||
| DM | 0.25 | 0.12 | 0.82 | 0.81 |
| PIDM | ||||
| 0.11 | 0.57 | 0.65 | 0.64 | |
| 0.13 | 0.56 | 0.62 | 0.62 | |
| 0.25 | 0.95 | 0.46 | 0.45 | |
| 0.22 | 1.2 | 0.13 | 0.16 | |
| 0.15 | 1.3 | 0.13 | 9.1e-2 | |
| 0.41 | 1.4 | 7.5e-2 | 7.5e-2 | |
| 3.1e-2 | 1.2 | 0.31 | 0.33 | |
| 1 | 9.6e-3 | 1.2 | 9.5e-2 | 8.4e-2 |
| Anchored | ||||
| 0.23 | 0.37 | 0.71 | 0.70 | |
| 0.23 | 3.7e-2 | 0.91 | 0.90 | |
| 0.23 | 5.2e-2 | 0.89 | 0.88 | |
| 1 | 0.17 | 0.20 | 0.79 | 0.77 |
| 0.12 | 0.42 | 0.73 | 0.72 | |
| 0.11 | 0.44 | 0.72 | 0.71 | |
| 0.11 | 0.66 | 0.64 | 0.63 | |
| 0.11 | 0.67 | 0.65 | 0.64 |
Table 7. Burgers.
Figure 10. Sampling trajectories on Burgers. Each row is one model and each column one step of the sampler, from pure noise () to the final sample (). Every panel shows the model’s prediction at that step, and the number below it is the mean residual of that prediction. All rows start from the same noise and receive the same noise in every step, so the last column equals the corresponding fields in Figure 9.
Figure 9. Burgers fields generated a standard diffusion model vs. PIDM and anchored with increasing penalty weights using the same seed.
The anchored objective shows none of these regimes. At small weights it even counteracts the tendency of DM toward smooth, insensitive fields, visible in its ratio of 0.82. At and the ratio rises to 0.91 and 0.89, the ratio to 0.90 and 0.88, and the MMD falls to 0.037 and 0.052, while the residual still drops below that of DM (0.23 against 0.25). The anchored samples are thus more sensitive than those of DM and still more accurate. Figure 11 shows why. For DM the median residual grows with from 0.20 to 0.28, since the same error yields a larger residual at a more sensitive state. For the anchored objective it stays between 0.19 and 0.21 in every sensitivity range, below that of DM. Larger weights lower the residual to 0.11, the value PIDM reaches at its smallest weight. Beyond the residual of the anchored objective no longer improves, and its samples become smoother, as the shocks are where the residual is largest. This smoothing is weaker than that of PIDM, and the fields do not collapse. Up to the ratio stays between 0.63 and 0.72, while PIDM drops to 0.16 at and below 0.1 at larger weights. On Burgers anchoring thus avoids the shortcut, and only at large weights does it trade some sharpness for no further gain in residual.
Figure 11. Burgers samples by sensitivity . Top, per-sample residual of DM, the anchored objective () and PIDM (, left). Bottom, density of for the data and each model. PIDM generates only samples far less sensitive than the data, while the anchored samples are closer to the data than those of DM and have a lower residual in every sensitivity range.
Darcy
All detailed results are listed in Table 8. Up to PIDM lowers the residual from 6.0 for DM to 0.28, with an MMD at the level of DM (0.046 against 0.054, Table 8). At the pressure flattens, with a ratio of 0.64, the MMD rises to 0.20 and the residual stops falling (0.33). This is the failure predicted in § 3. At the comparable weight the anchored objective keeps the pressure, with a ratio of 0.92 and an MMD of 0.079, and reaches a lower residual of 0.24. Its run at has the lowest MMD of all runs (0.028) and a ratio of 0.99. At the largest weights both objectives flatten the pressure ( ratio 0.14 and 0.31).
Figure 12 shows generated pressure fields from the same starting noise. With increasing weight the PIDM pressure flattens, while the anchored samples keep the variation of the data at every weight.
Figure 12. Darcy pressure fields generated from the same starting noise by DM, PIDM and the anchored objective at two weights each.
Advection
We pair a PIDM weight with the anchored weight . On Advection the residual is linear, so the anchored term equals the PIDM term divided by the constant , and the remaining factor equalizes the average of the two noise-level weightings (App. § 14.§ 3).
References
- [1]Baldan, G., Liu, Q., Guardone, A., and Thuerey, N. (2026). Physics vs distributions: Pareto optimal flow matching with physics constraints. In International Conference on Learning Representations, volume 2026, pages 101215–101243.arxiv.org/abs/2506.08604
- [2]Bannwarth, C., Ehlert, S., and Grimme, S. (2019). Gfn2-xtb—an accurate and broadly parametrized self-consistent tight-binding quantum chemical method with multipole electrostatics and density-dependent dispersion contributions. Journal of chemical theory and computation, 15(3):1652–1671.DOI
- [3]Bastek, J.-H., Sun, W., and Kochmann, D. (2025). Physics-informed diffusion models. In International Conference on Learning Representations, volume 2025, pages 3360–3385.arxiv.org/abs/2403.14404
- [4]Bose, J., Akhound-Sadegh, T., Huguet, G., Fatras, K., Rector-Brooks, J., Liu, C., Nica, A., Korablyov, M., Bronstein, M., and Tong, A. (2024). Se (3)-stochastic flow matching for protein backbone generation. In International Conference on Learning Representations, volume 2024, pages 22590–22621.arxiv.org/abs/2310.02391
- [5]Burger, A., Thiede, L., Rønne, N., Bernales, V., Vijaykumar, N., Vegge, T., Bhowmik, A., and Aspuru-Guzik, A. (2025). Shoot from the hip: Hessian interatomic potentials without derivatives. arXiv preprint arXiv:2509.21624.arxiv.org/abs/2509.21624
- [6]Chang, C.-C., Dai, C.-Y., Lin, T.-S., Lai, M.-C., and Lai, C.-H. (2026). Stabilizing physics-informed consistency models via structure-preserving training. In Proceedings of the 32nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining V. 2, pages 10555–10566.DOI
- [7]Cheng, C., Han, B., Maddix, D., Ansari, A. F., Stuart, A., Mahoney, M. W., and Wang, B. (2025). Gradient-free generation for hard-constrained systems. In International Conference on Learning Representations, volume 2025, pages 100510–100539.arxiv.org/abs/2412.01786
- [8]Darouich, S., Geisler, J., Toney, J. W., Bien, T., Kästner, J., Kulik, H. J., and Niepert, M. (2026a). Curvature-aware flow matching for molecular structure generation. arXiv preprint arXiv:2609.34592.arxiv.org/abs/2609.34592
- [9]Darouich, S., Toney, J. W., Luo, W., Kästner, J., Niepert, M., and Kulik, H. J. (2026b). Robust generative transition-state models for unseen chemistry. Nature Computational Science, pages 1–11.DOI
- [10]Darouich, S., Tong, V., Bien, T., Kästner, J., and Niepert, M. (2026c). Adaptive transition-state refinement with learned equilibrium flows. Journal of Chemical Information and Modeling, 66(4):2154–2165.
- [11]Duan, C., Liu, G.-H., Du, Y., Chen, T., Zhao, Q., Jia, H., Gomes, C. P., Theodorou, E. A., and Kulik, H. J. (2025). Optimal transport for generating transition states in chemical reactions. Nature Machine Intelligence, 7(4):615–626.DOI
- [12]Feng, B., Baptista, R., and Bouman, K. (2025). Neural approximate mirror maps for constrained diffusion models. In International Conference on Learning Representations, volume 2025, pages 55155–55178.arxiv.org/abs/2406.12816
- [13]Gallon, D., von Wurstenberger, P., Cheridito, P., and Jentzen, A. (2026). Physics-informed diffusion models in spectral space. In Forty-third International Conference on Machine Learning.arxiv.org/abs/2602.09708
- [14]Geyfman, D., Draxler, F., Groeneveld, J. N., Lee, H., Karaletsos, T., and Mandt, S. (2026). Calibrated test-time guidance for Bayesian inference. In Proceedings of the 43rd International Conference on Machine Learning, volume 306, pages 34639–34666.arxiv.org/abs/2602.22428
- [15]Gretton, A., Borgwardt, K. M., Rasch, M. J., Schölkopf, B., and Smola, A. (2012). A kernel two-sample test. The journal of machine learning research, 13:723–773.DOI
- [17]Holzschuh, B., Vegetti, S., and Thuerey, N. (2023). Solving inverse physics problems with score matching. Advances in Neural Information Processing Systems, 36:61888–61922.arxiv.org/abs/2301.10250
- [18]Huang, J., Yang, G., Wang, Z., and Park, J. J. (2024). Diffusionpde: Generative pde-solving under partial observation. Advances in Neural Information Processing Systems, 37:130291–130323.arxiv.org/abs/2406.17763
- [19]Hutchinson, M. F. (1989). A stochastic estimator of the trace of the influence matrix for laplacian smoothing splines. Communications in Statistics-Simulation and Computation, 18(3):1059–1076.
- [20]Jacobsen, C., Zhuang, Y., and Duraisamy, K. (2025). Cocogen: Physically consistent and conditioned score-based generative models for forward and inverse problems. SIAM Journal on Scientific Computing, 47(2):C399–C425.arxiv.org/abs/2312.10527
- [21]Karras, T., Aittala, M., Aila, T., and Laine, S. (2022). Elucidating the design space of diffusion-based generative models. Advances in neural information processing systems, 35:26565–26577.arxiv.org/abs/2206.00364
- [22]Kong, C. X., Wang, Y., Zheng, H., Luo, W., and Lin, G. (2026). Ultra fast pde solving via physics guided few-step diffusion. arXiv preprint arXiv:2602.03627.arxiv.org/abs/2602.03627
- [23]Krishnapriyan, A., Gholami, A., Zhe, S., Kirby, R., and Mahoney, M. (2021). Characterizing possible failure modes in physics-informed neural networks. Advances in neural information processing systems, 34:26548–26560.arxiv.org/abs/2109.01050
- [25]Liu, G.-H., Chen, T., Theodorou, E., and Tao, M. (2023). Mirror diffusion models for constrained and watermarked generation. Advances in Neural Information Processing Systems, 36:42898–42917.arxiv.org/abs/2310.01236
- [26]Liu, Q., Chu, M., and Thuerey, N. (2025a). Config: Towards conflict-free training of physics informed neural networks. In International Conference on Learning Representations, volume 2025, pages 59531–59566.arxiv.org/abs/2408.11104
- [27]Liu, Q., Koehler, F., and Thuerey, N. (2025b). Torchsmi: Fourier spectral method with pytorch.
- [28]Liu, Q. and Thuerey, N. (2024). Uncertainty-aware surrogate models for airfoil flow simulations with denoising diffusion probabilistic models. AIAA Journal, 62(8):2912–2933.DOI
- [29]Mikuni, V., Nachman, B., and Pettee, M. (2023). Fast point cloud generation with diffusion models in high energy physics. Physical Review D, 108(3):036025.DOI
- [30]Raissi, M., Perdikaris, P., and Karniadakis, G. E. (2019). 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.DOI
- [31]Rixner, M. and Koutsourelakis, P.-S. (2021). A probabilistic generative model for semi-supervised training of coarse-grained surrogates and enforcing physical constraints through virtual observables. Journal of Computational Physics, 434:110218.DOI
- [32]Sawhney, M., Neog, A., Khurana, M., and Karpatne, A. (2025). Beyond loss guidance: Using pde residuals as spectral attention in diffusion neural operators. arXiv preprint arXiv:2512.01370.
- [33]Schneuing, A., Harris, C., Du, Y., Didi, K., Jamash, A., Igashov, I., Du, W., Gomes, C., Blundell, T. L., Lio, P., Welling, M., Bronstein, M., and Correia, B. (2024). Structure-based drug design with equivariant diffusion models. Nature Computational Science, 4(12):899–909.DOI
- [34]SciPy (2025). Wasserstein distance. https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.wasserstein_distance.html#wasserstein-distance1.
- [35]Shu, D., Li, Z., and Farimani, A. B. (2023). A physics-informed diffusion model for high-fidelity flow field reconstruction. Journal of Computational Physics, 478:111972.DOI
- [36]Song, Y., Sohl-Dickstein, J., Kingma, D. P., Kumar, A., Ermon, S., and Poole, B. (2021). Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations.
- [37]Srivastava, P., Yang, R., Kerrigan, G., Dresner, G., McGibbon, J., Bretherton, C., and Mandt, S. (2024). Precipitation downscaling with spatiotemporal video diffusion. In Advances in Neural Information Processing Systems, volume 37, pages 56374–56400.arxiv.org/abs/2312.06071
- [38]Tauberschmidt, J., Fellenz, S., Vollmer, S., and Duncan, A. (2026). Physics-constrained fine-tuning of flow-matching models for generation and inverse problems. In International Conference on Learning Representations, volume 2026, pages 143992–144037.arxiv.org/abs/2508.09156
- [39]Tong, V., Hoang, T.-D., Liu, A., Van den Broeck, G., and Niepert, M. (2025). Rao-Blackwell gradient estimators for equivariant denoising diffusion. In Advances in Neural Information Processing Systems, volume 38.
- [40]Utkarsh, U., Cai, P., Edelman, A., Gomez-Bombarelli, R., and Rackauckas, C. (2025). Physics-constrained flow matching: Sampling generative models with hard constraints. Advances in Neural Information Processing Systems, pages 160217–160252.arxiv.org/abs/2506.04171
- [41]Villani, C. (2009). Optimal transport: old and new. Springer.
- [44]Yeom-Song, V. M., Rissanen, S., Solin, A., Kaski, S., and Sun, M. (2025). Softly constrained denoisers for diffusion models. In NeurIPS 2025 AI for Science Workshop.
- [45]Yuan, M., Jin, P., Li, N., and Li, Q. (2025). PIRF: Physics-informed reward fine-tuning for diffusion models. In NeurIPS 2025 AI for Science Workshop.arxiv.org/abs/2509.20570
- [46]Zeng, T., Wang, T., Zhang, J., Zou, Y., Wang, Y., Jiao, J., Claudel, C., and Chenxinbo (2025). Physics-informed learning via diffusion framework for system state estimation. In UrbanAI: Harnessing Artificial Intelligence for Smart Cities.
- [47]Zhang, Y., Wang, P., and Zou, D. (2026). Physics-informed distillation of diffusion models for PDE-constrained generation. In Forty-third International Conference on Machine Learning.arxiv.org/abs/2505.22391









