Papers
Topics
Authors
Recent
Search
2000 character limit reached

Structure-Preserving Weak-Form Loss

Updated 9 July 2026
  • Structure-preserving weak-form loss is a family of learning objectives that replaces pointwise residuals with integral formulations to maintain key governing relations.
  • It leverages variational principles by integrating against test functions, enabling conservation laws and energy balances to be preserved during learning.
  • This approach enhances robustness to noise and discontinuities, making it effective in scientific machine learning, Hamiltonian learning, and numerical PDE solvers.

Taken together, these works suggest that structure-preserving weak-form loss is best understood as a family of learning objectives that enforce governing relations in weak, variational, or otherwise non-pointwise form while preserving problem-specific structure. In scientific machine learning, this usually means replacing pointwise strong-form residuals by integral residuals against test functions, often with integration by parts, domain decomposition, and explicit regularization by initial or boundary conditions (Xu et al., 2020). In adjacent literatures, the same design principle appears as energy-preserving or Lyapunov-preserving losses, thermodynamically constrained weak-form estimators, Hamiltonian regression restricted to vector fields of the form JhJ\nabla h, equality-constrained mixed-form surrogates, and differentiable geometric penalties that preserve panel and seam structure in garment models (Gao et al., 2024, Chu et al., 2024, Park et al., 3 Apr 2026, Hu et al., 2024, Zhang et al., 10 Jun 2026, Chen et al., 2022).

1. Weak-form foundations and the shift away from pointwise residuals

Before weak-form losses became common in learned models, weak formulations were already the standard route for preserving structure in numerical discretization. In port-Hamiltonian systems, a weak formulation of the underlying geometric Stokes-Dirac structure, combined with mixed Galerkin discretization and power-preserving linear maps, yields a family of structure-preserving schemes that allows trade-offs between centered approximations and upwinding (Kotyczka et al., 2017). In finite element compilation, TSFC was explicitly designed to maintain the structure of the input weak form as long as possible, separating the lowering of finite element constructs to tensor algebra from the scheduling of tensor operations (Homolya et al., 2017).

Within learning systems, the main contrast is between strong-form and weak-form enforcement. Strong-form losses penalize PDE residuals at collocation points, but they are reported to deteriorate when high-order derivatives are present or when the solution contains strong discontinuities (Xu et al., 2020). Weak-form constructions multiply the governing equation by test functions and integrate over the domain or subdomains, so that integration by parts can move derivatives from the learned field to analytically chosen test functions (Xu et al., 2020). A closely related argument appears in weak-form PINNs and quantum PINNs: weak forms impose a global condition on the solution and prioritize good average behavior instead of “overfitting” select points (Paine et al., 9 Feb 2026).

This shift is not only numerical. It changes what the loss treats as primary: not pointwise exactness, but preservation of a variational identity, a conservation law, an energy balance, or a topological assembly relation.

2. Canonical constructions of weak-form loss

A standard template appears in theory-guided neural networks. For a PDE Lpu(x,t)=f(x,t)\mathcal{L}_p u(x,t)=f(x,t), TgNN-wf defines, on each collocation subdomain Ωi×Δti\Omega_i\times\Delta t_i,

τwfi=Ωi×Δti[LpuNN(x,t)wi(x,t)f(x,t)wi(x,t)]dΩdt,\tau_{wf_i}=\int_{\Omega_i\times\Delta t_i}\left[\mathcal{L}_p u_{NN}(x,t)\,w_i(x,t)-f(x,t)\,w_i(x,t)\right]\,d\Omega\,dt,

and then combines the weak residual with data, initial-condition, and boundary-condition terms as

LTgNNwf(W,b)=λdRdata+λfRwf+λICRIC+λBCRBC.L_{TgNN-wf}(W,b)=\lambda_d\mathcal{R}_{data}+\lambda_f\mathcal{R}_{wf}+\lambda_{IC}\mathcal{R}_{IC}+\lambda_{BC}\mathcal{R}_{BC}.

The method uses domain decomposition with locally defined test functions, and Gauss-Legendre quadrature is used for numerical evaluation of the integrals (Xu et al., 2020).

A second template is the self-test loss for operators linear in unknown parameters. With self-testing functions vϕ[u]v_\phi[u] satisfying linearity, symmetry, and positivity, the loss is

ED(ϕ)=l=1L(Rϕ[ul],vϕ[ul]2fl,vϕ[ul]+C0).\mathcal{E}_\mathcal{D}(\phi)=\sum_{l=1}^L\Big(\langle R_\phi[u_l],v_\phi[u_l]\rangle-2\langle f_l,v_\phi[u_l]\rangle+C_0\Big).

