World models¶
A world model predicts the next state from the current state, action and simulator context:
st+1 = f(st, at, ξ). SuperTrack and SuperMimic train policies by backpropagation through
this differentiable model. All models share an interface (ndm_gym.worldmodels):
step(S, a, xi_n) |
the state one control step (20 ms) later |
inputs(S, a, xi_n) |
the network's raw inputs |
targets(S, S1) |
the regression targets of a transition (they fit the output normalizer) |
in_norm, out_norm |
running normalizers of the inputs and the targets (ndm_gym.core.normalizer.RunningNorm) |
The G1's state (ndm_gym.state) is S = (p, R, v, w, q, qd): the pelvis position (3), rotation matrix (3 × 3), world
linear and angular velocity of the pelvis link frame (3 + 3), joint positions and velocities (29 + 29). The context is
xi = [friction, joint calibration offsets (29), torso center-of-mass offset (3)], which normalize_xi scales into the
world models' xi_n. An action is the normalized joint setpoint sent to the simulator's PD controllers.
The G1's world models¶
| class | predicts | algorithm | |
|---|---|---|---|
| SuperTrack's | worldmodels.accel.AccelWorldModel |
the root's linear and angular accelerations in its frame and the joint accelerations, integrated by semi-implicit Euler (substeps, --st_substeps) |
--algo supertrack |
| SuperMimic's | worldmodels.increment.IncrementWorldModel |
frame-local increments of every state component | --algo supermimic |
| BlinkMimic's | worldmodels.semi_implicit.SemiImplicitIncrementWorldModel |
velocity increments; the positions from the old and new velocities plus learned corrections | --algo supermimic --wm_structured (in --algo blinkmimic) |
With zero position corrections, a step of BlinkMimic's model equals one of SuperTrack's with 4 substeps (BlinkMimic).
Backbones¶
Both backbones use the same targets, normalizers, integration and losses.
- MLP (default): 3 × 2048 with LayerNorm and SiLU (
--wm_hidden,--wm_act,--wm_no_ln), on heading- and position-invariant state features; 8.75 M parameters in SuperTrack's model, 8.82 M in SuperMimic's. - RigidFormer (
--wm_backbone rigidformer, sizes--rf_dim,--rf_layers,--rf_heads,--rf_registers): a Transformer with one token per G1 body, 3-D rotary attention on the body positions, a kinematic-tree attention bias, FiLM conditioning on the context and a read-out in reduced coordinates; 0.88 M parameters at the default size. Requires G1 kinematics (ndm_gym.robots.g1.kinematics); see RigidFormer backbone.
Both output layers start at zero, so a new world model predicts the output normalizer's mean.
Fitting¶
ndm_gym.algos.common.Algo.wm_update fits k-step replay windows (--wm_window), rolling out from each window's first
state. SuperTrack uses L1 errors of body positions, velocities, rotations and angular velocities in world space;
SuperMimic uses normalized frame-local state error. The offline benchmark ndm_gym.wmbench.fit uses the same update
(Quickstart).
Inference copies¶
ndm_gym.worldmodels.g1_infer.inference_copy(wm, dtype, attention, fused) makes a forward-only simulation copy with
bf16 parameters and RigidFormer's token attention kernel. fused adds Triton kernels for features and integration
(CUDA). Each copy is checked against its model and rejected on a mismatch.
The other tasks' world models¶
- Human-object interaction:
worldmodels.hoi.HOIWorldModel, one control step of the robot and the tracked object and the contact forces (the end effectors' and the feet's), from the state, the four physics substeps' filtered actions and the scene's context;kind"accel" or "increment", as above; MLP orHOIRigidFormerNet. - Muscles:
worldmodels.muscle.MuscleWorldModel, the next state of MuscleVAE's 23 bodies (maximal coordinates) and of the muscle state from the 284 muscle targets;kind"accel" or "increment"; MLP orMuscleRigidFormerNet. - Hand-object tracking:
worldmodels.hand.HandWorldModel, one control step of the hand's joints and the object;kind"accel" or "increment"; MLP (task). - MuJoCo models without actuator activation (RoboKit's examples, mbrl-lib's tasks):
worldmodels.mjcf.MjcfWorldModel, one step of a model's generalized coordinates (qpos, qvel) from its controls, read from theMjModelbyMjcfLayout(free, ball, hinge and slide joints; joint and fixed-tendon actuators with a fixed gain; joint equalities kept exact);kind"accel" (integrated as MuJoCo's semi-implicit Euler) or "increment"; MLP or a body-token RigidFormer (MjcfRigidFormerNet); optional contact inputs (contact_spheres);inference_copyfor bf16 throughput. RoboKit's planner runs it throughsim.robokit_ndm(task), mbrl-lib's controller throughsim.mbrl_ndm(task).