RL with BWM World Model#
This recipe trains a single-view pi0.5 policy with PPO on RoboTwin adjust_bottle inside the Boundless World Model (BWM), an action-conditioned video world model built on Wan2.2-TI2V-5B. Training never touches the simulator; checkpoints are scored in RoboTwin afterwards.
Overview#
Train a single-view pi0.5 policy with PPO on RoboTwin adjust_bottle simulated by the BWM world model.
BWM World Model · RoboTwin (eval)
PPO
adjust_bottle
1 node · 8 GPUs
run_embodiment.sh → score the checkpoint in RoboTwin.Tasks#
Environment |
Task |
Config / Weights |
Focus |
|---|---|---|---|
BWM |
RoboTwin |
|
BWM fine-tuned on success and failure rollouts, served in process by the |
Observation and Action#
Field |
Description |
|---|---|
Observation |
One 640x480 head-camera frame generated by the world model; |
Action |
A chunk of 50 Aloha joint commands (14-dim). The backend maps them to BWM’s normalized end-effector poses with URDF forward kinematics; each chunk is one 61-frame BWM window (9 condition frames, 52 new). |
Reward |
A frozen T5 success classifier scores every frame from frame 51 on; the episode pays 1 on its 200th step if the peak score reaches the threshold ( |
Prompt |
The task instruction stored with each initial frame. |
Installation#
Install the openpi model and the RoboTwin environment as in RoboTwin. The simulator is needed only for evaluation and for the URDF the action bridge reads.
BWM is not pip-installable from its repository; put the source on
PYTHONPATH:git clone https://github.com/boundless-large-model/boundless-world-model git -C boundless-world-model checkout cc0bc74 export PYTHONPATH=$(pwd)/boundless-world-model:$PYTHONPATH
BWM needs
diffsynth==2.0.11, whose API differs from the DiffSynth fork thewanbackend installs. Install it into a separate directory and put that directory first onPYTHONPATHonly for BWM runs:pip install --no-deps --target /path/to/bwm_pydeps diffsynth==2.0.11 ftfy==6.3.1 wcwidth modelscope export PYTHONPATH=/path/to/bwm_pydeps:$PYTHONPATH
torchaudiomatching the installedtorchbuild is also required.
Assets#
Asset |
Source |
Config key |
|---|---|---|
Wan2.2-TI2V-5B DiT and VAE |
|
|
Fine-tuned BWM weights |
|
|
BWM action statistics |
|
|
Aloha URDF / SRDF |
RoboTwin assets, |
|
Reward classifier |
|
|
pi0.5 SFT policy |
WorldArena/WorldArena (model repository, |
|
Initial frames |
48 RoboTwin reset observations, one |
|
The rollouts BWM was fine-tuned on are in lidavidsh/robotwin-adjust-bottle-pi05-rollouts.
Run It#
Set the paths above in examples/embodiment/config/env/bwm_robotwin_adjust_bottle.yaml and bwm_robotwin_adjust_bottle_ppo_openpi_pi05.yaml, then:
export ROBOT_PLATFORM=ALOHA ROBOTWIN_PATH=/path/to/RoboTwin
bash examples/embodiment/run_embodiment.sh bwm_robotwin_adjust_bottle_ppo_openpi_pi05
The recipe runs PPO with GAE (gamma 1.0), 48 envs x 2 rollout epochs per step, for 14 steps: 4 critic-only, then 10 joint updates. The critic reads the VLM features (value_after_vlm). It uses FSDP no_shard (required by openpi). On ROCm builds whose Triton lacks triton_key, add actor.model.openpi.torch_compile=False.
Evaluate in RoboTwin#
Score a checkpoint with the RoboTwin pi0.5 evaluation config, using this recipe’s policy settings and single head view:
export ROBOT_PLATFORM=ALOHA ROBOTWIN_PATH=/path/to/RoboTwin
bash evaluations/run_eval.sh robotwin robotwin_adjust_bottle_openpi_pi05_eval \
rollout.model.model_path=/path/to/sft runner.ckpt_path=/path/to/full_weights.pt \
rollout.model.num_steps=4 rollout.model.openpi.task=rl rollout.model.openpi.noise_level=0.5 \
++rollout.model.openpi.value_after_vlm=True \
++rollout.model.openpi.value_head_hidden_sizes=[512,256,128] \
++rollout.model.openpi_data.adapt_to_pi=false \
++rollout.model.openpi_data.norm_stats_path=/path/to/sft/assets/robotwin_clean \
env.eval.assets_path=/path/to/RoboTwin \
env.eval.task_config.camera.head_camera_type=Large_D435 \
env.eval.task_config.camera.collect_wrist_camera=false
Results#
With the original in-process integration this backend was ported from (older RLinf tree), on 8x MI300X, 14 PPO steps improved the SFT policy (0.773) in RoboTwin on 144 held-out initial states x 3 evaluation passes:
Seed |
Success |
vs SFT (90% CI) |
|---|---|---|
1 |
0.889 |
+11.6 pp [+8.1, +15.1] |
2 |
0.884 |
+11.1 pp [+6.7, +15.7] |
3 |
0.847 |
+7.4 pp [+3.7, +11.3] |
4 |
0.917 |
+14.4 pp [+10.0, +19.0] |
5 |
0.813 |
+3.9 pp [+1.6, +6.3] |
Seed-to-seed spread is large; judge a run with several seeds. Training with the ported backend has not yet reproduced this gain; see #1713.