---
title: 'Dream-RSI: Framework Overview'
url: https://www.emergentmind.com/topics/dream-rsi
type: topic
---

# Dream-RSI: Framework Overview

Dream-RSI is a framework for recursive self-improvement through evolving replay environments. It improves an exploration controller rather than the underlying coding agent: completed discovery histories are converted into replay simulators, candidate exploration policies are evaluated offline on those historical trees, and the selected policy is redeployed online to generate further discoveries. The framework targets the allocation of search effort—branch selection, parallelism, continuation, and stopping—under long-horizon and expensive evaluation. Its formal name is “Dream-RSI: Recursive Self-Improvement through Evolving Worlds” [2609.14858].

## 1. Motivation and scope

AI-driven discovery systems commonly iterate between candidate generation and evaluation. A coding agent generates or modifies a program, the candidate is executed, and its result determines subsequent exploration. As discovery tasks become more difficult, the exploration strategy itself becomes consequential: it determines which workspaces are continued, when new branches are opened, how many workers are used, and when search terminates.

Dream-RSI addresses a tension between fixed and online-optimized exploration. Fixed policies are inexpensive and stable but cannot adapt their allocation of computation according to accumulated evidence. Online optimization is adaptive in principle, but evaluating a candidate exploration policy may require an expensive, long-horizon rollout involving many coding-agent calls and delayed feedback.

The framework therefore treats completed discovery histories as replay simulators, also called “worlds.” Instead of rerunning the coding agent and evaluator for every candidate policy, Dream-RSI replays previously observed discovery trees. Candidate policies can thereby be compared off-policy before one is deployed online. The central loop is:

$$
\text{online exploration}
\rightarrow
\text{record discovery history}
\rightarrow
\text{construct replay worlds}
\rightarrow
\text{dream over candidate policies}
\rightarrow
\text{redeploy the selected policy}.
$$

The method performs recursive improvement at the level of exploration orchestration. The coding agent, evaluator, model weights, and execution interface remain fixed in the experiments. Consequently, improvement in discovered artifacts results from better search allocation rather than direct self-modification of the coding model.

## 2. System architecture

Dream-RSI consists of a lightweight orchestration layer surrounding an unchanged discovery system. The orchestration layer makes exploration programmable but does not itself generate candidate solutions. It selects previously observed nodes, determines batch size and parallelism, decides whether to open or continue branches, and can terminate exploration.

The coding agent generates or modifies candidates from selected workspaces. The experiments use LLM-based coding agents such as Gemini-3.1 Pro and Gemini-3.7 Flash. The evaluator executes candidates, verifies correctness, and returns task-specific scores. Both components remain fixed during exploration-policy optimization.

Each online rollout produces a discovery tree containing workspaces or filesystem states, generated artifacts, observations and diagnostics, evaluation scores, parent–child relationships, exploration decisions, and computationally relevant information. If $\mathcal{T}_t$ is the tree produced at outer iteration $t$, the accumulated history is

$$
\mathcal{H}_t=\mathcal{H}_{t-1}\cup\{\mathcal{T}_t\}.
$$

Every completed tree becomes a replay world. The simulator pool at iteration $t$ is therefore

$$
\{\mathcal{T}_1,\ldots,\mathcal{T}_t\}.
$$

A separate policy-development agent examines replay trajectories and scores, then edits executable exploration-policy code. The resulting policy versions are denoted

$$
\pi_t^0,\pi_t^1,\ldots,\pi_t^{M-1},
$$

with $\pi_t^0$ equal to the policy currently deployed online.

## 3. Discovery trees and online exploration

Let $r$ denote the root of a discovery tree, representing the initial workspace. Every non-root node has one primary parent and stores the result of one generation–evaluation attempt, including its score $s_v$. The eligible continuation nodes are

$$
A(\mathcal{T})=\{r\}\cup\{v\in\mathcal{T}:v\text{ is a leaf}\}.
$$

The root remains eligible because selecting it opens another independent branch; a non-root leaf is eligible because it can be refined. If $W$ is the maximum number of parallel workers, the feasible action set is

$$
A(\mathcal{T};W)=\{C\subseteq A(\mathcal{T}):|C|\leq W\}.
$$

Thus, an exploration-policy action is a batch $C$ of nodes. It simultaneously specifies which workspaces are continued, how many attempts are issued, and the degree of parallelism. The empty batch, $C=\varnothing$, means that exploration stops.

At outer iteration $t$, the online tree begins as

$$
\mathcal{T}_t^0=\{r\}.
$$

