Discovering Phase Space Structure in Learned Hamiltonian Systems

Yulong Yang, Jiayin Liu, Vineet Bansal, Christine Allen-BlanchetteNeurIPS 2026

TL;DR

Nature is remarkably lazy: a chaotic double pendulum captured on a million-pixel video sensor still only cares about two simple angles. Structured Phase Space GAN (SPS-GAN) is a generative model that watches raw videos or trajectories of physical systems—even messy ones with friction or external pushes—and automatically discovers their true, minimal mechanical coordinates while generating realistic new motion.

What Problem Does This Paper Address?

Teaching neural networks classical physics—like Hamiltonian mechanics, which tracks a system's total energy via generalized positions ($\mathbf{q}$) and momenta ($\mathbf{p}$)—prevents them from predicting physically absurd futures. However, existing physics-informed networks usually ask for a massive handout: you have to feed them the exact, clean canonical coordinates (like pendulum angles) up front, and they typically assume an idealized universe with zero friction.

In the real world, we don't observe clean phase spaces; we observe pixel grids or 3D Cartesian coordinates $(x, y, z)$. Recent generative models have tried learning latent physics directly from raw video, but they struggle to simultaneously handle different physical regimes (conservative, dissipative, and externally forced) while boiling the latent space down to something compact and human-interpretable. How do we build a generative model that watches raw data, accounts for real-world energy loss, and discovers the underlying mechanical degrees of freedom on its own?

Methods

SPS-GAN pairs conditional adversarial generation (GANs) with a physics-structured latent backbone:

Figure 1: SPS-GAN generates trajectories and videos across multiple systems through a shared phase-space backbone. Random motion samples ϵm and system information ξ are passed through the phase-space map f to produce an initial phase-space state z0. This state is evolved forward in time by a Port-Hamiltonian Neural Network [15] conditioned on ξ, yielding the phase-space trajectory [z0:T ], which is decoded to (a) Cartesian trajectory [ˆx0:T ] and (b) video frames [ˆv0:T ].
  • Phase-Space Map: Instead of requiring a known starting state, an MLP maps random Gaussian noise and system conditioning info ($\xi$, such as system identity or object size) to an initial latent state $\mathbf{z}_0 = (\mathbf{q}_0, \mathbf{p}_0)$ inside an intentionally oversized 10-dimensional space.
  • Port-Hamiltonian Latent Dynamics: Rather than using standard energy-conserving Hamiltonians, the latent state evolves forward in time via a Port-Hamiltonian Neural Network (pHNN). This standard control-theory formulation cleanly separates conserved energy from learned energy dissipation (like friction) and external forcing.
  • Extended Cyclic-Coordinate Regularization (The Secret Sauce): In classical mechanics, if a coordinate doesn't affect the system's energy, it is "cyclic" (ignorable), and its momentum stays constant. While prior work penalized momentum changes to prune unneeded latent dimensions, friction and forcing naturally change momentum even for cyclic coordinates! The authors cleverly subtract out the learned dissipation and forcing terms inside their regularizer, isolating and penalizing only the Hamiltonian's coordinate derivatives. This forces redundant dimensions to go dormant without breaking non-conservative physics.
  • Modality Decoders: Finally, either an MLP decodes the latent trajectory into Cartesian coordinates, or a CNN (paired with a static visual content code) renders it into video frames, judged by image and temporal discriminators.

Datasets

No new datasets are introduced; instead, the authors evaluate across simulated benchmarks and existing real-world recordings:

  • Simulated Systems (Cartesian & Rendered Video): Conservative systems (mass-spring, single pendulum, chaotic double pendulum, two-body, and three-body gravitational systems) alongside non-conservative systems (damped pendulum and forced Duffing oscillator).
  • Real-World Systems: Existing trajectory and video datasets of freely swinging real-world single and double pendulums, complete with natural air resistance, friction, and lighting quirks.