Because both RϕR_\phi and vϕv_\phi are linear in ϕ\phi, the loss is quadratic; the paper emphasizes identifiability, well-posedness, and efficient regression algorithms, and shows that the construction conserves energy for gradient flows and coincides with the expected log-likelihood ratio for stochastic differential equations (Gao et al., 2024).

A third template is hybridization. In weak-form PI and PI-QML, local collocation and global weak-form terms are combined as

Lpu(x,t)=f(x,t)\mathcal{L}_p u(x,t)=f(x,t)0

with the explicit goal of exploiting the advantages and mitigating the weaknesses of both local and global formulations (Paine et al., 9 Feb 2026).

For PDE discovery, Weak-PDE-LEARN uses a neural approximation Lpu(x,t)=f(x,t)\mathcal{L}_p u(x,t)=f(x,t)1 of the solution and a trainable coefficient vector Lpu(x,t)=f(x,t)\mathcal{L}_p u(x,t)=f(x,t)2, with total loss

Lpu(x,t)=f(x,t)\mathcal{L}_p u(x,t)=f(x,t)3

where Lpu(x,t)=f(x,t)\mathcal{L}_p u(x,t)=f(x,t)4 is built from the weak form after transferring derivatives to weight functions by repeated integration by parts (Stephany et al., 2023).

3. What is being preserved

The “structure” in structure-preserving weak-form loss is not uniform across domains. It can refer to conservation, dissipation, symplecticity, thermodynamic admissibility, divergence constraints, topology, or manufacturing relations.

In gradient-flow settings, the preserved quantity is often energy dissipation. The self-test construction uses the first variation of the energy as the test function, and at the minimizer the data’s energy change equals the modeled dissipation (Gao et al., 2024). In SP-PINN, the Allen–Cahn equation is augmented with a structure-preserving loss

Lpu(x,t)=f(x,t)\mathcal{L}_p u(x,t)=f(x,t)5

where Lpu(x,t)=f(x,t)\mathcal{L}_p u(x,t)=f(x,t)6 is a discrete global energy; the loss penalizes increases of energy and enforces Lpu(x,t)=f(x,t)\mathcal{L}_p u(x,t)=f(x,t)7 (Chu et al., 2024).

In thermodynamic modeling, WGFINNs preserve the GENERIC degeneracy and symmetry conditions exactly by construction while replacing strong-form fitting by weak-form fitting. The paper states that strong-form estimators diverge as the time step decreases in the presence of noise, whereas weak-form estimators can remain accurate if test functions satisfy certain conditions (Park et al., 3 Apr 2026).

In Hamiltonian learning, structure preservation means restricting the learned vector field to Hamiltonian form. The kernel estimator solves

Lpu(x,t)=f(x,t)\mathcal{L}_p u(x,t)=f(x,t)8

so every learned vector field is Hamiltonian by construction (Hu et al., 2024).

In mixed finite element surrogates, structure preservation can be a hard equality constraint. Structure-preserving neural surrogates with tractable uncertainty quantification enforce the discrete conservation law

Lpu(x,t)=f(x,t)\mathcal{L}_p u(x,t)=f(x,t)9

in compatible Ωi×Δti\Omega_i\times\Delta t_i0–Ωi×Δti\Omega_i\times\Delta t_i1 spaces built from Raviart–Thomas and Ωi×Δti\Omega_i\times\Delta t_i2 elements, and pose training as an optimal recovery problem with equality constraints (Zhang et al., 10 Jun 2026).

In optimal control of Maxwell’s equations, the preserved structure includes the de Rham structure, a discrete Gauss law, and a per-time-step energy balance, inherited by a discrete optimization scheme built on the weak form of the forward problem (Antil et al., 30 Apr 2026).

Setting Mechanism Preserved structure
TgNN-wf Weak residual on subdomains PDE consistency under discontinuities
Self-test loss Parameter-dependent test functions Energy dissipation, likelihood structure
WGFINNs Weak-form loss + GENERIC architecture Degeneracy and symmetry conditions
Kernel Hamiltonian learning Loss on Ωi×Δti\Omega_i\times\Delta t_i3 Hamiltonian vector-field form
Mixed FEM surrogate Equality-constrained ORP Discrete conservation law
Neural Sewing Machine Inner/inter-panel losses Panel isometry and seam topology

