Physics-informed diffusion  /  Robot dynamics

PHDME: Physics-Informed Diffusion Models
without Explicit Governing Equations

A Port-Hamiltonian Diffusion Model that learns physical structure from a handful of trajectories, then uses it to make diffusion forecasts of soft-robot dynamics accurate and physically reliable.

Anonymous authors

Paper under double-blind review

PHDME at a glance on an illustrative soft robotic arm: why data-only fits drift, how the GP-dPHS prior and its uncertainty guide training, and how the full spatiotemporal field is generated in one reverse-diffusion pass.
20ground-truth trajectories is all PHDME sees per system
~20×faster generation than rolling out the GP-dPHS (0.2 s vs 4.1 s / sample)
0analytic governing equations needed for training or sampling
3benchmarks: synthetic string, 2D nonlinear membrane, real-world spring

Motivation

Why purely data-driven generative models aren't enough

Diffusion and flow-matching models forecast complex dynamics well, but they learn the data distribution from lots of data and know nothing about the physics that produced it. For a soft robot, both are a problem.

Data are scarce

Generative models need many trajectories to learn a distribution. Fully instrumenting a soft robot with sensors is expensive and physically difficult, so in practice we may only have a few recordings.

Predictions can be unphysical

Even with enough data, a purely data-driven model can match dataset statistics while violating physical laws, e.g. letting a fixed base drift. That is unacceptable for safety-critical soft robots.

Equations are unknown

Physics-informed methods (PINNs, physics-informed diffusion) assume the governing PDE is known. For soft robots, deriving first-principles equations from a few video frames is often impossible.

A soft continuum manipulator, its top-down parameterization, and the resulting space-time image of displacement
Trajectories as images. A soft-robot trajectory is parameterized so that one axis is position along the arm, the other is physical time, and pixel value is displacement. Reverse diffusion then generates the entire spatiotemporal field at once, with no autoregressive rollout and no error accumulation over time.

Method

Learn the physics first, then let it teach the diffusion model

PHDME assumes only the structure of the system, namely that it is a distributed port-Hamiltonian system (dPHS). The energy function (Hamiltonian) and the unknown coefficients are learned from data.

J power-preserving interconnection  ·  R dissipation  ·  Gd input map  ·  𝓗 unknown Hamiltonian, modeled by a Gaussian process

Two-stage training pipeline of PHDME
Two-stage training. Stage 1 learns a GP-dPHS physics prior from limited observations and samples its posterior to synthesize a rich training set. Stage 2 trains the diffusion model with a reconstruction loss plus a floor-aware projection loss that pulls predictions toward the frozen GP-dPHS dynamics.
  1. 1

    Stage 1 · Physics prior

    Learn a GP-dPHS from sparse observations

    A smooth GP interpolant of the sparse measurements provides state derivatives in closed form. A Gaussian process is placed on the Hamiltonian, and because GPs are closed under linear operators this induces a GP over the dynamics with a physics-informed kernel:

    Training maximizes the marginal likelihood. The result is a Bayesian physics prior that carries a mean and an uncertainty for every predicted state rate.

  2. 2

    Stage 1 · Data enhancement

    Sample the posterior to overcome data scarcity

    Rather than rolling out only the posterior mean, PHDME draws Hamiltonian gradients from the GP-dPHS posterior. Each draw is one plausible dynamical system, which a numerical solver integrates under new initial conditions. The augmented dataset reflects both physics uncertainty and initial-condition variety, enough to train a diffusion model from just 20 real trajectories.

  3. 3

    Stage 2 · Uncertainty-weighted physics

    Guide the denoiser where the prior is confident

    For a denoised prediction , the learned residual compares its finite-difference time derivative with the rate the GP-dPHS predicts. The GP variance turns into a weight , so mismatches count more where the prior is certain and less where it is not:

  4. 4

    Stage 2 · Floor-aware projection

    Project, then use the result as a stop-gradient target

    A damped Gauss–Newton / conjugate-gradient solve finds a nearby trajectory that better obeys the learned dynamics, keeping initial and boundary values pinned. It stops once the residual reaches , the level that real observed trajectories attain, so the model never over-fits an imperfect operator.

    The GP-dPHS stays frozen; only the denoiser is trained. At test time an optional single projection (+proj) can further tighten physical consistency.

