The Agent That Improves Itself by Rewriting Its Own Rulebook — A Close Reading of Memento 3

Memento 3 learns a world model by editing only the "rulebook + code" in its external memory, leaving the underlying LLM frozen. Here is how it cleared all 25 public ARC-AGI-3 games, and what it implies for ONTLE's AI PM.
← 목록으로
온
온틀 리서치
2026년 10월 10일 Updated 2026.10.16 44 min read views 2

Memento 3 is an agent that gets smarter on its own while leaving the weights of the underlying large language model (LLM) completely untouched — it edits only the "rulebook" written into an external memory. A rulebook is a plain-language manual describing how the environment works. The agent does nothing but continually revise this rulebook and the "executable code" it distills from it.

How it works is a simple loop. It observes the environment, reflects on where its predictions went wrong, and revises the rulebook (observe → reflect → revise). A revised rulebook is adopted only after it clears two gates. Using this method, the agent cleared every level of all 25 public ARC-AGI-3 games, and reached 100.0 — the ceiling of the average RHAE (a score for action efficiency relative to humans) — while using only 44% of the number of actions a human takes.

The problem this paper tackles

When someone picks up an unfamiliar game console for the first time, they learn two things at once: which buttons are useful, and what on earth those buttons actually do. If the former is a "policy" (what should I do), the latter is a "model" (how does the world respond). To weigh the consequences of an action before taking it, you need the latter. This mental map of how the world responds is what we call a world model.

Writing the world model down as a program (code) has many advantages. If you nail down how an action changes the state (the state transition) and the goal conditions as functions, then a planner — which rolls the future forward and picks the next move — can simulate it quickly, as many times as it likes. A person can also open up the code and inspect it. Above all, when a prediction and the actual observation diverge, that mismatch itself becomes a concrete counterexample saying, "your model is wrong right here."

The trap lies here. Just because code correctly predicts every scene seen so far, there is no guarantee it will correctly predict situations it has not yet seen. The paper's example is crisp. Suppose every wall observed so far has been in column 7. Then the rule "the box stops when it hits a wall" and the rule "the box stops in column 7" explain the past trajectory identically. Both are consistent with history. But the moment a wall appears somewhere else, the two rules make entirely different predictions. Several rules that "explain the same past but predict the future differently" always remain together, and this set of candidates is called the version space. A replay check — re-running a past action exactly as it happened — can prune rules that contradict the past, but it cannot pick out the "true rule" from among candidates that all fit the past. So what the agent needs is not a single lucky guess, but the ability to keep revising its hypotheses as each new piece of evidence arrives.

The Memento series has approached this problem from the perspective of treating "external memory" — rather than "model parameters" — as the learning state. The first Memento achieved continual adaptation through episodic memory, writing interaction results to memory and reading them back out; Memento 2 organized this as "writing to memory = policy evaluation, reading from memory = policy improvement." Memento-Skills broadened the learning state to reusable procedures (skills). All of these, however, improved the "policy side" — which decisions and procedures to use. What Memento 3 touches is the opposite side: the "model side," which defines how the world itself behaves.

The core idea

The central design is named Code as Model. It splits the role in two. The natural-language rulebook records "what you believe (the What)," while the executable code handles "how that belief is computed (the How)." The rulebook exposes the current hypotheses about objects, actions, and goals in words a human can read, and the code pins those hypotheses down as computation with no ambiguity whatsoever.

This intermediate layer — the natural-language rulebook — is what sets Memento 3 apart from other "code-as-world-model" research. The idea of learning a program from interaction has already appeared in several forms. But in most of them, the rules get dissolved into the code, so that "what the agent believes and why it wrote the code that way" is hidden inside a lump of code. Memento 3 pulls those hypotheses up above the code and makes them visible. As a result, the version-space trap described above can be read, revised, and refuted directly by a human.

Learning turns in a short loop. It executes actions to accumulate new observations (observe), diagnoses whether the cause of an error is a flaw in the rule itself or a case where the rule is right but the code implemented it wrong (reflect), and then, if needed, revises the rulebook (revise) before writing new code using that rulebook as a guide (compile).

