Hugging Face Papers ↗ · 2026-11-21
EvoViM: Recursively Self-Evolving Visual Agents for Exploration with Deferred Queries
Media reports Hugging Face Papers Source language: Chinese
EvoViM lets a frozen multimodal model evolve a visual program for memory and skills, beating the strongest baseline by 31.3–47.6 points across six tasks.
Full text
EvoViM: Recursively Self-Evolving Visual Agents for Exploration with Deferred Queries
Xinyu Cao ††thanks: Xinyu Cao conducted this research during an internship at Shanghai Jiao Tong University. Tianjie Ju Affiliation: Shanghai Jiao Tong University Hunan University National University of Singaporelewisxinyu@hnu.edu.cn jutianjie@nus.edu.sg zhangzs@sjtu.edu.cn Zhuosheng Zhang ††thanks: Corresponding author.
Abstract
Multimodal large language model (MLLM) agents have shown promising capabilities in task-oriented environments. However, they still struggle when queries are deferred until after exploration, requiring them to retain visual evidence before knowing which details will matter. We introduce EvoViM, a recursively self-evolving framework in which a frozen multimodal model turns its own interaction experience into one visual program for memory and skills. The program retains images and computes directly on pixels, and its operations decide how this evidence is used in each task. During memory evolution, the same model traces failures in its visual trajectories to the operations that lost or misused evidence and revises them. It also rewrites the notes and analysis tools that guide later revisions, which then build on earlier findings and skip changes that have already failed. We evaluate EvoViM with three multimodal models on six tasks covering visual matching, spatial recall, and sequential decision-making, including three tasks with deferred queries. Across the six tasks, EvoViM improves the average score over AutoMem, the strongest baseline in the main comparison, by 31.3–47.6 points on held-out episodes. Programs written once from the initial environment instructions perform substantially worse, highlighting the value of interaction experience in shaping how visual evidence is retained and used. Code and dataset are available at https://evovim.github.io/.

Figure 1: EvoViM evolves task-specific visual programs from one generic starting program. Each panel shows an evolved program on a held-out episode, with the evolved mechanisms named in its header. Red marks the evidence the program finds or the action it suggests.
1 Introduction
Multimodal large language model (MLLM) agents have made rapid progress in task-oriented environments, where they navigate websites [41], operate computers [30], and play video games [21, 14] from screenshots. In these environments, the instruction is given before interaction begins and guides what the agent looks for and remembers. However, some tasks require an agent to explore before it receives the question [11]. For example, an agent may walk through a gallery and later be asked where a re-photographed painting hung, although its instructions never mentioned the paintings (Figure 1(b)). We study exploration with deferred queries, in which the queries are revealed only after the agent has explored the environment.
Existing agents keep past observations in memories that are either designed by hand or evolved from experience. Hand-designed memories store text notes or frames [27, 18, 5], and their designers fix how the stored evidence is retrieved and used. Even when such memories store every frame, they adapt poorly to different tasks. Memory-evolution methods learn the rules from experience and adapt them to the task [28, 31], but the memory they evolve is text, which cannot record the visual details that separate near-identical images [4, 22]. These methods therefore break down when the decisive evidence is hard to put into words.
In this paper, we study exploration with deferred queries in multimodal settings and propose EvoViM, a recursively self-evolving framework that learns memory and skills from interaction as one visual program. We treat memory and skills as two uses of experience. The program holds the observations of the current episode, and its operations, shaped by earlier episodes, decide what to keep and how to use it. These operations process pixels directly to retrieve evidence from past observations or to suggest actions from the current state. In EvoViM, one frozen MLLM executes tasks with the current program and revises the program between generations. During revision, it reads the visual trajectories of development episodes, traces each failure to the operation that lost or misused the evidence, and rewrites that operation. It also rewrites the notes and analysis scripts that guide later revisions, so that it can build on earlier findings and avoid repeating failed changes.
We first construct three interactive visual tasks with deferred queries. The agent must retain visual details that are difficult to describe in words, then use them to answer questions revealed after exploration. Our comparisons show that evolved text memory loses these visual distinctions, while hand-designed visual memory often fails to turn retrieved evidence into correct answers. Programs written once from the initial environment instructions alone often prepare for the wrong questions.
We then evaluate EvoViM with three MLLMs on six tasks that test visual matching, spatial recall, and sequential decision-making, including the three tasks with deferred queries. EvoViM achieves the highest average score with every model and exceeds the strongest baseline by 31.3 to 47.6 points. These results show that MLLMs can evolve visual memory programs from interaction experience to preserve and use visual information that is difficult to describe in words, supporting exploration with deferred queries.
Our contributions are as follows.
•
We study exploration with deferred queries and build three multimodal environments on published benchmarks.
•
We propose EvoViM, in which a frozen MLLM evolves one visual program for memory and skills and revises the guidance for its own later revisions.
•
We show on six tasks with three models that evolution from a common starting program yields operations suited to each task, and we trace how failures during interaction shape each revision.