For each online round, the deployed policy observes the currently available tree and selects a batch. Each selected node is assigned to a worker; the coding agent generates a candidate; the evaluator executes and scores it; and the resulting children are attached to the tree:

$$
\mathcal{T}_t^{k+1}
=
\mathcal{T}_t^k
\cup
\{\text{new children generated from }C_t^k\}.
$$

The rollout terminates when the policy selects the empty batch or when the maximum number of online rounds, $K_1$, is reached. The completed tree is then added to the history and becomes available for future replay.

Online transitions are stochastic because the coding agent may generate different candidates from the same workspace. This distinguishes online discovery from replay: online exploration can encounter novel candidates and states, whereas replay is restricted to recorded outcomes.

## 4. Replay simulation and dreaming

A historical tree is converted into a replay world by preserving its recorded structure and outcomes. Replay does not rerun the coding agent, evaluator, candidate execution, or underlying discovery process. Instead, it reveals previously recorded children when a policy requests them.

For policy $\pi_t^m$ and historical tree $\mathcal{T}_i$, replay begins with

$$
\mathcal{T}_i^{m,0}=\{r\}.
$$

The full tree $\mathcal{T}_i$ remains fixed, while $\mathcal{T}_i^{m,k}$ denotes the portion revealed to the policy. At each replay round, the policy selects

$$
C_i^{m,k}\in A(\mathcal{T}_i^{m,k};W).
$$

For a non-root node, replay reveals its unique recorded child if one exists. For the root, it reveals the earliest-created previously unrevealed child. If no continuation exists, no node is revealed. This rule preserves parent–child order while permitting policies to choose different branches, orders, batch sizes, and stopping points.

Replay terminates when the policy selects the empty batch, when $K_2$ replay rounds have elapsed, or when all recorded nodes have been revealed. If $k_i^{m,\star}$ is the number of completed replay rounds, the number of represented non-root attempts is

$$
N_i^m
=
\left|\mathcal{T}_i^{m,k_i^{m,\star}}\right|-1.
$$

The quantity $N_i^m$ measures how much historical discovery computation a replay trajectory would have consumed, even though no new candidate is executed.

“Dreaming” refers to running candidate exploration policies through these replay worlds. Every policy version is evaluated on every historical tree. The policy-development agent receives replay trajectories, scores, successful and unsuccessful branch decisions, and feedback from previous revisions. It then produces another executable policy, which is evaluated on the same fixed replay worlds.

This procedure differs from using history merely as textual context, a memory bank, semantic lessons, or static training data. Replay retains the decision structure of the discovery tree and allows alternative policies to interact with recorded branches under different allocation rules.

## 5. Replay objective and recursive policy selection

The replay score for policy $\pi_t^m$ on world $\mathcal{T}_i$ is

$$
V_i^m
=
\max_{v\in\mathcal{T}_i^{m,k_i^{m,\star}}}s_v
-
\beta_1N_i^m
+
\beta_2
\frac{N_i^m}{\max\{1,k_i^{m,\star}\}},
$$

where $s_v$ is the recorded quality score, $N_i^m$ is the number of revealed non-root nodes, $k_i^{m,\star}$ is the number of replay rounds, and $\beta_1,\beta_2\geq 0$ are fixed coefficients.

The objective contains three terms. The discovery-quality term favors trajectories reaching high-scoring historical solutions. The execution-cost term penalizes revealing many attempts. The parallelism term rewards policies that accomplish more attempts per decision round. The average policy score over the current history is

$$
V^m=\frac{1}{t}\sum_{i=1}^{t}V_i^m.
$$

The next deployed policy is selected as

$$
\pi_{t+1}=\pi_t^{m^\star},
\qquad
m^\star\in\operatorname*{arg\,max}_{m\in\{0,\ldots,M-1\}}V^m.
$$

Because the candidate set includes the current policy, $\pi_t^0=\pi_t$, selection guarantees

$$
V^{m^\star}\geq V^0
$$

on the fixed replay history. This is not a guarantee of improvement on future online trees, because replay cannot represent unobserved branches or future stochastic outcomes.

The complete recursive loop alternates between online exploration and offline policy revision:

1. The current policy conducts an online rollout.
2. The resulting discovery tree is added to the history.
3. Candidate policy versions are evaluated on all historical replay worlds.
4. The policy-development agent revises the exploration code.
5. The highest-scoring replay policy is redeployed.
6. The new online rollout expands the simulator pool.