A revised model is adopted only after clearing two gates. This verification is the heart of the paper.

  • Rulebook fidelity. An LLM judges, at the semantic level, whether the code properly implements what the rulebook says. It is the gate that guards against the What and the How drifting apart.
  • Exact replay. It checks whether, when the recorded actions so far are re-run exactly, the model predicts every single one of the scenes that actually followed, without exception. The outcome splits cleanly into pass or fail. That said, this strict form that demands "cell-for-cell identical" reproduction is a story for ARC-style environments, where the state falls neatly into grid cells. In environments where the screen moves continuously — like the Pong we'll see later — the role of replay changes.

There is one crucial line drawn. Adoption is not decided by the LLM's confidence or ranking. Because choosing by language-model ranking can actually filter out the correct candidate, an execution check is the basis for adoption wherever the outcome is observable. Moreover, a new candidate is checked every time against the "entire record," not just the "most recently failed scene." If it can no longer explain what it got right yesterday, it fails.

Several candidates may survive replay. In that case, the one whose rulebook and code are shorter and more concise is chosen (a minimum-description-length preference — the side that trusts the explanation with no excess fat). But this preference does not eliminate uncertainty. Jumping onto a single hypothesis too hastily can steer you away from the search that would find the very evidence to disprove it.

So the paper adds a "population" extension that runs several world models (rulebook-code pairs) sharing the same record at the same time. As if multiple hypotheses were competing in one market, each time a new observation arrives, models that cannot explain that evidence are culled, and the model that best explains reality survives. Each planning step picks one model to use, but the new observations it generates are used to test all the models together. Different models pull the search in different directions while all staying consistent with the shared evidence. Reduce the models to one, and you are back in the single-model setting.

The paper calls this whole picture "a model-based path toward recursive self-improvement (RSI)." The rulebook and code are both the object that gets revised and, at the same time, the tool that guides the next round of learning. The two guide the next planning and search, and the evidence gathered there becomes material for the next revision. Throughout, the underlying LLM stays fixed. What gets smarter on its own is not the LLM, but the world model the LLM builds up outside itself.

How the experiments were designed

The main stage is ARC-AGI-3. The agent must infer an unfamiliar game's rules and goals within an action budget drawn from human play. It is given no environment source, no transition rules, and no natural-language task description. It is only told whether it has achieved the goal. A noteworthy point in the evaluation design is "what counts against the budget." Only actions actually executed — whether exploratory or failed attempts — count against the budget; mental simulation, replay, and model construction are not charged as cost. There is also no separate scalar reward function that converts "how well did you do" into a single number. The set of goals and the per-action cost directly define the objective: "reach the goal within budget, and do it with as few actions as possible."

Two metrics come out. One is RHAE (Relative Human Action Efficiency), a value that converts action efficiency relative to humans into a score. Its ceiling is 100.0. The other is a ratio against the number of actions a human took, which directly shows "what percentage of actions you used to clear something a human clears in N moves." The two look similar but measure different things. So "RHAE 100.0" and "44% of actions" are not figures to be added together or read as a single achievement. For the comparison baseline, the paper used an agent built from a top-tier commercial LLM running on the standard harness (the standard execution framework for attaching an agent to an environment) that ARC Prize provides.

Beyond ARC, the paper includes an Atari Pong case study. The question here is different. If ARC examines "discrete planning," Pong examines whether the same learning mechanism can also support continuous feedback control — moving the paddle to track the ball. But Pong's verification differs from ARC's. Because the screen moves continuously, leaving error in rendering and paddle position, you cannot apply ARC's cell-for-cell, pass-or-fail reproduction criterion as is. So in the Pong of §5, replay is used as a diagnostic that pinpoints "where the model went off," and this is paired with evaluating whether the controller, once fixed, actually achieves the goal (scoring). The main text also includes two "break-it-apart" experiments: an ablation that tests whether the intermediate rulebook layer really earns its keep, and a population experiment that tests how much difference it makes to hold one hypothesis versus several. Looking at Table 3 in §4, the rulebook's value shows up not in "whether a task is cleared" but in "how efficiently it is cleared." Even with the rulebook removed, all three games keep RHAE at the ceiling of 100 — performance does not collapse. Instead, with the rulebook, the action count drops from 677 to 617 (about a 9% reduction) and agent turns drop from 830 to 678 (about an 18% reduction), achieving the same goal with fewer moves. In the population experiment (Table 4), having several competing hypotheses in the wa30 game cut the action count from 899 to 597. The paper also separately includes a design that manages this external learning state (rulebook, code, history) with git (Git memory).

