Physical Dynamics and Constraints › Physics Priors and Constraint Enforcement
World Models HandbookAll chapters Physical Dynamics and Constraints › Physics Priors and Constraint EnforcementOne section · Sections in this chapter7 / 12 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
We now assemble the toolbox. Given a learned dynamics model, there is a spectrum of ways to make it respect physics, differing in how strongly the constraint binds and how much of the model is hand-designed. The spectrum is best organized around a single question: is physics a preference you trade off against data fit, or a guarantee you enforce unconditionally? Each position along the spectrum answers that question differently, and each comes with its own failure modes.
The Spectrum from Soft to Hard
At one end, physics is a preference; at the other, it is a guarantee.
- Soft penalties: Add physics violations to the training loss. A typical loss looks like . The weights balance data fit against the selected residuals: too little weight may leave large violations, while too much can distort the fit when the assumed law, state, or numerical tolerance is wrong. Soft penalties are broadly applicable to partial and approximate laws, but they do not guarantee satisfaction. PINNs use this idea by penalizing a governing-equation residual at collocation points.
- Structured architectures: Restrict the function class so that a stated property holds by construction. An autonomous HNN conserves its learned under exact unforced continuous flow; a regular autonomous LNN has an analogous learned energy law. Neither statement makes the learned scalar identical to physical energy, and numerical integration adds error. The price is commitment: an unforced canonical Hamiltonian architecture cannot represent friction without an added dissipative or forcing term.
- Hard projection: Let the network predict freely, then project the prediction onto a physically admissible set after each step: move positions out of penetration, project contact impulses into the friction cone, renormalize quaternions, or enforce joint limits. The selected feasibility condition can be exact up to solver tolerance, but gradients and interactions among constraints need care.
- Hybrid residual models: Use a simulator as a backbone and learn a correction, . The simulator enforces selected discrete constraints to solver tolerance; the residual can represent identifiable, sufficiently excited unmodeled effects. For passive dissipation, a precise construction is , where and , giving . This is useful when the backbone is accurate enough and the residual effects are observable, but it is not a universal best choice.
- Differentiable simulation: Write the simulator so its computation graph is differentiable, then train through it end to end. This preserves the simulator's specified equations while adapting parameters to data, subject to discretization error and model mismatch. Event-aware derivatives and explicit approximations address particular contact-gradient failures, but changing normals, simultaneous contacts, solver branches, and stiffness still require validation.
Choosing Where on the Spectrum to Sit
The right choice depends on what you know and what you can guarantee. Some guidelines:
- If an isolated autonomous conservative system has a known invariant, architectural enforcement can guarantee that selected property under its continuous-time and solver assumptions. A soft penalty supplies no such guarantee and introduces a tuning tradeoff, though hard enforcement can also be inappropriate when the state, law, or boundary is misspecified.
- In a passive dissipative regime, combine a conservative core with a positive-semidefinite dissipation operator or another parameterization that makes the identified energy rate nonpositive. This constrains that particular learned energy; it does not prevent penetration, momentum error, or legitimate energy input from actuation.
- If a constraint is safety-critical (no penetration, joint limits, table height), a finite soft penalty provides no worst-case feasibility guarantee. Prefer independently verified hard projection or constrained optimization when the constraint must hold, and test the projection itself under distribution shift. We will meet this again in Part XII on reliable world models.
- If the physics is uncertain in form, not just parameters, keep the soft end of the spectrum flexible and let data decide. Enforcing a guessed structure harder than your confidence justifies converts your uncertainty into systematic model error.
A useful mental model is to ask what each component guarantees. Architectural priors enforce only their encoded property under stated assumptions; learned components cover effects supported by the data. Revisit the partition as evidence accumulates. A systematic residual is evidence to investigate missing physics, state estimation, calibration, or data bias before deciding that the architecture itself must change.
Constraint Enforcement in Latent World Models
One caveat deserves emphasis. The directly geometric operations above, such as checking penetration and projecting velocities, assume that the model exposes physically interpretable quantities. Modern latent world models from Part V operate in abstract spaces where "penetration" has no direct meaning unless the state is decoded to geometry. Two representative responses are:
- Structured latents: Design the latent state to contain physical quantities, as in the object-centric models of Part III, Chapter 5, where each latent slot carries an object's pose. Physics constraints then apply to the decoded, physical readout.
- Latent geometric constraints: Design compatible, typically even-dimensional latent coordinates and impose a Hamiltonian vector field or symplectic map. This preserves the encoded latent structure under the relevant continuous flow or discrete update. Without an identified readout, the learned invariant need not equal a physical conservation law, and symplecticity alone does not guarantee bounded drift of arbitrary latent coordinates or physical predictions.
The first keeps constraints checkable and interpretable; the second applies to abstract latents deliberately designed with compatible geometry. Other hybrids combine equivariant encoders, probabilistic constraints, or learned simulators. If a safety filter must verify "the cup is above the table," the state must expose a readout the filter can check.