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

Manuscript Offprint

arXiv:2610.11794

Memento 3: Model-Based Recursive Self-Improvement through Reflective Rulebooks

Haoyu Zhao, Zhengxu Yu, Zhiyuan He, Meng Fang, Rasul Tutunov, Haitham Bou-Ammar, Weilin Luo, Jun Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Haoyu Zhao 1^{1} Zhengxu Yu 2^{2} Zhiyuan He 2^{2} Meng Fang 3^{3}

Rasul Tutunov 2^{2} Haitham Bou-Ammar 1,2^{1,2} Weilin Luo 2^{2} Jun Wang 1,†^{1,\dagger}

1^{1}University College London 2^{2}Huawei Noah's Ark Lab, UK 3^{3}University of Liverpool

Learning to act in unfamiliar environments requires agents to infer how the world works and revise that understanding as new evidence arrives. Yet limited observations can support multiple world models that explain past interactions but predict different outcomes in unseen states. We introduce MEMENTO 3, building on the Memento series to enable frozen LLM agents to continually learn explicit world models through external memory. The agent maintains a natural-language rulebook as persistent semantic memory, recording revisable hypotheses about environment dynamics while leaving unknown aspects underspecified. It compiles this rulebook into executable code for prediction and planning. Through a continual loop of observation, reflection, rule revision, compilation, and verification, the agent uses prediction errors to refine both the rulebook and its code. Updated code is accepted only when the LLM judges it faithful to the rulebook and cell-exact replay reproduces the observed transitions. We investigate this process as a model-based route to recursive self-improvement (RSI): the agent autonomously explores the environment, revises its world model, and uses verified updates to guide subsequent interaction and learning, while the underlying LLM remains fixed. A population extension maintains multiple world models in parallel, sharing interaction evidence and using their predictions to guide exploration. On ARC-AGI-3, the single-model agent clears every level of all 25 public games, achieves a mean Relative Human Action Efficiency (RHAE) of 100.0, and uses 44% of the human action count. In an Atari Pong case study, a learned feedback controller wins 21:0 in each of three evaluated episodes with different openings, without further LLM calls.

Current State

Figure

1 Remaining Move Budget

Rulebook

1 Remaining Move Budget

Each Move Uses One Unit Of The Budget.

Reject Plans That Run Out Of Moves.

2 Rotation Pad

Rotate The Pattern 90° Clockwise.

Keep Its Colour.

3 Colour Pad

Advance To The Next Colour In Its Cycle.

Keep The Pattern.

4 Refill

Restore The Move Budget To Full.

Consume The Refill Once Collected.

5 Matching Door

Require The Same Pattern And Colour.

Enter The Door To Open It.

Executable World Model

def step(s, event, cost):

1

if cost > s.moves: return None

s.moves -= cost

2

if event == "rotate":

s.pattern = rot90(s.pattern)

3

elif event == "recolour":

s.colour = next_colour(s.colour)

4

elif event == "refill" and s.refill:

s.moves = s.capacity

s.refill = False

5

elif event == "enter":

s.open = (s.pattern, s.colour) == s.door

return s

Run The Model

Current State

3 Recolour

1 Move To Pad

4 Refill

5 Moves To Refill

First Rotation

2 Rotate 90°

2 Moves To Pad

Second Rotation

5 Enter

3 Moves To Door

Door Open

15 / 21 Moves

14 / 21 Moves

21 / 21 Moves

Budget Restored To Full

9 / 21 Moves

7 / 21 Moves

4 / 21 Moves

Goal Reached

Figure 1: From a rulebook to an executable world model. Numbered rules map to corresponding branches of a simplified transition function. A planner uses the model to predict a route that changes the badge’s pattern and colour, collects a refill, and reaches the matching door within the move budget.

†^{\dagger}Corresponding author: jun.wang@cs.ucl.ac.uk

1. Introduction

Recursive self-improvement aims to enable autonomous agents to acquire knowledge from experience and progressively improve their capabilities. An agent entering an unfamiliar environment must learn not only which actions are useful, but also what its actions do. It may initially know neither the environment's objects and dynamics nor the criterion for success. A model-based agent learns a world model to predict the consequences of actions before executing them [6, 14, 35, 38]. Programs are attractive representations for such models, encoding state transitions and goal conditions as executable functions that a planner can query repeatedly. They support fast, inspectable simulation, while discrepancies between predicted and observed transitions provide concrete counterexamples to the current model. Recent code world models demonstrate the promise of learning such programs from interaction [7, 8, 30, 39].