Results and significance

The single-model agent cleared every level of all 25 public ARC-AGI-3 games. The average RHAE reached the ceiling of 100.0, and it used only 44% of the number of actions a human needs to clear the same games. This means not merely that it solved the tasks, but that it found shorter paths at higher efficiency than a human. Its average RHAE was higher than the comparison baseline (the agent built from a top-tier commercial LLM on the standard harness) — the exact difference is not confirmed in the published excerpt, so I will not state it as a figure.

The Pong case is a result of a different character. The feedback controller obtained through learning won 21:0 every time across three episodes with different starting conditions, and it called the LLM no more during execution. Once the world model solidifies into code, that code runs on its own, move after move, without expensive inference calls. The slow, expensive LLM is used only in the "build-and-fix-the-model" stage, and repeated execution is handled by cheap, deterministic code (code that always produces the same result for the same input).

What deserves attention is the path to those numbers more than their height. The product of learning remained not as black-box weights but as a natural-language rulebook and executable code that a human can read and audit. In effect, performance was not traded away for explainability. What the model newly learned remains not as an untraceable pile of numbers, but as a transparent asset where you can retrace when and why things changed. This moves the process of AI getting smarter from the realm of "black-box tuning" into the realm of "knowledge engineering that humans can read and audit."

Limitations and open questions

Start with the limitations the authors acknowledge themselves. Several hypotheses may survive exact replay, and the preference for conciseness does not fully erase that uncertainty. The paper also directly notes that jumping onto one hypothesis can steer you away from the search that would disprove it. The population extension is precisely the device meant to soften this risk.

A few more can be added here. The whole framework leans on "deterministic" environments (where the same action in the same state always yields the same result). But the verification method varies by environment — the strict pass-or-fail criterion of "cell-for-cell exact replay" is a condition that fits ARC games, where the state falls into grid cells, among all deterministic environments; in environments where the screen moves continuously, like the Pong of §5, error remains in rendering and paddle position, so it does not apply as is (there, replay is used as a diagnostic that pinpoints "where it went off," and judgment is paired with evaluating whether the controller actually achieves the goal). Nor can this environment observe every state clearly — what the paper assumes is a partially observable environment (a deterministic POMDP) that hides parts beyond the field of view, and §3.1 even explicitly cites a case where off-screen regions are hidden (ls20). As long as determinism holds, even under partial observation, the same action in the same state always leads to the same next scene, so exact replay holds in grid games like ARC. Conversely, if an environment harbors randomness, it is hard to use the pass-or-fail criterion "reproduce every transition identically" as is. Also, ARC-AGI-3's grid games and Pong are worlds where states and actions fall relatively cleanly into place. How neatly a rulebook stays clean when moved to messy real-world work with blurry boundaries is hard to settle from these results alone. The scope of "25 public games" is another condition to keep in mind when reading the results. The fact that, even though the execution stage calls no LLM, the verification and revision stages do call the LLM repeatedly is also a cost to weigh in large-scale deployment.

The ONTLE view

Memento 3's approach throws up an important implication for how ONTLE's AI PM solves real-world problems. ONTLE dispatches an AI PM (a photoreal persona) to each client project, receiving requests, analyzing them, and shipping them as services. What that PM bumps into every day is exactly this: figuring out "how this client's business rules actually work."

One piece already fixed — ONTLE's existing implementation

ONTLE has already run into and fixed one piece of this problem: the "say-do mismatch," where the PM persona said in words "handled it" while its actual behavior differed. ONTLE corrected this by binding things together with a shared action service and server-side deterministic execution. When the "words" the PM declared and the "actions" the system actually ran diverged, it was made so the result would not commit. This is a device in the same vein as Memento 3's rulebook-fidelity gate — the check for whether the code properly implements what the rulebook says.

The design to take from this research

Going one step further, you can picture validating and revising the "operations rulebook" the PM carries around against evidence, the way Memento 3 does. For example, an initial hypothesis of "restock immediately on return" meets the counterexample "reflected the next day, after inspection," the rulebook is revised, and it is adopted as the new rule only after passing exact-replay verification against the entire history of past return logs. Concluding "a return means immediate restock" from seeing only cases where stock went up the same day is the very same trap as memorizing "the box stops in column 7" from seeing that every wall happened to be in column 7. The point where a prediction missed — the single return whose restock was recorded a day late — is exactly the clue for revising the rulebook.

