–
games completed
–
Relative Human Action Efficiency
160/183
levels completed
+20.24
RHAE with Bayesian guidance

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.

OPINE-World architecture: observations and replay buffer, semantic world agent, Bayesian belief state, synthesis agent, and planning and exploration loop.
OPINE-World. The world produces an observation ω\omega, stored in replay buffer 𝒟\mathcal D and checked against the programmatic model.

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

𝒮̂B\widehat{\mathcal S}_{\mathrm B} groups object transitions into their observed effect under unique value combinations of τ,a,c\tau,a,c: j=(τ,a,c),\begin{equation} j=(\tau,a,c), \label{eq:empirical-row} \end{equation} where τ\tau is an inferred object type, aa is the action, and cc summarizes relevant context. For effect ee, let Ct(j,e)C_t(j,e) be its count, nj=∑eCt(j,e)n_j=\sum_e C_t(j,e), and mm the effect alphabet size. With a symmetric Dirichlet prior α0\alpha_0, q̂j(e)=α0+Ct(j,e)mα0+nj,ηj=H⁡(q̂j)log⁡m.\begin{equation} \widehat q_j(e) = \frac{\alpha_0+C_t(j,e)}{m\alpha_0+n_j}, \qquad \eta_j = \frac{\operatorname{H}(\widehat q_j)}{\log m}. \label{eq:row-predictive} \end{equation}

With α0=1\alpha_0=1, this gives Laplace smoothing. We use the posterior predictive entropy ηj\eta_j 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 njηjn_j\eta_j, the group’s total unexplained entropy, are passed to synthesis where a ηj\eta_j 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 1−count of its most common outcome1+number of observations1-\frac{\text{count of its most common outcome}}{1+\text{number of observations}} and provided as an actor-facing exploration priority (Appendix B.4).

Pooled effect distributions are mixed until the row is split by the piece's own context, unconfounding the rule
Anatomy of the ar25 eta curve: initialization, perturbation under CEGIS repair, steady fall once the model is accurate

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).

Aggregate RHAE and coverage. OPINE-World, the 𝒮̂B\widehat{\mathcal S}_{\mathrm B} ablation, and other systems. Standard errors are computed across the 25 games. Per-game results appear in Appendix F.1.
OPINE-World Other systems
Metric Full No 𝒮̂B\widehat{\mathcal S}_{\mathrm B} baseline1 DreamTeam Continual OpenClaw
Mean ±\pm SE 78.4 ±\pm 6.3 58.2 ±\pm 8.3 63.7 ±\pm 7.4 38.1 ±\pm 7.6 20.5 ±\pm 5.7 5.2 ±\pm 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 𝒮̂B\widehat{\mathcal S}_{\mathrm B} improve exploration?

Alongside a comparison against other systems, we compare the full system against an 𝒮̂B\widehat{\mathcal S}_{\mathrm B} ablation, and an ϵ\epsilon-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

Online progression with and without Bayesian guidance. Each step marks a completed level. Blue or red shading marks intervals where the denoted system leads. Ordered by blue area.
Online progression with and without Bayesian guidance. Each step marks a completed level. Blue or red shading marks intervals where the denoted system leads. Ordered by blue area.

The largest gains over the 𝒮̂B\widehat{\mathcal S}_{\mathrm B} 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 ϵ\epsilon-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 𝒮̂B\widehat{\mathcal S}_{\mathrm B}. Detailed case-by-case review and trace excerpts are provided in Appendices F.4 and F.5.

