Robotics · 2026-11-30

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

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

arXiv:2611.36808PDF

AI-assisted summary based on the paper. Consult the linked source for methods and limitations. Benchmark numbers appear after editor verification.

TL;DR

Predictive Code Worlds (PCW) has a code-as-policy robot agent write an executable code world for its task before writing the policy, then add world predictions for each subgoal. Predictions are not trusted by default: faults injected during development label verdicts, and only certified predictions can trigger runtime recovery/rollback. With Qwen3.8-Flash and self-improvement, PCW reaches 89.4% success on 80 LIBERO-Pro tasks and gains carry to Robosuite and BEHAVIOR-1K.

Why it matters

The authors argue that perception masks/depth/bounding boxes do not directly model task-relevant world facts, so weaker language models struggle. PCW shifts the burden from raw perception by making the agent write the world (facts, action effects, and goals) as code and then measure subgoal outcomes with certified predictions. The certified/rollback mechanism aims to prevent unreliable checks from blocking motions or undoing correct skills, and under disturbances it detects and recovers from failures.

Method

  • Agent writes a per-task code world (state map σ, effect model f, goal map g) that extracts named facts from observations with units/frames/evidence, predicts action effects, and grades progress.
  • Agent writes subgoal-level world predictions (success and most-likely failure ranges) measured on fresh post-subgoal observations and re-checks completed subgoals later.
  • During development, faults are injected to label verdicts; at runtime, only certified pass/fail verdicts act, with certified failures triggering rollback to the earliest completed subgoal that no longer holds.

Limitation

The paper states that world predictions can share the agent’s blind spots and relies on injected faults during development for certification; without injected faults, almost no fail verdict could have been certified.

Abstract (from arXiv)

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.

Related papers

Publication record

Bibliographic evidence describes where and when a record appeared. It does not validate scientific claims.

First announced by arXiv: 2026-11-30 · Indexed by Pub-AI: 2026-11-30 UTC

preprint

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

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

First announced by arXiv: 2026-11-30 · Original record ↗

arxiv
2611.36808
Explicit source versions (1)
  • v1 · Date not supplied
  1. Preprint available

    Source date: 2026-11-30 · First detected: 2026-11-30 UTC · Historical baseline

    Source evidence (1)
    • Official evidence ↗ · RSS guid=oai:arXiv.org:2611.36808v1; arxiv:announce_type=new; item pubDate (official metadata)
Abstract · arxiv

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.