Agreement with observed transitions, however, does not guarantee correct generalisation. A finite interaction history typically leaves a version space of programs that reproduce every observed transition but disagree on unobserved states [24]. When planning queries such states, the selected program must make predictions that the available evidence does not determine. For example, if every observed wall lies at column 7, the hypotheses “a box stops at a wall” and “a box stops at column 7” may explain the same trajectory while predicting different outcomes when a wall appears elsewhere. Replay can reject an inconsistent program, but cannot identify the correct rule among consistent alternatives. The agent therefore needs to maintain and revise its generalisation hypotheses as new evidence arrives.

Our Memento series [42, 48, 49] provides a complementary perspective on this problem by treating external memory, rather than model parameters, as the agent's evolving learning state. Memento introduced continual adaptation through episodic memory, in which interaction outcomes are written into memory and retrieved to improve later decisions [48]. Memento 2 formalised this process as stateful reflective learning, interpreting memory writing as policy evaluation and memory reading as policy improvement [42]. Memento-Skills then extended the learning state from individual experiences to reusable procedural memory, allowing agents to construct and refine executable skills without updating the underlying LLM [49]. These works primarily improve the policy side of an agent by learning which decisions or procedures should be used. An unfamiliar interactive environment introduces the complementary problem of learning the model side: the rules that determine how the world behaves.

We introduce MEMENTO 3 as the model-based continuation of the Memento series. MEMENTO 3 extends reflective learning from policy and procedural memory to explicit world models. Its central design, which we call Code as Model, represents the agent's evolving understanding of the environment through a natural-language rulebook and an executable realisation. The interaction history provides episodic evidence, while a natural-language rulebook serves as semantic memory, recording the agent's current hypotheses about objects, actions, dynamics, and goals. The rulebook makes these hypotheses explicit so that later observations can be used to assess and revise them. Code is generated from the rulebook as its executable realisation for prediction and planning, as illustrated in Figure 1. The two representations serve complementary roles: the rulebook states the environment rules the agent believes, while execution fixes how those rules are applied. Together they form a persistent world-model hypothesis that can be inspected, tested, and revised throughout interaction.

This design lets us investigate a model-based route to recursive self-improvement (RSI). RSI describes an AI system autonomously designing and developing its own successor, with subsequent versions continuing this process [12]. Its recursive mechanism is a feedback loop in which the system uses its current capabilities to improve the components supporting its reasoning, planning, and learning [45]. In Code as Model, the persistent rulebook and its executable realisation are both objects of revision and tools for further learning. They guide subsequent planning and exploration, shaping the evidence the agent obtains for its next round of model revision. Their rules and predictions also provide a basis for diagnosing prediction errors. Through the reflective learning loop in Figure 2, the agent adopts verified updates to these components while the underlying LLM remains fixed.

Exact replay can leave several world-model hypotheses consistent with the same evidence. The LLM favours concise rulebooks and implementations, subject to rulebook fidelity and exact replay, as a practical minimum-description-length bias [28]. This preference does not eliminate uncertainty, and committing to one hypothesis may steer exploration away from evidence that would falsify it. We therefore extend the single-model setting to N world models maintained in parallel, each represented by a rulebook-executable pair and sharing the same interaction history. One member is sampled for each planning episode, and the resulting transitions are used to check all members. Different models can thus guide exploration while remaining consistent with shared evidence; N = 1 recovers the single-model setting.

We evaluate Code as Model on ARC-AGI-3 [1], where agents must infer unfamiliar game rules and goals under a human-derived action budget. The single-model agent clears every level of all 25 public games, reaches the Relative Human Action Efficiency ceiling with a mean RHAE of 100.0, and uses 44% of the corresponding human action count. Compared with Claude Opus 5 with the ARC Prize Standard harness [2], our agent achieves a 59.3-point higher mean RHAE. We also examine whether the learning mechanism can support feedback control in addition to discrete planning. In Atari Pong, the learned model supports a controller that wins 21:0 in three evaluated episodes with different openings, acting without further LLM calls.

References (45)