Code as Worlds Agentic Discovery of Executable World Representations for Physical Reasoning

Overview

Representing the physical world through code

Code-as-World teaser showing executable composition, evolution, and appearance supporting physical reasoning, video generation, and embodied intelligence
01

Abstraction

Code captures entities, states, events, and relations through abstract concepts rather than raw observations. Separating task-relevant structure from incidental pixel details enables shared representations across observations while distinguishing physical state from perceived appearance.

02

Compositionality

Code organizes objects, environments, relations, initial states, dynamics, cameras, and rendering choices into explicit structures that can be constructed, decomposed, and recombined. This supports targeted reasoning over one component while preserving the rest of the world representation.

03

Executability

Code expresses rules, constraints, and dynamics in a form a simulator can execute. The resulting trajectories, interactions, and rendered observations make the representation testable against physical evidence through consistency of world composition, constraints, and evolution rather than pixel-level duplication.

04

Controllability

Explicit code makes objects, physical parameters, initial conditions, dynamic rules, and camera settings directly inspectable and editable while the remaining structure stays fixed. This enables interventions, counterfactual rollouts, diagnosis, and iterative refinement, turning a recovered world into a controllable program.

Demo

Code-as-World Video

Scaling analysis

Parameter scaling on QuantiPhy

Code-as-World-VL average MRA

4B
50.6
9B
55.4
27B
58.6
Parameter scaling plot on QuantiPhy comparing average MRA across model sizes

Benchmark results

Quantitative physical reasoning

BibTeX

@misc{codeasworld2026,
  title        = {Code-as-World: Agentic Discovery of Executable World
                  Representations for Physical Reasoning},
  author       = {{Code-as-World Project}},
  year         = {2026},
  howpublished = {Project page}
}