Schema: Discovering Unknown Environments via Agentic Program Induction

Guanning Zeng, Jiani Wang, Wenjie Ma, Shaofeng Yin, Chenyang Wang, Shichen Liu, Angjoo Kanazawa, Wode Ni, Xiuyu Li, Andrea Zanette, Haiwen FengarXiv 2026

TL;DR

Schema is a novel agent harness that enables LLMs to master unfamiliar environments by building executable Python programs as "theories" of how the world works. By shifting from messy prose-based memory to structured, verifiable code, Schema achieves human-level performance on challenging discovery benchmarks like ARC-AGI-3 and MazeBench.

What Problem Does This Paper Address?

While modern LLM agents excel at tasks with known rules (like coding or summarizing), they struggle in "black-box" environments where the rules must be discovered through trial and error. Current agents typically record their observations in natural language prose within a context window.

The authors identify a fundamental flaw in this approach: prose is imprecise, it degrades as the context window fills up, and it cannot be directly "executed" to test a plan. Humans, by contrast, build mental models—compact, reusable theories that we test and refine. The gap between LLM agents and human-level discovery stems from the lack of a persistent, formal representation of the environment's mechanisms.

Methods

The authors introduce Interactive Program Induction (IPI), a paradigm where the agent expresses its understanding of the environment as a Python program ($P$). The Schema harness facilitates this through four core operations:

  1. Hypothesize: The agent uses file tools to write and revise Python code that defines the environment's state (grounding) and how actions change that state (transition rules).
  2. Certify: A backtesting tool replays the entire interaction history against the current program. If the program fails to predict a past observation, it provides the agent with a concrete counterexample for debugging.
  3. Plan: Instead of wasting "lives" or steps in the real environment, the agent uses its program as a simulator. It can run search algorithms (like BFS or A*) within its own code to find the most efficient path to a goal.
  4. Act with Verification: The agent commits to a plan, but the harness checks every step. If the environment's response deviates from the program's prediction, execution halts immediately, and the agent is prompted to revise its theory.
Figure 2: Overview of Schema. The LLM agent expresses its understanding as an executable program P in a persistent workspace. The harness checks P against recorded interactions and searches within it using goals and procedures chosen by the agent, without consuming environment actions. Committed plans execute one action at a time under prediction checks. A mismatch interrupts execution and returns new evidence for revising P. The ARC-AGI-3 LS20 level 3 example illustrates an unmodeled color-rotator effect with a simplified prediction: the key is predicted to remain orange but turns blue.

Datasets

The researchers evaluated Schema across three diverse benchmarks designed to test mechanism discovery:

  • ARC-AGI-3: A visual puzzle benchmark where agents must infer complex grid-manipulation rules from limited interactions.
  • DiG-bench: A suite of text-based games where both the transition rules and the win conditions are initially hidden.
  • MazeBench: A massive 3D exploration environment with 256 interconnected rooms. It requires long-term knowledge accumulation, as mechanisms discovered in early rooms (like how to slide on ice) must be reused tens of thousands of steps later.

Key Insights and Ideas

  • Code as a "Durable Theory": Unlike prose, code does not suffer from "context degradation." A function written at step 1,000 remains just as precise at step 20,000.
  • Surprise-Driven Learning: The "Act with Verification" step turns every prediction error into a high-signal learning event. The agent doesn't just fail; it learns exactly where its theory was wrong.
  • Simulation Saves Steps: By planning inside a self-induced simulator, agents become drastically more efficient. In ARC-AGI-3, Schema cleared levels using only 57% of the actions required by the human baseline.
  • Knowledge Accumulation: In MazeBench, the authors observed that as the agent's experience grew, its program became more "dense"—the number of transitions explained per line of code increased, proving that the agent was learning generalizable rules rather than just memorizing observations.

Key Results

Schema demonstrated massive performance gains over standard LLM harnesses:

  • ARC-AGI-3: Using the same base model (Claude Fable 5), Schema raised the Relative Human Action Efficiency (RHAE) from 58.7% to 99.2%.
  • DiG-bench: Schema solved 100% of the public games, matching human win counts at lower reasoning efforts than the baseline.
  • MazeBench: Schema reached the median performance of the top-50 human players, collecting 33 gems and visiting 139 rooms, significantly outperforming previous state-of-the-art coding agents.
Performance comparison across ARC-AGI-3, DiG-bench, and MazeBench.

Ablation studies confirmed that every part of the harness is critical. Removing the "Certification" (backtesting) step, for instance, caused the agent to frequently break its own working theories when trying to incorporate new information.

Limitations and Future Work

  • Deterministic Bias: The current implementation of Schema is primarily optimized for deterministic environments. Handling highly stochastic or partially observable worlds would require the agent to induce probabilistic programs.
  • Grounding Complexity: The agent still relies on the LLM's ability to map raw observations (like a grid of numbers) into structured objects. In extremely complex visual environments, this "grounding" step remains a bottleneck.
  • Search Costs: While planning in a simulator saves environment steps, the computational cost of the LLM generating and debugging the program can be high in terms of token usage.

Summary updated

BibTeX
@misc{zeng2026schema,
  author = {Guanning Zeng and Jiani Wang and Wenjie Ma and Shaofeng Yin and Chenyang Wang and Shichen Liu and Angjoo Kanazawa and Wode Ni and Xiuyu Li and Andrea Zanette and Haiwen Feng},
  title = {{Schema: Discovering Unknown Environments via Agentic Program Induction}},
  year = {2026},
  eprint = {2609.39140},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.39140},
}
Figure