Introduction
Consider an agent placed inside an unfamiliar environment. The structured state, action semantics, transition function, reward function, and goal are all withheld. In ARC-AGI-3, the agent can learn only from pixels, returned rewards, and its own interactions.
Extending the world modeling approach of WorldCoder, our idea is to maintain two levels of representation: a qualitative, object-oriented natural language (NL) proto-representation of the world, and an executable world model in Python. Exploration and program revision share this evolving abstraction, allowing new evidence to revise both the hypothesized mechanics and their implementation in tandem at test time. The shared object abstraction additionally supports lifted Bayesian tracking of epistemic uncertainty over object–action effects. These beliefs identify sparsely tested or correlative effects, allowing for targeted exploration to learn causal relationships.
Methodology
Model representation
The NL model acts as a proto-representation of our MDP. It can represent partial claims such as “colour x may be an important confounding variable for object y”. These uncertainties are quantitatively expressed in a Bayesian belief state, which records empirical effect distributions for object type, action, and observable context from a deterministic, replay-based extractor. A mixed distribution of such observations in a deterministic environment indicates that the current model fails to distinguish a confounding variable.
Model learning loop
Counterexample-guided inductive synthesis (CEGIS). Compare the prediction with the observed truth. Treat each disagreement as a counterexample for the next candidate program (Solar-Lezama et al. 2006; Jha et al. 2010; Alur et al. 2013).
A prediction mismatch stops the current plan and opens a short collection window for related counterexamples.
This framing tells us two sources of useful interaction. First, a reward-directed plan under optimism drives the agent to a state where its current model claims a useful consequence will occur. If the plan succeeds, the agent solves the task; if it fails, reality provides a goal-relevant counterexample. We call this goal-directed falsification.
Second, an explicit epistemic mechanism can explore an unresolved mechanic independent of reward paths. This is important for mechanics that can’t appear in a reward-directed plan because the current model lacks the ontology needed to represent them. We call this ontology-error-prioritized interactive exploration.
Bayesian effect uncertainty and state refinement
groups object transitions into their observed effect under unique value combinations of : where is an inferred object type, is the action, and summarizes relevant context. For effect , let be its count, , and the effect alphabet size. With a symmetric Dirichlet prior ,
With , this gives Laplace smoothing. We use the posterior predictive entropy as a diagnostic of sparse evidence or unresolved effect distinctions under the deterministic modeling assumption. To target the latter, the mixed groups with the largest , the group’s total unexplained entropy, are passed to synthesis where a minimizing split is kept if discovered. Each mixed group is then divided by the values of its resulting contexts, and each subgroup is scored as and provided as an actor-facing exploration priority (Appendix B.4).
Results
OPINE-World achieves the highest RHAE among comparators and completes the most games under matched game versions and scoring (Table 1; per-game results in Appendix F.1). On games completed by both OPINE-World and the strongest comparator, the main advantage is level completion rather than efficiency, suggesting that broader discovery of mechanics contributes more to the aggregate gain than shorter solutions to familiar tasks (RQ1).
| OPINE-World | Other systems | |||||
|---|---|---|---|---|---|---|
| Metric | Full | No | baseline1 | DreamTeam | Continual | OpenClaw |
| Mean SE | 78.4 6.3 | 58.2 8.3 | 63.7 7.4 | 38.1 7.6 | 20.5 5.7 | 5.2 1.0 |
| Levels completed | 160/183 | 126/183 | 146/183 | 98/183 | 64/183 | 28/183 |
| Games completed | 20/25 | 12/25 | 14/25 | 6/25 | 3/25 | 0/25 |
Experimental setup
We use Claude Opus 4.8 high 1m under Docker
isolation from game source and network access. RQ2 and RQ3 studies use
low effort and g50t as a demanding case study combining
history-dependent dynamics, interacting object types, and progressively
introduced mechanics (Appendix C.1).
The supplementary material contains the full implementation of
OPINE-World (Appendix C), and ablation
details (Appendix C.1).
Research questions and results
RQ1: Does our Bayesian epistemic guidance improve exploration?
Alongside a comparison against other systems, we compare the full system against an ablation, and an -greedy baseline (Appendix F.2) on the 25 public ARC-AGI-3 games with a 2000-action budget per game, or on a stall of more than 500 actions per level. We measure the per-game difference in RHAE (Appendix G) and inspect the action reasoning traces to identify the failure sources for all 25 games (Appendix F.4).
RQ1: Effect of Bayesian guidance on online discovery
The largest gains over the
ablation occur when the agent fails to discover a mechanic needed for
progress (Figure 2). In
g50t and dc22, the ablated agent repeats
similar sequences or configurations while unresolved interactions remain
untested. In cn04, it fails to sufficiently model a button,
and in sc25, it misses an earlier projectile mechanic.
Missing an interaction required by the solution prevents level
completion, even if the agent has learned the other mechanics correctly,
indicating that such exploratory oversights can be catastrophic. These
failures suggest that Bayesian guidance helps the agent move beyond
familiar actions when its current model fails to explain how to make
progress.
The effect can extend beyond the level in which a mechanic is first
encountered. In ls20, the ablated agent fails to transfer a
tested object-class property; in sp80, insufficient early
probing leaves an incorrect mechanic in the model used for later
planning. In some games, additional exploration is not useful,
especially when exploration targets uncertainties that are entirely
irrelevant to the goal; however, this often cannot be known in
advance.
We additionally measure against a naive exploration method: an -greedy exploration baseline (Figure 6). We see that random object exploration is insufficient to provide valuable evidence, and often is detrimental to goal planning if sufficient knowledge has been accrued. This motivates the case for a more principled exploration method such as . Detailed case-by-case review and trace excerpts are provided in Appendices F.4 and F.5.
Detailed results
| Measurement | Value |
|---|---|
| Full-system mean RHAE | 78.40 |
| Ablated mean RHAE | 58.16 |
| Mean paired RHAE difference | 20.24 |
| Standard deviation of paired differences | 29.45 |
| Paired standardized effect () | 0.69 |
| RHAE: exact | |
| Full-system levels completed | 160/183 |
| Ablated levels completed | 126/183 |
| Additional levels completed | 34 |
| Completion-rate difference (percentage points) | 18.6 |
| Paired game-cluster bootstrap 95% CI (percentage points) | |
| Level completion: exact |
| Condition | RHAE | Levels cleared | Games solved |
|---|---|---|---|
| Full system | 65.97 | 141/183 | 13/25 |
| ablated | 52.96 | 115/183 | 8/25 |
| -greedy () | 39.49 | 106/183 | 7/25 |
RQ2: How does the program structure used to encode transition semantics affect generalizability, adaptability, and maintainability (code metrics) of the programmatic world model?
Under a fixed action trajectory for all runs, we both prompt-restrict and code-structure-restrict the programmatic world model outputted by the synthesizer agent in various ways:
Monolithic Code Structure. Classic MDP framing, where the whole world’s transitions are described in a single monolithic transition function.
Type-Oriented Code Structure. An object-oriented framing where transition functions for an object type are defined within each object class, or a type-relational class.
Code Structure (Unablated). A hybrid framing encouraged naturally by the Bayesian Belief State where transition functions for an object type are encouraged to be defined within each object type’s class only where easily definable through the Bayesian Belief State.
Unrestricted (No ). A completely unconstrained code synthesis for control purposes.
After confirming that the interventions produce different program structures (Appendix C.3), we measure generalizability, adaptability, and maintainability. Adaptability is assessed through locality and synthesis cost of code revisions from a modified environment, measured by changed source lines, engine rewrite percentage, functions changed, synthesis rounds, and output tokens. Generalizability is measured as the prediction accuracy on unseen state transitions across these modified environments. To facilitate these measurements, we change an existing object mechanic (M1), introduce new objects and relations (M2), and change a global rule (M3) (Appendix F.7).
RQ2: Effect of program structure on prediction and revision
With the same evidence supplied to synthesis, Code Structure (Unablated) has the highest accuracy on unseen transitions across the RQ2 conditions (Figure 3). The Type-Oriented variant performs worst despite using more tokens on average. Upon inspection, we found that successful models encoded object transitions in a shared monolithic structure because heavily coupled effects are difficult to assign to individual objects. As a result, programs that were learned with Code Structure retained object-indexed state while allowing interactions to be resolved jointly, suggesting that the organization of transition rules should remain flexible even when the state is best represented as object-centric.
The clearest revision advantage for Code Structure occurs when a local mechanic changes (M1): it edits fewer definitions and requires less rewriting, fewer synthesis rounds, and fewer output tokens than Monolithic Code Structure and Type-Oriented Code Structure (Figure 4). Interestingly we see that the type-oriented structure has a large variance. Upon inspection, these costly outliers were due to overcommitment to structure, resulting in wrongly abstracted typings during periods of uncertainty. These are very expensive to repair and were avoided with the type-uncertainty information from .
However, when later levels introduce new mechanics (M2), we see that a new level usually requires significant changes even across multiple types, reducing the advantage of type abstraction. Interestingly, we found that the monolithic system has less structure, giving it an innate advantage for organizational cost that was counteracted by the code’s difficulty to maintain. Although costs are similar across methods, the superior generalization of the unablated system shows that such adaptation is more robustly incorporated. Additionally, we see in M3 that although Code Structure uses fewer output tokens, synthesis round count is comparatively close. Program organization can therefore reduce the tokens required to repair the model each synthesis round. See Appendix F.7 for details.
Detailed results
| Condition | Exact match (%) | SLOC | Functions | Max cognitive | Registered | Admitted |
|---|---|---|---|---|---|---|
| Full system | ||||||
| Monolithic | – | – | ||||
| Type-restricted | ||||||
| No | – | – | ||||
| No persistent NL |
| Condition | Rounds | Output (k) | Input (M) | Total (M) |
|---|---|---|---|---|
| Full system | ||||
| Monolithic | ||||
| Type-restricted | ||||
| No | ||||
| No persistent NL |
| Change | Condition | Code lines | Churn (%) | Definitions | Rounds | Output (k) |
|---|---|---|---|---|---|---|
| M1: local | Full system | 4.8 | 0.75 | 1.1 | 2.00 | 25.6 |
| Monolithic | 314.4 | 45.83 | 9.4 | 5.00 | 76.9 | |
| Type-restricted | 229.6 | 27.50 | 18.2 | 5.00 | 71.7 | |
| M2: level | Full system | 107.5 | 25.92 | 11.8 | 4.70 | 101.5 |
| Monolithic | 115.7 | 30.57 | 4.1 | 3.93 | 84.5 | |
| Type-restricted | 146.3 | 34.01 | 13.4 | 5.05 | 117.8 | |
| M3: global | Full system | 100.3 | 15.75 | 10.8 | 4.00 | 39.8 |
| Monolithic | 163.7 | 23.86 | 7.5 | 4.00 | 56.8 | |
| Type-restricted | 145.1 | 17.38 | 12.1 | 4.00 | 56.4 |
| Change | Outcome | Monolithic | Type-restricted |
|---|---|---|---|
| M1 | Changed lines | .00195 | .00195 |
| Engine churn | .00195 | .00195 | |
| Synthesis rounds | .00195 | .00195 | |
| Output tokens | .00195 | .00195 | |
| Changed definitions | .00586 | .00195 | |
| M3 | Output tokens | .0117 | .0356 |
| Changed lines | .0700 | .2448 |
RQ3: Will ablating the NL world model and using a pure code representation perform as well as our hybrid NL and programmatic world model approach?
We compare against an NL ablation that prevents the generation of an explicit NL world model as files. Because the synthesis agent’s context is reset at each stage, we can consider this as removing the persistent NL representation of the world. We hypothesize that NL can better represent hypotheses and unresolved correlative observations, which should increase the RHAE and decrease the model-revision cost.
RQ3: Effect of persistent NL on model learning
Compared to NL ablation, the complete system requires fewer actions, synthesis rounds, and tokens during early learning when object behaviors are still poorly understood (Figure 5). In the fixed-evidence RQ2 comparison, Code Structure also has higher mean held-out accuracy than No NL. This suggests that persistent language helps synthesis interpret observations in addition to any improvement in action selection.
Both conditions encode latent histories and executable mechanics in Python. The full system’s artifacts additionally retain the observations supporting a hypothesis, superseded explanations, and unresolved questions. These records preserve hypotheses when the evidence is insufficient. In the NL ablation traces, failures often concern sparsely tested behaviors with several plausible explanations. Retaining these qualitative explanations helps later synthesis revise an uncertain model without needing to reconstruct why its rules were introduced.
Detailed results
| Outcome | Full-system runs | Ablation runs | Full mean | Ablated mean | Full reduction | Exact |
|---|---|---|---|---|---|---|
| Actions to clear level 3 | 169, 277, 237, 176, 227 | 626, 268, 756, 249, 289 | 217.2 | 437.6 | 50.4% | .0238 |
| Synthesis rounds | 14, 16, 16, 10, 13 | 39, 19, 32, 17, 14 | 13.8 | 24.2 | 43.0% | .0397 |
| Total tokens (M) | 31.95, 38.99, 31.73, 29.71, 32.01 | 109.73, 35.44, 90.84, 40.40, 45.00 | 32.88 | 64.28 | 48.9% | .0159 |
| Changed code lines | 629, 839, 958 | 1,883, 1,021, 1,413 | 808.7 | 1,439.0 | 43.8% | .1000 |
| Component | Full mean | Ablated mean | Full reduction | Exact |
|---|---|---|---|---|
| Output | .401 | .764 | 47.5% | .0238 |
| Billable input | 32.48 | 63.52 | 48.9% | .0159 |
Observations · what the run artifacts show
η trajectories across the 25 runs
We see that onological uncertainty falls over the course of the game, and periodically spikes when a new level introduces objects and interactions not previously seen
Replays · all 25 scored runs, from the released artifacts
Each card replays the scored run, including intermediate animation frames. The Reasoning tab follows the playhead and shows the move set the acting agent chose at that step, with its rationale. The Engine tab shows the synthesized world model as of that step. Diamonds on the timeline mark synthesis rounds, and added lines are highlighted against the previous round.
Levels cleared against cumulative actions, per game
Levels cleared against cumulative actions, as on the official task pages. Black is OPINE-World, gray the human reference, light gray baseline1. A flat tail is budget spent on an uncleared level. Clicking a game opens its replay.
Per-level scores across all 183 levels
Limitations
We limit our evaluation to deterministic discrete ARC-AGI-3 environments, extension to stochastic or continuous domains would require significant extensions. Replay consistency also provides no guarantees for entirely unvisited objects. Appendix E discusses these limitations in detail.
Conclusion
We introduced OPINE-World, which combines Bayesian epistemic guidance, NL world models, and programmatic world models for online world-model learning. On ARC-AGI-3, we show that Bayesian guidance reduces catastrophic discovery failures, Code Structure supports efficient repair, and an NL proto-representation reduces learning costs. These results support preserving a hybrid NL-Programmatic world model and using for open-world problem solving.
We provide source code for OPINE-World as supplementary material. Its README documents installation, how to fetch the public ARC-AGI-3 games, the Docker sandbox, and a launch script that runs games with the configuration used for our main results and ablations in RQ1 to RQ3. The models, reasoning effort, action budgets, and the constants of the learning loop and of are listed in Appendix C, the verifier and the admission checks are specified in Appendix B, and scoring follows Appendix G. Because the agents are language models acting in a live environment, repeated runs vary in their action counts; the statistical tests in Appendix C account for this variation.
Implementation Details
Setup and Models
This harness was run with Opus 4.8 (high), limited to a 500k context length, and 5 of the 20 games encountered some rate limiting issues that caused premature closure of their scorecards well below the 2000 action limit, while their trajectories were still very promising. Our true score lies somewhere between 92.1 (assuming those failed games scored the average of the others) and 78.4.
We believe that with a stronger model (GPT-5.6 Sol or newer) or a higher effort (xhigh or max effort), will deliver significant improvements on top of this.
Even so, we still consider this preliminary result an impressive score, and hope that our uniqueness in modeling epistemic knowledge, where other current harnesses seem to take a purely worldcoder-adjacent approach, will be useful to the community.
Citation
@misc{courtis2026opineworldprogrammaticworldmodeling,
title={OPINE-World: Programmatic World Modeling with
Ontology-error-Prioritized Interactive Exploration for ARC-AGI-3},
author={David Courtis and Wenhao Li and Scott Sanner},
year={2026},
eprint={2607.01531},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2607.01531},
}