Detailed results
Paired online comparison for RQ1. Conditions are paired within each of the 25 games.
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 (dzd_z) 0.69
RHAE: exact pp 4.27×10−44.27\times10^{-4}
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) [8.0,31.0][8.0,31.0]
Level completion: exact pp 1.95×10−31.95\times10^{-3}
Levels completed within 400 actions for the full system, the 𝒮 ̂ B ablation, and ϵ -greedy ablation.
Levels completed within 400 actions for the full system, the 𝒮̂B\widehat{\mathcal S}_{\mathrm B} ablation, and ϵ\epsilon-greedy ablation.
Exploration at 400 actions per game. RHAE follows Appendix G.
Condition RHAE Levels cleared Games solved
Full system 65.97 141/183 13/25
𝒮̂B\widehat{\mathcal S}_{\mathrm B} ablated 52.96 115/183 8/25
ϵ\epsilon-greedy (ϵ=0.1\epsilon=0.1) 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:

  1. Monolithic Code Structure. Classic MDP framing, where the whole world’s transitions are described in a single monolithic transition function.

  2. 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.

  3. 𝒮̂B\widehat{\mathcal S}_{\mathrm B} 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.

  4. Unrestricted (No 𝒮̂B\widehat{\mathcal S}_{\mathrm B}). 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

Prediction and synthesis cost under same evidence. Error bars show standard errors.
Prediction and synthesis cost under same evidence. Error bars show standard errors.

With the same evidence supplied to synthesis, 𝒮̂B\widehat{\mathcal S}_{\mathrm B} 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 𝒮̂B\widehat{\mathcal S}_{\mathrm B} 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.

Revision costs for local changes, new level mechanics, and global changes.
Revision costs for local changes, new level mechanics, and global changes.

The clearest revision advantage for 𝒮̂B\widehat{\mathcal S}_{\mathrm B} 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 𝒮̂B\widehat{\mathcal S}_{\mathrm B}.

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 𝒮̂B\widehat{\mathcal S}_{\mathrm B} 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
Fixed-evidence predictive and source measurements. Means and standard deviations over five runs per condition. Exact match uses the shared 100,000-transition buffer. Registered state functions are model-declared candidates, while admitted functions pass a local effect-splitting check. Admission count does not measure the accuracy of the complete transition program. Maximum cognitive complexity is an auxiliary source diagnostic.
Condition Exact match (%) SLOC Functions Max cognitive Registered Admitted
Full system 83.9±9.383.9\pm9.3 1004±841004\pm84 61.0±7.261.0\pm7.2 61.6±14.161.6\pm14.1 10.4±3.410.4\pm3.4 0.8±0.40.8\pm0.4
Monolithic 73.2±16.573.2\pm16.5 915±146915\pm146 18.2±4.318.2\pm4.3 549.4±164.2549.4\pm164.2 – –
Type-restricted 64.4±23.664.4\pm23.6 1107±2271107\pm227 71.4±7.771.4\pm7.7 64.8±62.264.8\pm62.2 8.4±3.68.4\pm3.6 0.8±0.80.8\pm0.8
No 𝒮̂B\widehat{\mathcal S}_{\mathrm B} 71.6±11.971.6\pm11.9 949±124949\pm124 48.4±4.948.4\pm4.9 81.6±40.681.6\pm40.6 – –
No persistent NL 66.9±18.566.9\pm18.5 709±61709\pm61 70.6±7.670.6\pm7.6 63.0±38.363.0\pm38.3 10.8±3.310.8\pm3.3 2.4±1.72.4\pm1.7
Fixed-evidence synthesis accounting. Means and standard deviations over five runs per condition. Output is reported in thousands of tokens. Input and total are reported in millions of tokens.
Condition Rounds Output (k) Input (M) Total (M)
Full system 33.6±5.733.6\pm5.7 741±184741\pm184 66.8±16.666.8\pm16.6 67.5±16.867.5\pm16.8
Monolithic 29.0±3.929.0\pm3.9 631±161631\pm161 53.2±15.353.2\pm15.3 53.9±15.453.9\pm15.4
Type-restricted 34.8±9.934.8\pm9.9 814±272814\pm272 70.7±22.770.7\pm22.7 71.5±22.971.5\pm22.9
No 𝒮̂B\widehat{\mathcal S}_{\mathrm B} 33.8±5.033.8\pm5.0 789±144789\pm144 65.5±10.665.5\pm10.6 66.3±10.766.3\pm10.7
No persistent NL 32.0±4.232.0\pm4.2 722±193722\pm193 64.4±15.264.4\pm15.2 65.2±15.365.2\pm15.3
Detailed revision measurements. M1 and M3 are means over ten repairs per condition. M2 reports 30 level transitions for the full and monolithic conditions and 22 transitions with available snapshots for the type-restricted condition. Code lines exclude comments and blank lines. Churn divides changed code by entering engine size.
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
Tests of revision cost against the full system. M1 uses exact two-sided sign-flip tests on ten matched repair runs. M3 uses exact two-sample permutation tests on ten independent synthesis replications per condition. All pp-values are unadjusted.
Change Outcome Monolithic pp Type-restricted pp
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 (𝒮̂NL,T̂NL,R̂NL)(\widehat{\mathcal S}_{\mathrm{NL}},\widehat T_{\mathrm{NL}},\widehat R_{\mathrm{NL}}) 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