Key Insights and Ideas

  • Untangling Friction from Redundancy: By mathematically isolating conservative forces from dissipative ones in the regularization loss, a network can compress its latent space without mistaking friction for a new degree of freedom.
  • Discovering Textbook Coordinates from Pixels: When the authors apply Principal Component Analysis (PCA) to the learned 10D coordinate space, the dimensions needed to explain 95% of the variance match the exact analytical degrees of freedom across all 11 simulated and real settings (e.g., 1 DoF for a two-body orbit, 2 DoF for a three-body system). Even cooler: sweeping along those active PCA directions and decoding them reveals that the network organically discovered polar radius, orbital angles, and pendulum angles—despite only ever seeing Cartesian $(x,y)$ points or RGB pixels!
  • Multi-System Sharing: Conditioning the phase-space map and pHNN on system labels (cSPS-GAN) allows a single shared network to accurately simulate completely different physical systems and visual styles at once.

Key Results

  • Trajectory Accuracy: By aligning generated initial states with a ground-truth simulator, SPS-GAN achieves the lowest Mean Squared Error (MSE) on 4 out of 5 conservative systems (e.g., $1.26 \times 10^{-3}$ on Three-Body vs. $2.81 \times 10^{-3}$ for HNN) and sweeps all non-conservative benchmarks ($4.57 \times 10^{-4}$ on Damped Pendulum, beating pHNN and NeuralODE).
  • Chaos & Long-Horizon Stats: Over 200-step rollouts on the chaotic double pendulum, SPS-GAN best preserves long-term attractor geometry, logging a 4.52% relative energy drift (compared to 11.61% for HNN and 24.72% for NeuralODE) and the lowest Wasserstein distances across phase space and Poincaré sections.
  • Video Realism: SPS-GAN achieves the best Fréchet Video Distance (FVD) across all five rendered benchmarks (e.g., 24.1 on Double Pendulum vs. 73.2 for HGAN and 331.9 for HGN). On real-world pendulum videos, it generates smooth, coherent swings whose extracted energy variance (2.9%) closely mirrors the real footage (2.7%), whereas baselines freeze or tear apart.
Figure 2: Video generation on real-world pendulum systems. Qualitative comparison of SPS- GAN, HGN, and HGAN on (left) single-pendulum [41] and (right) double-pendulum [42] videos. SPS-GAN generates temporally coherent motion, whereas the baselines exhibit static or dynamically inconsistent sequences. For the single pendulum, the relative energy variance of centroid-extracted SPS-GAN videos (2.9%) is close to that of real recordings (2.7%).

Limitations and Future Work

  • Smoothness Assumptions: Because port-Hamiltonian dynamics assume smooth vector fields, SPS-GAN isn't built for discontinuous physics like rigid-body collisions, impacts, or heavily stochastic systems.
  • Threshold & Noise Sensitivity: Estimating exact degrees of freedom relies on a 95% PCA variance threshold. While robust down to a 10 dB signal-to-noise ratio, heavier sensor noise or stricter thresholds cause the method to overestimate active dimensions.
  • Planar Real-World Scope: Real-world tests were limited to planar pendulums; scaling up to full 3D, contact-rich robotic interactions remains an open frontier for future work.

Summary updated

Abstract

Mechanics-inspired neural dynamical models improve interpretability and physical consistency, but they usually assume a known configuration space, fixed physical parameters, and deterministic prediction from a prescribed initial condition. We introduce Structured Phase Space GAN (SPS-GAN), a conditional generative model that learns structured dynamics from both Cartesian trajectories and video. SPS-GAN combines a port-Hamiltonian backbone with adversarial conditional generation, allowing conservative, dissipative, and forced systems to be represented in a single architecture. To infer latent mechanical structure from raw observations, we use a cyclic-coordinate loss that recovers both the system degrees of freedom and canonical coordinates without access to the true phase space. Experiments on simulated and real-world systems show that SPS-GAN improves trajectory accuracy over supervised dynamics baselines and video consistency over generative baselines, while consistently recovering the correct latent mechanical coordinates across observation modalities and dynamical regimes.
BibTeX
@inproceedings{yang2026discovering,
  author = {Yulong Yang and Jiayin Liu and Vineet Bansal and Christine Allen-Blanchette},
  title = {{Discovering Phase Space Structure in Learned Hamiltonian Systems}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=wstD80hIpm},
}
Figure