Figure 2: Overview of EvoViM. In task execution (blue), the agent records each outcome and consults the memory program (green) before acting. In memory evolution (orange), the same frozen MLLM revises the program from development episodes. A candidate is kept only if it passes code checks and the gate, and the model also rewrites the revision experience that guides its later revisions.
2 Related Work
2.1 Multimodal Agents
Multimodal agents use visual observations to act in games, websites, and desktop environments. Cradle uses screenshots with keyboard and mouse control to play games and operate desktop software [21]. SeeAct combines screenshots with HTML elements to ground actions on live websites [41], and OSWorld evaluates agents on real computer tasks, including workflows that span several applications [30]. Game benchmarks such as BALROG, VideoGameBench, and GameWorld show that long-horizon play remains difficult [16, 37, 14]. Some decisions require evidence from observations that have already left the screen [3]. OpenEQA directly evaluates the use of past observations through questions about previously explored physical environments [11]. These works do not address how agents can improve their visual memory from experience gained during interaction.
2.2 Agent Memory and Skills
To reuse past observations, many agents keep them as textual records or summaries [17, 15, 29], which can omit visual details needed for later tasks [4, 22]. Visual memories retain images for retrieving past experience [27] or recalling explored places [18, 33], while VISTA archives every frame [5]. Experience can also be reused through learned operations. Voyager accumulates executable action skills [25], and MemSkill evolves skills for building and updating textual memory [38]. AtlasVA connects visual memory to skill learning by evolving spatial maps from trajectory statistics and using them to guide reinforcement learning [26]. However, the rules for organizing and using visual evidence in these systems are still predefined.
2.3 Recursive Self-Improvement
Self-improving agents learn from their own experience either by updating model weights [35, 40, 9, 7, 23] or by revising the code around a frozen model, such as its prompts and tools [32, 24]. Recursive methods also improve the procedure that makes these revisions [42]. STOP improves the program that improves code [36], Gödel Agent rewrites its own logic [34], and the Darwin Gödel Machine keeps an archive of coding agents that modify their own code [39]. ALMA, AutoMem, and MemPro search over memory programs [31, 28, 8], but the memory and the feedback that guides its revision stay in text. MemEvo evolves memory mechanisms for streaming video, whose frames do not depend on the actions of the model [6]. AutoMMemo designs memory programs for multimodal experience, which are queried only once before a task begins [20]. However, these methods do not study how agents can learn to retain and use visual evidence in exploration with deferred queries.
3 Why Do Existing Memory Designs Fall Short with Deferred Queries?
Current MLLM agents can follow instructions to complete tasks in visual environments. With deferred queries, however, the agent explores with only basic environment instructions and receives the questions afterward. It must decide what to retain without knowing which visual details will matter or how those details will be used.
We build three tasks to examine how existing memory designs handle this setting. In MC Gallery and Poster Maze, the agent must recall where a re-photographed painting or poster hung, or report that it was never seen. In DMV-Hard, it must identify a previously visited product page from a transformed crop of a photo detail or a generated pattern. We compare evolved text memory with a hand-designed visual memory, then test whether the model can infer the required operations from the initial instructions alone. We find three key limitations that cause existing memory designs to fail in exploration with deferred queries.
Table 1: Scores of different memory designs on the three tasks with deferred queries.
Claude Haiku 5.5 Qwen3.8-27B
Method MC Maze DMV MC Maze DMV
Basic image tools 15.0 18.8 13.8 23.8 23.8 7.9
Evolved text memory [28] 23.8 16.3 42.1 25.0 17.5 37.9
VISTA [5] 20.0 16.3 22.1 25.0 21.3 20.4
+ matcher 18.8 16.3 80.8 47.5 15.0 81.7
One-shot program 13.8 20.0 28.8 13.8 25.0 14.2
Text descriptions lose visual distinctions.
Text memory evolved from experience [28] answers most DMV-Hard questions about photo details but almost none about generated patterns (Figure 4). Its descriptions of one pattern often fit several others, so the stored notes cannot distinguish the queried item. On MC Gallery and Poster Maze, its scores are no higher than those obtained by answering not seen to every question (Table 1).
A visual match does not ensure a correct answer.
To preserve these distinctions, we test a hand-designed visual memory based on VISTA [5] that keeps every frame for later inspection. This archive alone still scores below evolved text memory on DMV-Hard. Adding a matcher that runs at every step lets it answer most DMV-Hard questions, as the matched page identifies the product. In MC Gallery and Poster Maze, the matcher usually retrieves the right view for previously seen pictures, but the agent often fails to answer correctly. The program lacks operations that associate the match with a location and determine whether the queried picture was seen at all.
One-shot programs often prepare for the wrong questions.
We therefore test whether the model can infer the required operations from the initial environment instructions alone. One gallery program records the order of the doors passed, whereas the later questions ask where each painting hung. On MC Gallery and Poster Maze, these programs show no clear gain over the initial set of basic image tools. The questions encountered during interaction provide the experience needed to revise what the program keeps and how it uses that evidence.
4 Method
EvoViM turns the experience of an agent into a visual program for memory and skills (Figure 2). Within an episode, the program stores observations and maintains state. Its operations, which decide what to store and how to use it, are shaped by earlier episodes. One frozen MLLM executes tasks with the program and, between generations, revises these operations from development episodes. It also revises the guidance and analysis tools used to diagnose failures in later generations, so the evolution is recursive.
4.1 Memory and Skills in One Visual Program
The visual program defines memory operations and image-processing tools in Python, with prompts that guide the model in using them. The code and prompts remain fixed during an episode, while stored observations and state are updated through interaction. These memory contents are reset at the start of the next episode. In MC Gallery (Figure 2), for example, the evolved program instructs the model to save a view at each door during the walk. When a query painting appears, a matching tool compares it with the saved views and reports that the best match lies to the left of door 7. The model then submits this answer.
The starting program stores lossless frames with text metadata and has no pixel matcher. Evolution can change what frame memory retains and how it is organized, allowing the program to store whole views, object crops, or pixel features linked to locations. Pixel computation lets it process this stored evidence alongside the current image. These operations preserve the visual distinctions between similar images that text notes lose (Section 3).
To make stored evidence available at a decision, visual recall places selected frames, crops, or montages in the next model request. Revisions can change which text and images appear in each prompt, so the program determines what the model sees when it uses memory. The same code can read the current frame and the accumulated state to score candidate actions or suggest the next action. In Card Matching, for example, the program combines remembered card locations with pixel matching to suggest the next flip.
During task execution, the model uses these operations in a Record phase followed by an Act phase (Algorithm 1). It first examines the observed outcome of its previous action and decides what to record, then consults memory to choose the next action. Each phase starts a new conversation, while the episode memory remains available through the program. Within that conversation, every request includes the current image, and tool results enter the next request. The model then submits its chosen action through the fixed interface. The model and this execution procedure remain fixed during evolution.
Algorithm 1 Task execution with a visual memory program.
1: program PP, frozen model MM, task seed
2: episode steps TT, request cap K=20K=20
3: S←∅S\leftarrow\emptyset ⊳\triangleright episode memory
4: for t=0,…,T−1t=0,\dots,T-1 do
5: ot←o_{t}\leftarrow current observation
6: if t>0t>0 then
7: Phase(Record, oto_{t})
8: end if
9: at←Phase(Act,ot)a_{t}\leftarrow\textsc{Phase}(\textsc{Act},o_{t})
10: if ata_{t} is missing or illegal then
11: at←a_{t}\leftarrow fallback action
12: end if
13: the host executes ata_{t}
14: end for
15:
16: function Phase(ϕ,ot\phi,o_{t})
17: H←∅H\leftarrow\emptyset ⊳\triangleright phase conversation
18: for k=1,…,Kk=1,\dots,K do
19: y←M(P.Prompt(ϕ,S),ot,H)y\leftarrow M(P.\textsc{Prompt}(\phi,S),o_{t},H)
20: if yy is a memory command then
21: (S,r)←P.Execute(y,S,ot)(S,r)\leftarrow P.\textsc{Execute}(y,S,o_{t})
22: H←UpdateContext(H,y,r)H\leftarrow\textsc{UpdateContext}(H,y,r)
23: else if ϕ=Act\phi=\mathrm{Act} and yy commits aa then
24: return aa
25: else if yy ends the phase then
26: return ∅\varnothing
27: end if
28: end for
29: return ∅\varnothing
30: end function
4.2 Revising Programs from Interaction Feedback
The development episodes recorded during task execution provide the evidence for revising the program. We first run the starting program to obtain the episodes used by the first revision. At every generation, the model uses a command-line coding tool to inspect the parent program and its development episodes, including frames labeled by step, memory snapshots, and tool results. Records of earlier candidates show how previous changes affected task outcomes on the development episodes.
To help the program generalize to new episodes, each revision uses evidence from two development seeds. The model is asked to check each proposed change against both episodes and explain why it should work on unseen instances. The revision instructions prohibit embedding facts from development episodes in the code and require the program to obtain episode-specific information from observations during execution. Feedback reports results separately for each seed, so later revisions can identify changes that help one episode at the expense of another.
Enhanced feedback guides revision by connecting task outcomes to how the program handled visual evidence. Episode digests summarize the outcomes, while tool-use statistics show which memory operations the agent called. The revision instructions include fixed analysis questions that help the model identify where visual evidence was lost or misused. Based on this diagnosis, the model must propose a structural revision, such as a new storage schema or a tool that processes visual evidence. Before evaluation, it predicts how the candidate will change the score and tool use. Later feedback compares these predictions with the measured changes, so the model can check whether the revision had the intended effect.
The model preserves what it learns from these revisions in a playbook, notes, and analysis scripts. The notes record findings from earlier attempts and guide revisions to the playbook used for later diagnosis and editing. Analysis scripts automate checks on recorded episodes and tests of proposed changes, allowing later revisions to reuse or extend earlier tools. These files pass to every later revision, including after a candidate is rejected. The selection rule, evolution budget, and access to evidence remain fixed as this revision experience accumulates.
4.3 Evaluating and Retaining Candidates
Before running development episodes, the host checks the candidate by replaying recorded observations with a stub model that calls every registered tool. This tests the tool calls and checks that saved episode state can be restored without making model requests. A candidate that passes these checks then runs on the same two development seeds as its parent, with one episode per seed.
The gate accepts a candidate if its mean development score is higher. For a score tie, the candidate must succeed on every development seed and use fewer steps or tokens without increasing the other. If the candidate fails the code checks or the gate, the model revises the same parent once more using the rejected code and failure evidence.
After the final generation, the last accepted program is fixed and evaluated on held-out seeds disjoint from the development seeds. The agent starts each held-out episode with empty memory and accumulates observations and state using the evolved program.
Algorithm 2 summarizes the procedure, with candidate records RR and revision experience XX retained across attempts. The records include predicted changes π\pi, code-check outputs LL, and the measured outcomes. The model updates XX during revision, while the gate determines whether the candidate replaces the parent program.
Algorithm 2 Evolution of one program lineage.
1: initial program P0P_{0}, frozen model MM
2: development seeds 𝒟\mathcal{D}, held-out seeds ℋ\mathcal{H}
3: generations GG, initial revision experience X0X_{0}
4: P←P0P\leftarrow P_{0}, X←X0X\leftarrow X_{0}
5: E←Play(M,P,𝒟)E\leftarrow\textsc{Play}(M,P,\mathcal{D})
6: R←∅R\leftarrow\emptyset ⊳\triangleright candidate records
7: for g=1,…,Gg=1,\dots,G do
8: for k=1,2k=1,2 do ⊳\triangleright one candidate, then one retry
9: F←Feedback(E,R)F\leftarrow\textsc{Feedback}(E,R)
10: (C,π,X)←Revise(M,P,E,F,R,X)(C,\pi,X)\leftarrow\textsc{Revise}(M,P,E,F,R,X)
11: (𝑜𝑘,L)←Checks(C)(\mathit{ok},L)\leftarrow\textsc{Checks}(C)
12: EC←∅E_{C}\leftarrow\emptyset
13: if 𝑜𝑘\mathit{ok} then
14: EC←Play(M,C,𝒟)E_{C}\leftarrow\textsc{Play}(M,C,\mathcal{D})
15: 𝑜𝑘←Gate(EC,E)\mathit{ok}\leftarrow\textsc{Gate}(E_{C},E)
16: end if
17: R←R∪{(C,π,EC,𝑜𝑘,L)}R\leftarrow R\cup\{(C,\pi,E_{C},\mathit{ok},L)\}
18: if 𝑜𝑘\mathit{ok} then
19: P←CP\leftarrow C, E←ECE\leftarrow E_{C}
20: break
21: end if
22: end for
23: end for
24: return Score(Play(M,P,ℋ))\bigl(\textsc{Play}(M,P,\mathcal{H})\bigr)
5 Experiments
5.1 Experimental Setup
Table 2: Task settings and held-out evaluation budgets.
Task To recall Goal Steps Episodes
Card Matching 144 cards 72 pairs 360 5
DMV-Hard 100 product pages 24 answers 124 10
MC Gallery 16 paintings (12×1212{\times}12) 8 answers 60 10
Poster Maze 16 posters (6×66{\times}6) ≤8\leq 8 answers 140 10
Tetris – task progress 100 5
Pac-Man – task progress 100 5
Tasks.
We evaluate EvoViM on six tasks that test visual matching, spatial recall, and sequential decision-making (Table 2 and Figure 3). For visual matching, Card Matching uses noise-texture cards on a 12×1212{\times}12 board from RNG-Bench [3]. Unmatched cards turn face down again, so the agent must remember their appearance and location to find pairs. DMV-Hard adapts the product-browsing task of DMV-Bench [22]. We add generated patterns to the product photos, then ask the agent to identify products from earlier browsing sessions using transformed crops of photo details or patterns.
For spatial recall, we build MC Gallery in GameWorld [14] and Poster Maze in RNG-Bench. The agent explores the environment and is later shown a re-photographed picture and asked where it hung, with unseen pictures as lures. These two tasks and DMV-Hard reveal their queries only after exploration.
Tetris and Pac-Man test sequential decision-making in GameWorld. They show their full state and test whether evolved programs support decisions from the current observation. Pac-Man uses the same starting layout across episodes.