This variety indicates that weak-form loss is less a single formula than a design pattern: structural constraints are encoded at the level where the governing model is naturally variational, integral, or relational.

4. Representative implementations

A particularly direct implementation appears in differentiable finite element correction. Instead of adding a black-box strong-form source term, the correction is inserted directly into the variational form through learned bilinear operators. For incompressible Navier–Stokes, the corrected weak form modifies the viscosity, convection scaling, and grad-div stabilization coefficients; for the 1D convection–diffusion equation, the correction is applied to the flux. The paper argues that this aligns the learned model with the finite element discretization, preserves key numerical structure, and better respects the fundamental properties of incompressible flow (Jung et al., 27 Jan 2026).

In weak-form PDE discovery, the central implementation choice is to never differentiate the learned solution or the noisy data directly. Instead, all derivatives are transferred to smooth weight functions, and the learning problem becomes simultaneous approximation of the solution Ωi×Δti\Omega_i\times\Delta t_i4 and the PDE coefficients Ωi×Δti\Omega_i\times\Delta t_i5 from the linear system Ωi×Δti\Omega_i\times\Delta t_i6 induced by the weak form (Stephany et al., 2023).

For PI and PI-QML, implementation details emphasize test-function choice, numerical integration, and boundary handling. The weak form may be evaluated by quadrature or Monte Carlo; integration by parts introduces boundary terms; and collocation is identified as the special case Ωi×Δti\Omega_i\times\Delta t_i7, which turns the weak form back into a local point test (Paine et al., 9 Feb 2026).

Outside PDE learning, Neural Sewing Machine provides a geometrically explicit example of weak-form, differentiable structure preservation. Its inner-panel structure-preserving loss

Ωi×Δti\Omega_i\times\Delta t_i8

encourages local isometry within each panel, while its inter-panel structure-preserving loss

Ωi×Δti\Omega_i\times\Delta t_i9

penalizes discrepancies along stitched edges. The full training loss is

τwfi=Ωi×Δti[LpuNN(x,t)wi(x,t)f(x,t)wi(x,t)]dΩdt,\tau_{wf_i}=\int_{\Omega_i\times\Delta t_i}\left[\mathcal{L}_p u_{NN}(x,t)\,w_i(x,t)-f(x,t)\,w_i(x,t)\right]\,d\Omega\,dt,0

The paper describes these constraints as enforcing structural relationships in a weak-form, differentiable manner (Chen et al., 2022).

5. Empirical behavior and comparative evidence

Across the literature, weak-form losses are repeatedly associated with improved robustness under high-order derivatives, discontinuities, or noisy data. TgNN-wf reports higher accuracy than strong-form TgNN in both hydraulic head prediction for unsteady-state 2D single-phase flow and saturation profile prediction for 1D two-phase flow, with the advantage becoming especially pronounced when strong discontinuity is present. It also trains faster than TgNN when the number of integration subdomains is not too large, specifically below τwfi=Ωi×Δti[LpuNN(x,t)wi(x,t)f(x,t)wi(x,t)]dΩdt,\tau_{wf_i}=\int_{\Omega_i\times\Delta t_i}\left[\mathcal{L}_p u_{NN}(x,t)\,w_i(x,t)-f(x,t)\,w_i(x,t)\right]\,d\Omega\,dt,1, and is reported to be more robust to noises (Xu et al., 2020).

Hybrid weak-form plus collocation losses are motivated by an empirical asymmetry: collocation only can fit the DE at sampled points but may fail to propagate boundary conditions and may converge to trivial solutions; weak-form only captures global behavior but may miss local features; the combined loss is reported to outperform both, particularly with domain decomposition (Paine et al., 9 Feb 2026).

Weak-PDE-LEARN reports recovery of Burgers’ equation and the KdV equation with up to τwfi=Ωi×Δti[LpuNN(x,t)wi(x,t)f(x,t)wi(x,t)]dΩdt,\tau_{wf_i}=\int_{\Omega_i\times\Delta t_i}\left[\mathcal{L}_p u_{NN}(x,t)\,w_i(x,t)-f(x,t)\,w_i(x,t)\right]\,d\Omega\,dt,2 noise and the Kuramoto–Sivashinsky equation with up to τwfi=Ωi×Δti[LpuNN(x,t)wi(x,t)f(x,t)wi(x,t)]dΩdt,\tau_{wf_i}=\int_{\Omega_i\times\Delta t_i}\left[\mathcal{L}_p u_{NN}(x,t)\,w_i(x,t)-f(x,t)\,w_i(x,t)\right]\,d\Omega\,dt,3 noise, with graceful degradation under increasingly limited or noisy measurements (Stephany et al., 2023). WGFINNs similarly report that weak-form training consistently outperforms strong-form GFINNs at varying noise levels while retaining exact satisfaction of the GENERIC constraints (Park et al., 3 Apr 2026).

