Learning Under Laws: A Constraint-Projected Neural PDE Solver that Eliminates Hallucinations
Mainak Singha
TL;DR
This work addresses the problem that neural PDE solvers can violate fundamental physical laws during learning. It proposes Constraint-Projected Learning (CPL), which enforces physical admissibility by projecting gradient updates onto the intersection $\mathcal{C}$ of constraints including conservation, Rankine–Hugoniot, entropy, and positivity, with differentiable projections and modest overhead. Augmenting CPL with Total-Variation Damping (TVD) and a rollout curriculum yields both hard and soft violations suppression, achieving machine-precision conservation and stable long-horizon behavior on Burgers and Euler systems. The approach is architecturally universal and practically impactful, enabling neural solvers that respect the laws of physics from training through long-time predictions, reducing hallucinations and enhancing reliability for scientific computing tasks where physical fidelity is critical.
Abstract
Neural networks can approximate solutions to partial differential equations, but they often break the very laws they are meant to model-creating mass from nowhere, drifting shocks, or violating conservation and entropy. We address this by training within the laws of physics rather than beside them. Our framework, called Constraint-Projected Learning (CPL), keeps every update physically admissible by projecting network outputs onto the intersection of constraint sets defined by conservation, Rankine-Hugoniot balance, entropy, and positivity. The projection is differentiable and adds only about 10% computational overhead, making it fully compatible with back-propagation. We further stabilize training with total-variation damping (TVD) to suppress small oscillations and a rollout curriculum that enforces consistency over long prediction horizons. Together, these mechanisms eliminate both hard and soft violations: conservation holds at machine precision, total-variation growth vanishes, and entropy and error remain bounded. On Burgers and Euler systems, CPL produces stable, physically lawful solutions without loss of accuracy. Instead of hoping neural solvers will respect physics, CPL makes that behavior an intrinsic property of the learning process.