Figure 3: Example observations from the six evaluation tasks.
Metrics.
We report the fraction of pairs cleared for Card Matching and answer accuracy for DMV-Hard. MC Gallery asks about six seen paintings and two unseen lures. Poster Maze asks about at most six clearly observed posters and two lures, so the number of questions depends on exploration. Both tasks divide the number of correct answers by eight, and a lure counts as correct only when answered not seen. Always giving this answer scores 25%.
For Tetris and Pac-Man, we use GameWorld’s normalized task progress. Tetris awards points for both dropping pieces and clearing lines.
Scores are reported as percentages, with equal weight given to each task in the overall average. We compute 95% confidence intervals using 10,000 paired bootstrap resamples of the held-out seeds within each task.
Baselines.
We choose baselines by how they retain past observations and whether their memory operations evolve. The No memory baseline provides a reference without stored observations, while Rolling summary compresses past interactions into text in the style of ReSum [29]. Hand-crafted text provides a note-taking tool and is the starting program for AutoMem. Hand-crafted visual provides five tools for frame storage, annotation, metadata search, recall, and deletion. EvoViM starts from this program. These four baselines keep their memory mechanisms fixed. AutoMem [28] evolves a text memory program from interaction. To evaluate AutoMem in visual environments, we provide the current image at each execution request while retaining its original text memory design. For this comparison, we use the same MLLM to execute and revise its program. AutoMem accepts a candidate only when its mean development score improves.
Models and protocol.
We use GPT-6.1 Sol [12], Claude Haiku 5.5 [2], and the open-weight Qwen3.8-27B [19]. Claude Haiku 5.5 revises its programs in Claude Code [1], while GPT-6.1 Sol and Qwen3.8-27B use Codex [13]. Both evolving methods develop a separate program for each task and model over three generations on the same two development seeds. Each generation allows one candidate and at most one retry.
5.2 Main Results
Overall performance.
EvoViM exceeds AutoMem, the strongest baseline in the main comparison, by 31.3 to 47.6 points in average score (Table 3). The paired bootstrap confidence intervals for this improvement exclude zero with all three models. When scores are averaged within each ability group, EvoViM also ranks first, except for sequential decision-making with GPT-6.1 Sol.
Table 3: Mean scores (%) with per-task standard deviations across seeds. Bold and underline mark the best and second-best means within each model.
Visual matching Spatial recall Sequential decision-making
Method Card Matching DMV-Hard MC Gallery Poster Maze Tetris Pac-Man Avg.
GPT-6.1 Sol
No memory 0.3±\pm0.6 0.0±\pm0.0 25.0±\pm0.0 25.0±\pm0.0 34.7±\pm9.1 45.3±\pm21.5 21.7
Rolling summary 8.6±\pm4.5 1.7±\pm2.2 11.3±\pm12.4 17.5±\pm14.7 51.1±\pm19.6 42.6±\pm14.6 22.1
Hand-crafted text 0.8±\pm0.8 11.3±\pm6.8 25.0±\pm0.0 17.5±\pm8.7 36.9±\pm4.6 44.5±\pm20.3 22.7
Hand-crafted visual 2.8±\pm1.0 9.2±\pm5.5 25.0±\pm0.0 17.5±\pm8.7 38.9±\pm4.1 42.0±\pm7.3 22.6
AutoMem [28] 13.6±\pm4.3 41.3±\pm10.5 23.8±\pm4.0 75.0±\pm19.5 40.4±\pm7.6 31.6±\pm4.0 37.6
EvoViM 100.0±\pm0.0 97.5±\pm4.5 65.0±\pm12.9 66.3±\pm30.1 45.8±\pm7.5 38.6±\pm5.9 68.9
Claude Haiku 5.5
No memory 0.3±\pm0.6 0.0±\pm0.0 22.5±\pm5.3 22.5±\pm5.3 37.6±\pm4.1 31.8±\pm5.9 19.1
Rolling summary 7.8±\pm1.6 0.4±\pm1.3 23.8±\pm4.0 18.8±\pm10.6 41.5±\pm4.1 32.9±\pm5.6 20.9
Hand-crafted text 7.5±\pm1.2 22.1±\pm10.6 23.8±\pm4.0 8.8±\pm10.3 32.9±\pm7.3 46.3±\pm11.8 23.6
Hand-crafted visual 4.4±\pm2.7 13.8±\pm8.1 15.0±\pm9.9 18.8±\pm6.6 36.3±\pm6.4 40.1±\pm6.5 21.4
AutoMem [28] 63.6±\pm12.0 42.1±\pm14.5 23.8±\pm4.0 16.3±\pm11.9 31.9±\pm3.3 42.4±\pm8.6 36.7
EvoViM 100.0±\pm0.0 77.1±\pm11.5 98.8±\pm4.0 50.0±\pm25.7 75.0±\pm23.5 61.1±\pm22.8 77.0
Qwen3.8-27B
No memory 0.3±\pm0.6 0.0±\pm0.0 25.0±\pm0.0 25.0±\pm0.0 35.3±\pm7.8 27.0±\pm3.7 18.8
Rolling summary 0.8±\pm0.8 2.1±\pm2.2 25.0±\pm0.0 22.5±\pm5.3 46.1±\pm11.6 32.7±\pm14.1 21.5
Hand-crafted text 0.8±\pm1.2 16.3±\pm9.5 25.0±\pm0.0 22.5±\pm7.9 36.6±\pm3.3 27.4±\pm7.8 21.4
Hand-crafted visual 1.1±\pm1.2 7.9±\pm6.9 23.8±\pm4.0 23.8±\pm4.0 38.3±\pm6.7 39.1±\pm14.7 22.3
AutoMem [28] 13.3±\pm4.7 37.9±\pm6.9 25.0±\pm0.0 17.5±\pm12.1 42.0±\pm2.5 42.1±\pm18.0 29.6
EvoViM 100.0±\pm0.0 45.4±\pm14.6 96.3±\pm8.4 70.0±\pm22.2 99.1±\pm1.9 52.4±\pm19.8 77.2
Visual matching.
On DMV-Hard, EvoViM answers questions about photo details and generated patterns with similar accuracy, while AutoMem succeeds mainly on photo details (Figure 4). A matched page directly identifies the product through its URL, so VISTA-style memory answers most questions when a matcher automatically searches its stored frames at every step.
Figure 4: Accuracy on photo details and generated patterns in DMV-Hard.
Every EvoViM agent clears Card Matching, where evolved text memory leaves many pairs unmatched. With Qwen3.8-27B, the flip count on every held-out board matches that of RNG-Bench’s greedy policy with perfect memory and row-by-row exploration.
Spatial recall.
With Claude Haiku 5.5 and Qwen3.8-27B, EvoViM outperforms VISTA-style visual memory on MC Gallery and Poster Maze even when it is given a generic matcher. The evolved programs link stored views to locations and use these associations to answer queries. On Poster Maze, the fixed visual memories almost never locate a previously seen poster correctly, whereas EvoViM identifies the correct wall for most of them. Text memory remains competitive when descriptions are distinctive and stable across observations, as on Poster Maze with GPT-6.1 Sol. Across the three tasks with deferred queries, EvoViM achieves higher average scores than the fixed visual memories with both models.
Sequential decision-making.
With Claude Haiku 5.5 and Qwen3.8-27B, EvoViM scores best on both Tetris and Pac-Man. The evolved programs support decisions from the current frame with computed action suggestions (Figure 1(c) and (f)). On Tetris, their placements keep the stack low and earn more points from longer drops. In Pac-Man, Claude Haiku 5.5 eats on more steps than its baselines, while Qwen3.8-27B spends far fewer steps standing still. GPT-6.1 Sol does not lead either task, and Section 5.4 examines why its programs provide less support for action selection.
Development and held-out performance.
Across the 36 final programs of EvoViM and AutoMem, development and held-out scores have a Pearson correlation of 0.89. Development scores are higher on average, with the largest gaps on Poster Maze and the sequential decision-making tasks. Among programs that reach perfect development scores, those on Card Matching, MC Gallery, DMV-Hard, and Tetris retain scores of 96–100% on held-out episodes. The three such programs on Poster Maze fall to 66–75%, where different exploration paths can limit the evidence available for recall.
Execution cost.
With Claude Haiku 5.5 and Qwen3.8-27B, the evolved programs achieve higher average scores while using fewer input tokens during execution than the starting program (Figure 5). For this comparison, we normalize token use by No memory on the same model and task, then take the geometric mean across the six tasks. Compared with AutoMem, EvoViM has similar normalized token use with Claude Haiku 5.5 and roughly half as much with Qwen3.8-27B. With GPT-6.1 Sol, evolution improves the average score while increasing token use relative to the starting program.
Figure 5: Average score and relative input-token use across the six tasks. Arrows connect each starting program to its evolved version.
The evolved tools perform visual comparisons and action calculations in code, reducing repeated inspection by the model. Figure 6 shows the execution of Qwen3.8-27B on one held-out seed for Card Matching and Tetris. In the Card Matching episode, EvoViM clears the board before the flip budget is exhausted and uses about a tenth of the input tokens of its starting program. Over the same Tetris action budget, it needs roughly a quarter as many model requests.
Figure 6: Cumulative input tokens on Card Matching (left) and model requests on Tetris (right), using Qwen3.8-27B on seed 47.
On DMV-Hard, the every-step matcher searches all stored frames over several scales and rotations, which makes this search costly. Table 4 reports input tokens and time spent in program code, excluding time waiting for the model. The evolved programs spend much less time in code than this automatic variant, though they use more model tokens on this task.
Table 4: Execution cost on DMV-Hard, averaged over ten episodes. Code time includes matching and excludes waiting for the model.
Claude Haiku 5.5 Qwen3.8-27B
Method Input (M) Code (s) Input (M) Code (s)
VISTA-style archive 1.53 8 1.09 5
+ matcher (tool) 1.65 1,527 1.28 3,585
+ matcher (every step) 1.49 6,118 1.05 5,536
EvoViM 4.55 14 2.24 364
Revision cost.
Table 5 reports the model tokens used during program revision and the number of candidates evaluated, summed over six tasks for each model. With every model, EvoViM evaluates fewer candidates and accepts more of them. The recorded input-token totals are similar for the two methods when pooled across models. For Claude Haiku 5.5 and Qwen3.8-27B, token totals cover only sessions with reported usage, since interrupted sessions do not provide complete counts.
Table 5: Candidate evaluations and recorded token use during revision, summed over six tasks for each model. Token counts are in millions.
Method Evaluated Accepted Input Output
GPT-6.1 Sol
AutoMem 30 8 85.0 1.10
EvoViM 26 12 138.6 1.34
Claude Haiku 5.5
AutoMem 32 7 508.7 9.36
EvoViM 21 17 375.6 7.50
Qwen3.8-27B
AutoMem 30 8 382.0 7.66
EvoViM 22 17 445.1 10.34
5.3 Analysis of Evolved Programs
We compare each final program with its starting program to identify and count the mechanisms added by evolution. We then examine the development feedback and the model’s analysis at every generation to trace how these mechanisms emerged.
We group the added mechanisms by function, and each program can contribute several mechanisms to a group (Figure 7). Image memory covers storing, matching, and recalling visual evidence. The frame-parsing group includes state extraction from visual or textual observations, spatial indexing, and decision support. Text notes cover records written by the model, while workflow covers changes to prompts or execution flow.
Figure 7: Mechanisms added by evolution across the final programs of six tasks and three models.
Visual representations and matching.
Every final EvoViM program reads pixels, with image memory and frame parsing the most frequently added mechanisms. AutoMem most often adds text notes. The visual comparisons vary across tasks. In Card Matching, an exact hash or a pixel difference suffices to identify matching cards, since the two cards of a pair look identical. Table 6 compares the card representations and tool interfaces developed by the three models.
The AutoMem programs represent these same cards in text. GPT-6.1 Sol stores free-text identities, and Qwen3.8-27B stores short color labels. The Claude Haiku 5.5 program requests a 4×44{\times}4 grid of color words for each card and ranks possible partners by agreement between cells (Figure 8). This grid retains the spatial arrangement of colors, which the shorter descriptions often omit. Descriptions of matching card faces agree more often than those of different faces, though matching pairs still agree in fewer than half of the cells on average.
Table 6: Card representations and tool interfaces in the final programs.
Model AutoMem EvoViM
GPT-6.1 Sol Free-text card identities ranked by word overlap. Exact crop hashes. A query tool returns remembered matches when called.
Claude Haiku 5.5 4×44{\times}4 grids of color words ranked by agreement between cells. Crop distances. The program supplies matching-card suggestions and a list of unseen cards.
Qwen3.8-27B Short color labels compared for equality. Crop distances. The program suggests the next flip at every step.