Model learning with and without persistent NL. For graphs a–c and e, lower is better. For graphs d and f, higher is better. Detailed run values and tests are provided in Appendix F.8 .
Model learning with and without persistent NL. For graphs a–c and e, lower is better. For graphs d and f, higher is better. Detailed run values and tests are provided in Appendix F.8.

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, 𝒮̂B\widehat{\mathcal S}_{\mathrm B} 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
Online NL ablation. Run values are ordered by run index. Actions count interaction through completion of level 3. Tokens combine synthesis output and billable input and are reported in millions. Changed-code values are available for three runs. Each pp-value comes from an exact two-sample permutation test over condition labels.
Outcome Full-system runs Ablation runs Full mean Ablated mean Full reduction Exact pp
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
Token components in the online NL ablation. Means over five runs per condition, in millions of tokens. Reductions use the ablated condition as the denominator. Tests use exact two-sided permutations of condition labels.
Component Full mean Ablated mean Full reduction Exact pp
Output .401 .764 47.5% .0238
Billable input 32.48 63.52 48.9% .0159

Observations · what the run artifacts show

01 · η ACROSS ALL 25 GAMES

η 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

won errored level cleared, η valued (on hover) synthesis event (on hover) hover = absolute η, rest = relative shape

Replays · all 25 scored runs, from the released artifacts

Replays of all 25 scored runs, with per-step reasoning and engine state

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.

Click a game to open its replay · dots are levels: filled = at or above 50% level score, gray = cleared slower, hollow = budget ended there
LEVELS VS ACTIONS

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.

OPINE-World human baseline1
SCORE PER LEVEL

Per-level scores across all 183 levels

More area is better. A level scores min(1.15, (human/agent)²), where human and agent are the number of actions the human baseline and the agent took to clear the level; uncleared levels score 0. ARC-AGI-3 gives no extra credit for clearing a level in far fewer actions than the human (1.15 cap): OPINE-World beats the cap on 109 of its 160 cleared levels, often by large margins the score cannot reflect.

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, 𝒮̂B\widehat{\mathcal S}_{\mathrm B} 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 𝒮̂B\widehat{\mathcal S}_{\mathrm B} 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 𝒮̂B\widehat{\mathcal S}_{\mathrm B} 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},
}
References
Alur, Rajeev, Rastislav Bodík, Garvit Juniwal, et al. 2013. “Syntax-Guided Synthesis.” FMCAD, 1–8.
Jha, Susmit, Sumit Gulwani, Sanjit A. Seshia, and Ashish Tiwari. 2010. “Oracle-Guided Component-Based Program Synthesis.” ICSE, 215–24.
Solar-Lezama, Armando, Liviu Tancau, Rastislav Bodík, Sanjit A. Seshia, and Vijay A. Saraswat. 2006. “Combinatorial Sketching for Finite Programs.” ASPLOS, 404–15.