cs.RONov 27, 2026

Predictive Code Worlds: Write the World First, Then Predict It, for Robot Code Agents

Authors: Ge Wang, Zhixin Mai, Zheng Sun, Mingkai Jia, Ziyue Zhu, Zhen Li

Organizations: The Chinese University of Hong Kong, Shenzhen · The Chinese University of Hong Kong · The Hong Kong University of Science and Technology · Nankai University

Abstract

Code-as-policy agents write robot programs on top of perception and motion APIs, and how well they do depends heavily on the language model behind them. Masks, depth and bounding boxes are not a model of the task's world, so the model has to work that world out by itself. We present Predictive Code World (PCW), in which the agent writes the world down before the policy and then makes that world predictive. The agent first writes a code world, an executable model of its task that keeps measured facts, predicts what each action should change and judges progress toward the goal, and writes its skill on it. Once the skill works, the code world also predicts the observable outcome of each subgoal. These world predictions come from the same agent as the skill they check and are not trusted by default: faults injected during development label their verdicts, and only predictions certified on these labels may roll the program back. With a small open-weight model, Qwen3.8-Flash, and self-improvement, PCW reaches 89.4% success on 80 LIBERO-Pro tasks, surpassing ASPIRE with the same model, a larger open-weight model, and even the closed-source Claude Opus 4.6; its gains carry over to Robosuite and BEHAVIOR-1K. Under disturbances, world predictions catch failures that would otherwise go unnoticed and recover from them.

Figures & tables

Appendix figures & tables9 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. PatchWorld: Gradient-Free Optimization of Executable World Models

    May 29, 2026Jiaxin Bai, Yue Guo, Yifei Dong +13Model-Based PlanningGradient-Free Optimization

  2. VisualPatchWorld: Code World Models as Latent Structured Representations for Planning

    Jul 28, 2026Jiaxin Bai, Jiaxuan XiongModel-Based PlanningWorld Models

  3. Agentic World Action Models

    Oct 21, 2026Zhuoyang Liu, Dantong Niu, Botong Zhang +15Agentic AI for RoboticsWorld Action Models