Figure 8: Color-grid notes produced by AutoMem with Claude Haiku 5.5. Boxed cells mark disagreements between the notes. The true pair in (a) agrees in 11 of 16 cells, while the different cards in (b) agree in 10. In both cases, the program ranks the card on the right first.
For DMV-Hard and Poster Maze, matching must account for changes in view or lighting. The DMV-Hard program of GPT-6.1 Sol searches over rotation and scale when comparing a query crop with stored product images. Its code includes a local-feature matcher resembling SIFT with geometric verification [10], although dense correlation supplies most correct matches during execution. In Poster Maze, Qwen3.8-27B represents each poster as a map of color clusters and compares these maps under the best relabeling and rotation. Relabeling aligns corresponding regions when the clustering assigns them different color labels.
Evidence organization.
Across the three tasks with deferred queries, the programs index visual evidence by the door, wall, or product requested by later queries. For each query, the Poster Maze program of GPT-6.1 Sol creates a workspace that keeps the candidate ranking across both execution phases (Figure 9). It shows the query beside the leading stored posters and records the model’s verdict for each candidate. This workspace addresses a failure in an earlier program, where repeated retrieval exhausted the request budget and left lure questions unanswered. The revised program computes the ranking once and reminds the model to answer on its last request.

Figure 9: Queries and retrieved candidates from the workspace evolved by GPT-6.1 Sol for Poster Maze, shown during a development episode. Candidates are arranged by rank. The model rejects the lure in (a) and uses the top candidate to locate the seen poster on the east wall of cell (2,4) in (b).
Decision support.
The Card Matching traces show how remembered matches enter the next decision. GPT-6.1 Sol follows almost every match returned by its query tool, but often skips the query. Of its 49 missed opportunities to complete a known pair, 48 occur on steps without a query. Claude Haiku 5.5 follows every explicit matching-card suggestion and chooses almost all remaining flips from the printed list of unseen cards. The Qwen3.8-27B program suggests the next flip at every step, and the model follows every suggestion throughout its held-out episodes.
The Tetris programs show similar differences in decision support (Figure 10). The GPT-6.1 Sol program mainly maintains a ledger of the model’s own observations and plans. Claude Haiku 5.5 receives a board parsed from pixels and a ranking of legal placements. The Qwen3.8-27B program turns its board estimate into a suggested placement and the next key to press, which the model follows whenever a suggestion is printed. In Pac-Man, Claude Haiku 5.5 receives computed distances to pellets and ghosts, while the Qwen3.8-27B program recommends a direction that the model follows on almost every step.