GP posterior means of the Hamiltonian gradients with sparse training observations
Learned energy. GP posterior means for ∂𝓗/∂p and ∂𝓗/∂q on the string, with the sparse training observations overlaid.
Intermediate reverse-diffusion states for a string trajectory
Reverse diffusion. Coherent oscillations emerge from noise while the two conditioning frames are retained.

Benchmarks

From synthetic PDEs to a real deformable system

On every benchmark the GP-dPHS is fitted to only 20 ground-truth trajectories. All learned models (PHDME and baselines) train on the same GP-augmented data and are tested on held-out true trajectories. Analytic equations are used only for evaluation.

Synthetic · 1D

Vibrating string

Fixed-end wave equation in port-Hamiltonian form, with state . Observations downsampled 50× to 1,639 rows. Tested on 1,000 held-out trajectories.

Synthetic · 2D nonlinear

Nonlinear membrane

A 2D Stokes–Dirac drum with saturating (tanh) co-energy on a 32×32×32 space–time grid. Separable isotropic GP Hamiltonian, 200 observation rows per gradient component. 500 test trajectories.

Real world

Oscillating spring

A 41.9 cm extension spring with fixed ends, a stand-in for swinging cables or a soft robot arm. Filmed at 226 FPS; no closed-form equations exist. 250 test trajectories.

  • RGB segmentation → skeletonization → tracked centerline
  • Kalman filtering + GP smoothing for derivatives
  • Stored in a SQL database for querying and visualization
Real-world spring pipeline: raw frame, skeleton, tracked points, centerlines over time
Real-world spring data. Raw camera frame, skeletonized centerline, spatially ordered tracked points, and tracked centerlines at several times. The tracked trajectories are stored in a SQL database, which supports querying, filtering, and visualization before they are converted into the physically consistent (p, q) representation.

Results

Accurate and physically consistent forecasts

Lower is better, except for spring E-cons, which should match the ground-truth value 0.527 for the damped spring. Hover a bar for exact values.

Show full table
−35%

vs. DDPM on the string: relL2 drops 0.637 → 0.413, and oracle-phys drops 0.574 → 0.183 (0.121 with +proj). Same network, data, and sampler; the only difference is the learned-physics loss.

4×

Lower analytic residual than GP rollout on the membrane (0.106 vs 0.423). Integrating the GP prior directly is accurate but less physical on true states.

0.529

Energy behavior on the real spring matches the ground-truth 0.527, while FieldPHNN keeps too much energy (0.386) and has 5× the error.

Real-world spring predictions under the same initial condition for all methods
Real-world spring. p and q over position (vertical) and time (horizontal), with absolute error in p. PHDME, DDPM and GP rollout agree closely; FieldPHNN develops spurious fronts in the second half of the run.
Nonlinear membrane momentum frames for PHDME+proj, DDPM and ground truth
2D membrane. Momentum at five of 32 frames. PHDME +proj places the main lobes correctly; DDPM's error is larger in every frame shown.

Data enhancement matters under extreme scarcity

Baselines trained directly on the original limited observations, without the PHDME pipeline (string benchmark):

Training dataModelrelL2oracle-physMSE
GP-augmentedPHDME +proj (ours)0.3970.1211.47×10⁻³
GP-augmentedPHDME (ours)0.4130.1831.58×10⁻³
1,639 pointsFieldPHNN0.5354.61×10²1.24×10⁻¹
12 frame pairsConvNODE0.4221.6493.62×10⁻³
1 trajectoryDDPM2.2972.0024.36×10⁻²

~20× faster than integrating the prior

One reverse-diffusion chain generates the whole trajectory, so PHDME amortizes the expensive GP-dPHS solve.

GP-dPHS rollout
4.1 s
PHDME
0.2 s

Seconds per sample. 10,000 samples: 11 h 23 min vs 33 min.

Every component pulls its weight

Leave-one-out ablation on the string (relL2 after +proj, lower is better).

Full PHDME0.410
− learned physics (DDPM)0.670
Projection → raw residual loss1.115
− floor-aware stopping0.900
− GP-variance whitening0.623
− SNR gate3.072
− data-only warm-up0.606
Fixed weight → GradNorm0.541
String leave-one-out ablation predictions under a shared initial condition
Ablations, visualized. Removing the SNR gate or replacing the projection with a raw residual destroys the wave structure; other removals introduce smaller phase and amplitude errors.

Citation

BibTeX

@article{anonymous2026phdme,
  title   = {PHDME: Physics-Informed Diffusion Models without Explicit Governing Equations},
  author  = {Anonymous},
  journal = {Under review},
  year    = {2026}
}