In differentiable finite element correction, the quantitative gap between weak-form and strong-form augmentation is explicit. For the 1D convection–diffusion equation, the time-averaged relative error is reported as τwfi=Ωi×Δti[LpuNN(x,t)wi(x,t)f(x,t)wi(x,t)]dΩdt,\tau_{wf_i}=\int_{\Omega_i\times\Delta t_i}\left[\mathcal{L}_p u_{NN}(x,t)\,w_i(x,t)-f(x,t)\,w_i(x,t)\right]\,d\Omega\,dt,4 for weak-form correction, compared with τwfi=Ωi×Δti[LpuNN(x,t)wi(x,t)f(x,t)wi(x,t)]dΩdt,\tau_{wf_i}=\int_{\Omega_i\times\Delta t_i}\left[\mathcal{L}_p u_{NN}(x,t)\,w_i(x,t)-f(x,t)\,w_i(x,t)\right]\,d\Omega\,dt,5 for strong-form correction and τwfi=Ωi×Δti[LpuNN(x,t)wi(x,t)f(x,t)wi(x,t)]dΩdt,\tau_{wf_i}=\int_{\Omega_i\times\Delta t_i}\left[\mathcal{L}_p u_{NN}(x,t)\,w_i(x,t)-f(x,t)\,w_i(x,t)\right]\,d\Omega\,dt,6 for the baseline, at similar speedups of about τwfi=Ωi×Δti[LpuNN(x,t)wi(x,t)f(x,t)wi(x,t)]dΩdt,\tau_{wf_i}=\int_{\Omega_i\times\Delta t_i}\left[\mathcal{L}_p u_{NN}(x,t)\,w_i(x,t)-f(x,t)\,w_i(x,t)\right]\,d\Omega\,dt,7. For 2D incompressible Navier–Stokes, the weak-form correction achieves τwfi=Ωi×Δti[LpuNN(x,t)wi(x,t)f(x,t)wi(x,t)]dΩdt,\tau_{wf_i}=\int_{\Omega_i\times\Delta t_i}\left[\mathcal{L}_p u_{NN}(x,t)\,w_i(x,t)-f(x,t)\,w_i(x,t)\right]\,d\Omega\,dt,8 for short-term prediction and τwfi=Ωi×Δti[LpuNN(x,t)wi(x,t)f(x,t)wi(x,t)]dΩdt,\tau_{wf_i}=\int_{\Omega_i\times\Delta t_i}\left[\mathcal{L}_p u_{NN}(x,t)\,w_i(x,t)-f(x,t)\,w_i(x,t)\right]\,d\Omega\,dt,9 for long-term prediction, whereas the strong-form correction degrades to LTgNNwf(W,b)=λdRdata+λfRwf+λICRIC+λBCRBC.L_{TgNN-wf}(W,b)=\lambda_d\mathcal{R}_{data}+\lambda_f\mathcal{R}_{wf}+\lambda_{IC}\mathcal{R}_{IC}+\lambda_{BC}\mathcal{R}_{BC}.0 on the long horizon; both methods retain a speedup of about LTgNNwf(W,b)=λdRdata+λfRwf+λICRIC+λBCRBC.L_{TgNN-wf}(W,b)=\lambda_d\mathcal{R}_{data}+\lambda_f\mathcal{R}_{wf}+\lambda_{IC}\mathcal{R}_{IC}+\lambda_{BC}\mathcal{R}_{BC}.1, and the weak-form correction reaches a minimum training loss about LTgNNwf(W,b)=λdRdata+λfRwf+λICRIC+λBCRBC.L_{TgNN-wf}(W,b)=\lambda_d\mathcal{R}_{data}+\lambda_f\mathcal{R}_{wf}+\lambda_{IC}\mathcal{R}_{IC}+\lambda_{BC}\mathcal{R}_{BC}.2–LTgNNwf(W,b)=λdRdata+λfRwf+λICRIC+λBCRBC.L_{TgNN-wf}(W,b)=\lambda_d\mathcal{R}_{data}+\lambda_f\mathcal{R}_{wf}+\lambda_{IC}\mathcal{R}_{IC}+\lambda_{BC}\mathcal{R}_{BC}.3 lower than strong-form correction (Jung et al., 27 Jan 2026).