Figure 10: State records and action suggestions produced by the evolved Tetris programs at step 30 of held-out episodes. The excerpts show the information passed to each model.
Memory can guide the collection of new evidence during exploration. In Poster Maze, the programs of Claude Haiku 5.5 and Qwen3.8-27B track explored walls and suggest moves toward unexplored areas. With Qwen3.8-27B, the model follows these suggestions on most navigation steps and sees 4.3 posters clearly per episode, compared with 1.5 for the starting visual program. The environment can then ask more recall questions about posters encountered during exploration.
Revisions from interaction.
Across the lineages with deferred queries, the first revision almost always changes what is stored. The MC Gallery lineage of Claude Haiku 5.5 shows how development failures lead to these changes (Table 7). Its starting program keeps notes that never tie a painting to its door. The first revision adds a pixel matcher and stores painting crops labeled by door and side. When the model examines the remaining errors, it finds that these crops omit some paintings or capture them only in part. The next revision therefore stores whole views at each door and determines the side of the painting from its position in the matched view. This program answers nearly every held-out question.
Table 7: The Claude Haiku 5.5 lineage on MC Gallery. Scores are measured on the development episodes after each generation.
Gen. Score (%) Program after selection
0 25.0 The starting program answers not seen to every question.
1 81.3 Painting crops indexed by door and side, with a pixel matcher.
2 100.0 Whole views indexed by door, with the side inferred from the match position.
3 100.0 Both candidates are rejected, leaving the generation-2 program unchanged.
Most of the development gain arrives in the first generation (Figure 11). By the second, 13 of the 18 EvoViM lineages have reached at least 90% of their final gain over the starting program. Every EvoViM lineage improves at least once, while five AutoMem lineages never accept a candidate.
Figure 11: Development scores after each generation, with one row per model. Generation 0 is the starting program.
Reusing revision experience.
Earli
Images from the source

