Learning Under Laws: A Constraint-Projected Neural PDE Solver that Eliminates Hallucinations
Mainak Singha · 2025
Read Learning Under Laws: A Constraint-Projected Neural PDE Solver that Eliminates Hallucinations by Mainak Singha (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2511-03578.txt.
Introduction
Mainak Singha presents a neural equation solver that cannot break the physical laws it models. Standard neural solvers often invent mass, drift shocks wrongly, or violate entropy rules while fitting data well. Constraint-Projected Learning forces every training update back onto the set of physically allowed states.
The allowed set joins conservation, shock balance, entropy, and positivity demands, and the projection step still allows gradient training at small extra cost. Extra damping calms tiny oscillations, while a staged rollout teaches long-horizon steadiness. Tests target flows where law-breaking is easiest to spot. Solvers that respect hard laws by construction could be trusted in engineering settings where a pretty but impossible answer is dangerous.
Catalog record
| CREATOR | Mainak Singha |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 63 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2511-03578
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Learning Under Laws: A Constraint-Projected Neural PDE Solver that Eliminates Hallucinations Mainak Singha Abstract Neural networks can approximate solutions to partial differential equations (PDEs), but they often violate the very laws they are meant to represent—creating mass from nowhere, drifting shocks, or breaking conservation and entropy conditions. We address this by training within the laws of physics rather than beside them. Our framework, Constraint-Projected Learning (CPL) , enforces physical admissibility at every update by projecting network outputs onto the intersection of constraint sets defined by conservation, Rankine–Hugoniot balance, entropy, and positivity. This projection is differentiable and inexpensive (about 10% overhead), allowing CPL to remain fully compatible with backpropagation. We extend CPL with a total-variation damping (TVD) penalty to prevent small unphysical oscillations and a short rollout curriculum that promotes stability across multiple steps. Together these additions suppress both hard and soft violations: mass and flux balances remain at machine precision, average positive variation growth collapses to zero, and long-horizon predictions remain bounded in entropy and error. Across Burgers and Euler systems, the method yields stable, law-consistent solutions without sacrificing accuracy. Rather than hoping a neural solver will respect physics, we make that behaviour a built-in property of the learning process. keywords Physics-Informed Neural Networks (PINNs), Scientific Machine Learning (SciML), Neural Operators, Constraint-Projected Learning (CPL), Total-Variation Damping (TVD), Conservation Laws, Shock and Entropy Constraints, Finite-Volume Neural Solvers, Differentiable Physics, Law-Constrained Optimization, Neural PDE Solvers, Hallucination Suppression in AI Models 1 Introduction From simulating turbulent flows to resolving shocks in compressible gases, machine learning is poised to transform scientific computing. Yet the data-driven flexibility that makes neural networks powerful also makes them perilously unconstrained: they can generate results that are numerically plausible but physically impossible. A model can fit data perfectly and still create mass, destroy energy, or generate profit from nothing. This failure—when a network wins the optimization game but loses reality—is known as a hallucination . It captures the gap between minimizing loss and obeying truth. A hallucination occurs when a model outputs a state that is mathematically valid yet physically or logically impossible under the system’s true constraints. The phenomenon is universal. In physics, a network may invent energy or momentum; in biology, it may predict negative concentrations or impossible growth; and in language models, it may assert confidently false facts. Across all domains, the pattern is the same: the model optimizes for data agreement, not for the invariants that make the world coherent—the conservation laws, stability conditions, or logical relationships that reality always respects. The origin of hallucination lies in the loss function itself. Neural networks are trained to minimize scalar objectives such as mean-squared error or cross-entropy, which reward statistical accuracy but ignore deeper structure. Mathematically, the optimizer seeks \min_{\theta}L(\theta) , where L measures data misfit, but the true system also obeys constraints such as conservation (\theta)=0 , positivity (\theta)\geq 0 . When these constraints are absent, the gradient \nabla_{\theta}L may point in a direction that lowers loss even as it moves the solution out of the feasible region. The optimizer thus follows a path of decreasing error that leaves the manifold of lawful solutions. From its own perspective, it succeeds; from the universe’s perspective, it hallucinates. Geometrically, valid solutions occupy a narrow manifold within the vast space of possible network outputs. The loss surface, unaware of this structure, guides gradient descent downhill along directions that are optimal in loss space but not in law space. Each update can therefore carry the solution out of the feasible manifold, pushing the network into regions that minimize error while breaking the governing laws of physics. Hallucination, then, is not confusion—it is geometry. The model faithfully follows the gradient we define, even when that gradient points away from reality. Recent years have seen major efforts to tame this problem. Physics-Informed Neural Networks (PINNs) 12 ; 4 embed PDE residuals into the loss function to steer networks toward physical solutions, with weak-form and finite-volume variants improving stability and conservation 7 ; 8 ; 6 . Neural operators such as the Fourier and physics-informed variants 9 ; 10 generalize across PDE families but still treat constraints softly. Structure-preserving architectures—including Hamiltonian, symplectic, and divergence-free networks 5 ; 3 ; 11 — encode conservation directly into their design. Differentiable optimization layers 2 ; 1 and projection-based scientific ML (2023–2025) impose convex or linear feasibility during training. A complete solution demands a training paradigm that enforces the governing laws by construction. The next generation of scientific machine learning must operate not beside the laws but inside them—ensuring that every update, every forward pass, and every prediction respects conservation, stability, and reality itself. Only then can neural networks evolve from clever approximators to reliable instruments of science. In this work, we introduce such a paradigm: a framework that ensures neural networks learn under the laws, producing solutions that are not only accurate but admissible by design. 2 Constraint-Projected Learning: Training Inside the Laws We begin from a simple premise: the world operates under laws, and learning should too 12 ; 9 . . Fluids conserve mass and momentum, and entropy never decreases in a closed system. These are not optional add-ons—they define what is real. Neural networks, however, are not aware of such boundaries. They minimize loss, not violation. A model can fit the data beautifully and still create energy from nothing because the optimization landscape does not contain the laws that govern the world. We seek to change that. We introduce Constraint-Projected Learning (CPL) , a training framework that keeps learning confined to the lawful region of parameter space. Instead of allowing the optimizer to drift freely through all possible states, we reshape its path so that every update remains physically admissible. After each gradient step, we project the prediction (or its parameters) back onto the manifold defined by the system’s governing constraints—conservation, entropy, shock balance, positivity, and divergence-free structure. The model still learns from data, but it does so inside the laws . The projection acts as a mathematical tether: no matter where optimization tries to go, the model is gently pulled back to the nearest state the universe would actually allow. This projection step transforms the geometry of learning. In ordinary training, the loss surface guides the gradient downhill, and nothing prevents the optimizer from sliding off the physical manifold because the laws are invisible to the loss. We assume that each law can be expressed as a constraint set, and the intersection of all such sets forms a feasible region \mathcal{C} . The training update becomes \theta_{k+1}=\Pi_{\mathcal{C}}\!\big(\theta_{k}-\eta\nabla_{\theta}L\big), where \Pi_{\mathcal{C}} denotes projection onto the lawful set. If \mathcal{C} is convex or locally convex—a good approximation for most physical constraints—the projection is stable and non-expansive: \|\Pi_{\mathcal{C}}(x)-\Pi_{\mathcal{C}}(y)\|\leq\|x-y\|. This property means the projection cannot amplify errors; it damps them. Each step therefore moves the model closer to the truth surface rather than away from it. Learning becomes geometrically stable, both mathematically and physically. Each constraint expresses a fundamental property of nature. Conservation ensures that what enters a system must leave or accumulate within it, implemented through weak-form or finite-volume residuals that telescope across cells to enforce exact balance. Shock admissibility is imposed via the Rankine–Hugoniot condition, guaranteeing that discontinuities propagate with physically correct speeds. Entropy constraints