HaM-World: Soft-Hamiltonian World Models with Selective Memory for Planning
Haoyun Tang ⋅ Haodong Cui ⋅ Keyao Xu ⋅ Zhan-Dong Mei ⋅ Kun Wang
Abstract
World models enable model-based planning through learned latent dynamics, but imagined rollouts become unstable as the planning horizon grows or the dynamics distribution shifts: an unconstrained predictor contracts, because each predicted state is fed back as the next input, so the latent distribution shrinks over the rollout until distinct states merge. We argue that this drift and contraction reflect two missing structures in planner-facing latents: a history-conditioned predictive state that summarizes past observations and actions, and geometric organization that separates configuration, momentum, and task semantics. We propose HaM-World (HMW), a structured world model that decomposes the latent state into a canonical-like $(q,p)$ subspace and a context subspace $c$, while using Mamba selective state-space memory as the history-conditioned input to the same latent dynamics. Within this interface, $(q,p)$ evolves through an energy-derived Hamiltonian vector field plus learnable residual/control dynamics, while $c$ captures semantic, dissipative, and non-conservative factors. This gives the planner a single latent state shared by dynamics prediction, reward/value estimation, imagined rollouts, and CEM action search. On six DeepMind Control Suite tasks, HaM-World ranks first on four and second on the remaining two, with the highest Avg. AUC over all six tasks (91.9, +10.3% over TD-MPC2). Within the horizon range the planner actually unrolls, it reduces imagined-rollout error to 45% of TD-MPC2's and wins 11/12 $k\in\{3,5,7\}$ MSE cells. Under 12 OOD perturbations spanning dynamics shifts, action delay, and observation masking it attains the highest return in every condition (+10.2% on Finger Spin, +13.6% on Reacher Easy). Ablation studies show that both selective memory and the Soft Hamiltonian prior contribute to improved model performance. Mechanism diagnostics show bounded action-free energy drift, structured energy variation under policy rollouts, and coherent control-induced energy transfer. Code: https://github.com/HaoyunT/HaM_World
Successful Page Load