arXiv(opens in a new tab)cs.CVOct 2026Cited by 3 papers on PaperVantage

Manuscript Offprint

arXiv:2610.12374

AgentGarten: Code Worlds for Evolving Agents

Jiawei Chi, Shangchen Miao, Zhiyuan Shi, Kailu Wu, Hanyang Wang, Weiliang Chen, Qiyu Dai, Jinshan Ren, Jun Gao, Mingsheng Long, Yueqi Duan, Jiangran Lyu, Jialong Wu, Fangfu Liu

Abstract

Interactive virtual worlds allow agents to learn through exploration and interaction. What agents can learn is bounded by the environments they practice in, which must be faithful, with consistent state, rules, and dynamics, and realistic, with observations that follow the real-world visual distributions. Achieving both across diverse worlds remains a bottleneck. We introduce AgentGarten, a framework that couples simulators and game engines with a shared neural renderer to build real-time interactive environments. Its simulation backends maintain persistent world state and execute program-defined interaction rules, while the renderer generates visual observations from structured conditions exported through a common interface. To build the neural renderer, we adapt a pretrained video model to geometry conditions, distill it with our proposed Adversarial Forcing, and optimize inference for real-time interaction. Adversarial Forcing makes history prefilling differentiable through exact replay, so that losses on later predictions update how the renderer encodes prior observations, and adds real-data adversarial supervision to improve its visual quality. In AgentGarten, agents perceive the world through visual observations, interact with it in real time, and improve by distilling each round of experience into playbooks that subsequent agents inherit and refine. Our empirical study demonstrates a substantial gain in learning efficiency, with agents learning from just 4 rounds compared with millions for a conventional reinforcement learning counterpart. As new worlds can be written as code and rendered through the same interface, environments can scale in both number and difficulty alongside their agents, a step toward agents that keep evolving through interactive experience.

Date: October 8, 2026

Blog: https://mirros.ai/blog/worlds-for-evolving-agents

Code: https://github.com/MirroS-Lab/AgentGarten

Project Page: https://mirros-lab.github.io/agent-garten

Code worlds

Diverse appearances

Figure

Geometry

Halloween

Medieval

Minecraft

Diverse tasks

Navigation

Manipulation

Tool use

Multi-agent racing, from each player's camera

Evolving agents

Act on rendered views

Figure

Hider

Seeker

2 Review and write skills

hider · check_shelter.md

“Defend access, not just the camera view.”

seeker · object_control.md

"Verify object control with a small experiment."

seeker · ramp_landing.md

"A ramp route has three separate milestones."

3 New strategies appear

Figure

4 rounds before hiders build shelters

10 rounds before seekers use ramps

Figure 1 Code worlds for evolving agents. Top: Diverse environments spanning distinct geometries, visual appearances, and interactive tasks. Bottom: Agents continuously evolve through environmental interactions, developing increasingly sophisticated strategies such as shelter-building and ramp-crossing.

1 Introduction

Agents learn from trajectories of actions and observations. Developing scalable, generalizable agent capabilities requires environments that not only faithfully preserve the consequences of past actions over extended interactions, but also support flexible variation in layouts, objects, and task rules. Across navigation, manipulation, and multi-agent interaction, scaling these environments therefore requires both controllable, inspectable dynamics and diverse visual observations.

However, existing approaches face a fundamental trade-off. Simulators and game engines support agent learning through explicit state and programmable interaction rules [1–3]. Yet expanding their visual diversity entails substantial 3D asset creation and complex rendering pipelines, making new environments costly to build and customize. Conversely, video world models synthesize rich, interactive visual observations from data [4–7]. In these models, however, task-relevant state and physical transition rules remain implicit within generated histories and learned representations, precluding direct inspection, editing, and testing of the environment's behavior.

We introduce AgentGarten, a framework for building code worlds that combines programmable dynamics with a shared, real-time neural renderer (Figure 2). In AgentGarten, each scene program runs in a simulator or game engine that maintains persistent state and executes explicit interaction rules. A shared neural renderer synthesizes the agent's visual observations from structured conditions exported by the engine through a unified interface. This separation preserves rigorous control over state and rules while allowing compatible engines to share a single renderer. New environments can thus be authored by coding agents from text or image inputs, then edited and extended entirely in code without creating bespoke visual assets for every scene.

Operating a video model as an interactive neural renderer requires it to strictly follow updated engine conditions, maintain visual consistency across extended rollouts, and synthesize observations in fine-grained, short blocks so that agents receive immediate feedback after brief actions. We adapt a pretrained bidirectional video model to structured conditions, convert it to block-causal generation, and distill it into a real-time renderer on a single GPU with Adversarial Forcing, which trains the renderer on its own rollouts via distribution matching [8–10] and introduces two key advances. First, to allow later losses to update the history-encoding computation without the memory cost of a fully differentiable rollout, we adopt two-pass training [11] and introduce exact replay: a block-by-block execution schedule that eliminates numerical divergence between sampling and recomputation and achieves bitwise-identical recomputation of the rollout trajectory. Second, to prevent the visual degradation that score distillation alone exhibits over long rollouts, we incorporate a real-data adversarial objective [10, 12] and derive an exact R1/R2 regularization scheme for a discriminator with a frozen backbone, entirely avoiding double-backward passes through fused attention kernels.

Code worlds provide rich environments for agents to practice and evolve. We evaluate pretrained foundation-model agents across rounds of interaction, where they perceive the world strictly through rendered observations, diagnose failures, and distill key insights into written playbooks inherited by subsequent rounds. In hide-and-seek [13], agents rapidly grounded abstract spatial knowledge into closed-loop physical execution, with ramp use and shelter construction emerging within a handful of games. The same reflective loop improved performance across rounds in several additional, diverse environments (Section 5).

Our contributions are:

  • A framework for code worlds that couples persistent, editable environment state to a shared real-time neural renderer through structured conditions, enabling programmable interaction and diverse visual observations across compatible engines without per-scene visual asset authoring.

  • Adversarial Forcing, a distillation method for a few-step, block-causal neural renderer. It combines distribution matching on self-rollouts with exact bitwise replay for history gradients, alongside a real-data adversarial objective whose exact R1/R2 regularization avoids double-backward through fused attention.

  • An empirical study of evolving agents. Pretrained agents observing exclusively through neural rendering rapidly ground semantic tool knowledge and improve outcomes across rounds through written playbooks in hide-and-seek and several further distinct worlds.

Figure

Figure 2 Interaction and rendering in a code world (Eqs. 1 and 2). The agent submits actions and receives generated observations. The engine maintains scene state and exports structured conditions, here surface normals; the neural renderer combines them with an appearance reference, text, and cached visual history. New observations return to the agent and join the history.

References (98)