The process improves the exploration controller, including exploration breadth, branch continuation, parallelism, stopping, and allocation of coding-agent calls. It does not update the coding agent’s model weights, evaluator, execution engine, or candidate-generation mechanism.

## 6. Experimental evaluation

Dream-RSI is evaluated in algorithm engineering, mathematical optimization, and GPU kernel engineering. The main comparison is between Recursive Fixed Exploration, which retains a fixed exploration policy, and Dream-RSI, which updates the policy through replay after each recursive round. Both methods use the same coding agent, evaluator, initial exploration policy, and per-round resource constraints.

For Gemini-3.1 Pro, the per-round budget is

$$
10\text{ workspaces}\times 11\text{ refinement steps}=110
$$

coding-agent calls. For Gemini-3.7 Flash, it is

$$
32\text{ workspaces}\times 20\text{ refinement steps}=640
$$

calls. Discovery cost is measured primarily by cumulative coding-agent calls or generations.

### Algorithm engineering

The Lasso task concerns efficient computation of the complete Lasso regularization path. Dream-RSI discovers implementations combining strong-rule screening, Cauchy–Schwarz-based KKT pruning, selective exact-gradient recomputation, full gradient refresh when pruning becomes ineffective, active-set bookkeeping, lazy Gram-matrix construction, and hardware-aware implementation.

For Gemini-3.1 Pro, Dream-RSI reduces average held-out runtime from $3587.1$ ms under Fixed Exploration to $2931.0$ ms while reducing calls from $550$ to $317. For Gemini-3.7 Flash, average runtime decreases from $2516.7$ ms to $2350.6$ ms while calls decrease from $3200$ to $1879. The reported generalization datasets are Gisette, RCV1, DNA, Leukemia, Colon, and Duke Breast.

### Mathematical optimization

The mathematical experiments cover Sum–Difference, circle packing, and autocorrelation inequalities. Dream-RSI achieves a Sum–Difference score of $1.145427$, exceeding the reported SimpleTES and Fixed Exploration results; it matches the strongest reported circle-packing result of $2.635983$; and it remains competitive on autocorrelation inequalities, where SimpleTES retains the strongest reported score.

Dream-RSI uses fewer than $1{,}000$ generations in the reported mathematical setting, compared with $51{,}200$ for SimpleTES. The evidence therefore supports a cost-efficient and competitive discovery process rather than uniform superiority on every objective.

### GPU kernel engineering

The GPU experiments use the KernelBench tasks VGG16, LayerNorm, ConvDiv, and ConvMax. Dream-RSI obtains comparable performance with $2.43\times$ fewer generations on VGG16 and $1.79\times$ fewer generations on LayerNorm. It achieves $2.09\times$ higher performance at comparable budget on ConvDiv and $1.44\times$ higher performance at comparable budget on ConvMax.

On ConvDiv, the reported number of evaluated attempts across recursive rounds is

$$
110,\;110,\;87,\;80,\;50,\;92,\;80,\;91,\;86,
$$

while round-best performance increases approximately as

$$
0.427,\;0.625,\;0.855,\;1.403,\;1.488,\;1.499,\;1.770,\;1.880,\;1.898.
$$

This pattern is interpreted as adaptive effort allocation: the policy conserves computation when progress is available, increases exploration after plateaus, and can obtain further improvements after renewed exploration.

## 7. Limitations and interpretation

Replay worlds are empirical representations of realized discovery histories. They cannot invent outcomes absent from the recorded tree, generate novel candidates, or reproduce all stochasticity of online execution. A policy may therefore overfit to the historical simulator pool. The non-degradation guarantee applies only to replay score on the fixed history and does not establish monotonic improvement in future online discovery.

The framework’s effectiveness may depend on the initial exploration policy, coding model, evaluator reliability, discovery-tree structure, replay coefficients, online and replay horizons, number of policy revisions, and worker count. The reported experiments do not provide a broad component-by-component ablation over all of these factors.

The principal cost metric is coding-agent calls or generations. Replay has no new discovery-execution cost, but it still incurs orchestration, storage, policy-execution, and policy-development computation. Consequently, “zero-execution-cost” replay does not mean zero total system cost.

Dream-RSI is best characterized as sample-efficient optimization of a search controller. Its central contribution is the conversion of discovery trees from passive records into executable replay environments in which alternative exploration policies can be evaluated before deployment. The method does not recursively improve the underlying coding model in the reported experiments; it recursively improves the allocation and organization of search.

Source: https://www.emergentmind.com/topics/dream-rsi