Extra verification needed for real-world application

But real-world work is not as clean as a game grid. Return rules get tangled up with exceptions like exchanges, partial returns, and promotional refunds, and the same input does not always produce the same result. This means "cell-for-cell perfect reproduction" is hard to take and use as is — recall that this is ARC's strict replay condition, and even Pong already relaxes replay into a diagnostic, which is all the more true in real-world work. So for this design to land in reality, a few things must be bolted on: reading the point where reproduction diverges not as a failure but as "an exception the rulebook does not yet know," and taking it as the coordinate for the next revision; carrying several competing rule candidates and keeping only the ones that survive as transaction logs accumulate (the population idea); and, for uncertain stretches, not forcing them through as "settled" but turning them back into questions for the person in charge. A settled rule, being natural language, can be opened and reviewed by the person in charge and the client together, and it also folds naturally into the way ONTLE shows workflow on the client screen like a git graph. Per-client understanding accumulates without retraining the underlying model, and that understanding remains not as a black box but as an auditable document.

A checklist for practitioners

These are questions to ask yourself with the project you're about to apply this to in front of you.

  • Have you brought assumptions outside? Instead of burying the agent's premises inside a prompt or weights, have you separated them into an explicit rulebook a human can read and revise? A hidden assumption cannot even be refuted.
  • Have you filtered self-revision through two gates? Have you placed semantic verification and execution replay as independent gates, and refused to pass anything on the LLM's confidence alone? But decide — based on the nature of the environment — whether to apply replay as "cell-for-cell perfect match" or to relax it, as in Pong, by accepting error and judging with diagnosis plus performance evaluation.
  • Are you running cheap simulations first? Run things in code enough before taking expensive real actions — but count the LLM cost of the learning stage, where the model is built and fixed, separately in the ledger.
  • Are you watching for observation bias? When data skews one way (walls always in column 7), you memorize the wrong rule. Deliberately seek disconfirming evidence, or keep several competing hypotheses alive.
  • Are you refusing to pass uncertain stretches through as "settled"? When something is ambiguous, don't push it through — turn it back into a question for a person.
  • Are you version-controlling the products of learning? Only by leaving the rulebook, code, and history in git can you retrace, and revert, when and why things changed.

Frequently asked questions

If the rulebook just keeps getting more complex, won't humans eventually be unable to understand it?

That's a perfectly reasonable worry. Memento 3 has two devices that push back against it. When several candidates survive replay, the conciseness preference — choosing the shorter, tighter rulebook and code — keeps cruft from piling up, and a rule that can no longer explain the past fails the replay check. Even so, the tendency for rules to grow as they embrace one real-world exception after another does not disappear on its own. The one safeguard that remains is that the rulebook stays in human-readable natural language. That means a person can periodically open the swollen rulebook and tidy it up.

Why bother compiling the rulebook into code again? Can't you just ask the LLM every move?

Asking the LLM every move is slow, expensive, and its answers wobble slightly even to the same question. Solidify the rulebook into code and you can simulate quickly and consistently, countless times, without an LLM call — and the point where prediction and observation diverge pinpoints "where you need to fix." The Pong controller repeating 21:0 three times without calling the LLM even once during execution shows the practical payoff of this design.

What kind of benchmark is ARC-AGI-3?

Within the scope of this paper's description, it is an interactive task where the agent must figure out, on its own, an unfamiliar game's rules and goals within an action budget drawn from human play, and solve it. Because it gives no environment source and no natural-language description and makes the agent crack the rules through interaction alone, it is a stage well suited to measuring the ability to build a world model on one's own.

References

  • Paper: Memento 3: Model-Based Recursive Self-Improvement through Reflective Rulebooks
  • Authors: Haoyu Zhao, Zhengxu Yu, Zhiyuan He, Meng Fang, Rasul Tutunov, Haitham Bou-Ammar, Weilin Luo, Jun Wang (University College London · Huawei Noah's Ark Lab, UK · University of Liverpool)
  • arXiv: https://arxiv.org/abs/2610.11794
  • HuggingFace: https://huggingface.co/papers/2610.11794