Neural Sewing Machine provides a structurally different but instructive ablation. Using only LTgNNwf(W,b)=λdRdata+λfRwf+λICRIC+λBCRBC.L_{TgNN-wf}(W,b)=\lambda_d\mathcal{R}_{data}+\lambda_f\mathcal{R}_{wf}+\lambda_{IC}\mathcal{R}_{IC}+\lambda_{BC}\mathcal{R}_{BC}.4 yields MGLE LTgNNwf(W,b)=λdRdata+λfRwf+λICRIC+λBCRBC.L_{TgNN-wf}(W,b)=\lambda_d\mathcal{R}_{data}+\lambda_f\mathcal{R}_{wf}+\lambda_{IC}\mathcal{R}_{IC}+\lambda_{BC}\mathcal{R}_{BC}.5 cm; adding LTgNNwf(W,b)=λdRdata+λfRwf+λICRIC+λBCRBC.L_{TgNN-wf}(W,b)=\lambda_d\mathcal{R}_{data}+\lambda_f\mathcal{R}_{wf}+\lambda_{IC}\mathcal{R}_{IC}+\lambda_{BC}\mathcal{R}_{BC}.6 alone gives MGLE LTgNNwf(W,b)=λdRdata+λfRwf+λICRIC+λBCRBC.L_{TgNN-wf}(W,b)=\lambda_d\mathcal{R}_{data}+\lambda_f\mathcal{R}_{wf}+\lambda_{IC}\mathcal{R}_{IC}+\lambda_{BC}\mathcal{R}_{BC}.7 cm; adding LTgNNwf(W,b)=λdRdata+λfRwf+λICRIC+λBCRBC.L_{TgNN-wf}(W,b)=\lambda_d\mathcal{R}_{data}+\lambda_f\mathcal{R}_{wf}+\lambda_{IC}\mathcal{R}_{IC}+\lambda_{BC}\mathcal{R}_{BC}.8 reduces MGLE to LTgNNwf(W,b)=λdRdata+λfRwf+λICRIC+λBCRBC.L_{TgNN-wf}(W,b)=\lambda_d\mathcal{R}_{data}+\lambda_f\mathcal{R}_{wf}+\lambda_{IC}\mathcal{R}_{IC}+\lambda_{BC}\mathcal{R}_{BC}.9 cm; and adding vϕ[u]v_\phi[u]0 further improves MGLE to vϕ[u]v_\phi[u]1 cm. The paper emphasizes that Chamfer and P2S change little, which indicates that those pointwise geometric metrics do not reflect structural preservation or topology correctness (Chen et al., 2022).

6. Misconceptions, limitations, and active directions

One recurrent misconception is that weak-form loss is simply a smoothed version of collocation. In the PI-QML formulation, collocation is instead characterized as the special case of the weak form with Dirac-delta test functions, so the distinction is structural rather than cosmetic (Paine et al., 9 Feb 2026).

A second misconception is that weak-form loss is automatically structure-preserving. The self-test paper makes the opposite point: the construction of loss functions for weak-form operators is itself a major challenge, particularly because test functions must be selected appropriately. Traditional weak-form losses use a pre-selected family of test functions and do not, in general, guarantee preservation of structures such as energy or likelihood; the self-test construction was introduced precisely to address that gap (Gao et al., 2024).

A third misconception is that weak-form enforcement alone is always sufficient. Several papers argue for combinations with data terms, initial and boundary regularization, or local residual terms. TgNN-wf adds data, initial-condition, and boundary-condition penalties to the weak residual (Xu et al., 2020). Hybrid PI-QML explicitly combines local and global losses because weak-form loss may miss local features while pure collocation may fail globally (Paine et al., 9 Feb 2026).

These works also show that “structure-preserving” may be realized in different ways: by soft penalty, as in SP-PINN or Neural Sewing Machine; by hard equality constraint, as in mixed-form neural surrogates; or by architectural construction, as in WGFINNs and Hamiltonian kernel regression (Chu et al., 2024, Chen et al., 2022, Zhang et al., 10 Jun 2026, Park et al., 3 Apr 2026, Hu et al., 2024). A plausible implication is that the field is moving toward losses that are not merely weak-form in the variational sense, but also aligned with the underlying thermodynamic, geometric, topological, or manufacturing structure of the problem.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

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

Follow Topic

Get notified by email when new papers are published related to Structure-Preserving Weak-Form Loss.