Recursive Self-Improvement: An Evolution Paradigm Driven by Small Models

    This article explains why strong coding ability does not equal strong decision-making in recursive self-improvement (RSI) systems, and presents a three-layer architecture that separates strategy generation from execution. It covers a shared search state, UCB-based strategy selection, conditional strategy memory, a proposer-implementer research workflow, reusable workspace assets, and deterministic evaluation criteria, along with practical deployment advice and common pitfalls. Readers will learn how uncertainty-aware exploration, memory with applicability conditions, and trustworthy evaluation allow smaller models to drive continuous progress.

    1. The Starting Problem: Why “Being Able to Write Code” Is Not “Being Able to Make Decisions”

    In the practice of Recursive Self-Improvement (RSI), one pattern appears repeatedly: large models with strong coding ability often show a clear “local patching bias” in long-chain optimization tasks. When a program errors out, they add a line of exception handling; when a test fails, they add another branch; when a metric does not improve noticeably, they switch to a different parameter style. The whole process looks diligent, but it misses one critical action—pausing to ask whether the originally chosen technical approach is flawed in the first place.

    The essence of this behavior is compressing the “search space” into the “neighborhood of the current solution.” What the model sees in its context is the failure stack, the failing cases, and the metric to be optimized, so it naturally translates these signals into “patch requirements” rather than “route hypotheses.” When the ceiling of Method A is lower than what the task demands, continuing to make incremental changes on A causes marginal returns to decay quickly, eventually consuming the entire experiment budget without any structural breakthrough.

    A counterintuitive but reproducible observation is that smaller models are sometimes more likely to break out of the existing framework. The reason is not mysterious. Smaller models have weaker prior constraints and lower stickiness to the implicit assumption that “the current code is the correct baseline,” so they are more willing to propose algorithmic paths completely different from the existing implementation. Their proposals may not be correct on the first try, but they widen the search space; the advantage of large models, meanwhile, is exactly in landing ideas with high quality.

    From this, a general engineering principle can be abstracted: strategy generation and strategy execution should be decoupled. Let models good at divergence be responsible for “proposing hypotheses,” let models good at convergence be responsible for “implementation and verification,” and let an external mechanism handle memory, evaluation, and budget allocation. This is precisely the design starting point of the framework below.

    2. Overall Architecture: Three Independently Evolving Components

    A usable RSI system can usually be split into three layers that communicate through explicit data contracts, avoiding stuffing all logic into a single prompt.

    • Strategy core (decision layer): maintains the global search state and decides “what to do next.”
    • Workspace (asset layer): accumulates reusable skills, experience, and intermediate artifacts, avoiding starting from scratch every time.
    • Evaluation arena (measurement layer): answers “did this round actually make progress” with unified, repeatable evaluation.

    The relationship among the three can be roughly expressed as:

    1. Each iteration:
    2. state = core.select(workspace, arena.history)
    3. patch = worker.implement(state.action)
    4. result = arena.evaluate(patch) # unified metrics + cost + latency
    5. workspace.commit(result) # skills/experience stored
    6. core.update(state, result) # update search state and strategy

    There are three key design constraints: evaluation must be deterministic, state must be serializable, and experience must carry applicability conditions. Missing any one of them degrades iteration into random trial and error.

    3. Decision Layer: Teaching the Agent to “Choose a Direction” Rather Than “Patch Code”

    3.1 Shared Search State: A Continuously Updated Experiment Record

    The core of the decision layer is a globally visible search state that contains at least five kinds of information: historical versions and their code snapshots, the evolution relationships between versions (who was derived from whom), the results and failure reasons of each experiment, a queue of unexplored directions, and the remaining experiment budget (rounds, compute, time).

    With this record, the decision process becomes three explainable judgments:

    1. Select a baseline: pick a candidate “worth continued investment” from historical versions, rather than always building on the latest version.
    2. Decide the action type: determine whether this round explores a new route or improves an existing implementation.
    3. Select a concrete action: pick the currently most feasible and most promising option from the candidate action set.

    The value of this design lies in traceability. Any change can answer “why change here,” “who its parent version is,” and “what the returns of similar changes were before,” which is extremely important for engineering retrospectives and failure attribution.

    3.2 UCB-Based Strategy Learning: Balancing Exploitation and Exploration

    Two extremes are most likely when selecting a baseline: always circling around the historical best version (premature convergence), or constantly jumping to brand-new directions (never converging). An upper-confidence-bound (UCB) type method is suitable here; a common industry variant is KL-UCB, whose idea is to consider both a direction’s historical average return and its current uncertainty, giving higher priority to options with high returns and few attempts.

    A conceptual scoring form can be written as:

    1. def score(option, total_rounds, c=1.4):
    2. # mean: historical average return of this direction; n: number of attempts
    3. bonus = (2.0 * math.log(total_rounds) / option.n) ** 0.5
    4. return option.mean + c * bonus

    Three engineering points need attention: first, returns should be normalized to avoid score distortion caused by differences in metric magnitudes; second, failures must also be counted as samples, otherwise the uncertainty estimate is overly optimistic; third, when the budget is limited, exploration terms should decay with rounds, gradually handing resources to directions already proven effective.

    3.3 Memory-Based Strategy Learning: Experience Must Carry Conditions

    The success or failure of a single experiment carries limited information; what is truly valuable is transferable experience. Effective practices can be distilled into strategy memory entries, each containing at least: applicability condition, specific guidance, expected return, supporting evidence (experiment IDs), and failure boundaries.

    1. {
    2. "condition": "The task bottleneck is data coverage rather than model capacity",
    3. "action": "Prioritize expanding hard-case sampling rather than deepening the network",
    4. "evidence": ["exp-017", "exp-023"],
    5. "confidence": 0.78,
    6. "invalid_when": "Annotation noise rate exceeds 15%"
    7. }

    Memory needs a lifecycle: confidence is reinforced when new evidence appears, lowered when counterexamples appear, and entries are retired when they are long ineffective or their applicability conditions disappear. A memory store without an eviction mechanism expands rapidly and repeatedly cites outdated conclusions as truth.

    3.4 Research Workflow: When “Patching” Itself Fails

    If the current technical route has a structural ceiling that cannot be broken by changing code alone, an explicit track-switching mechanism is needed. A dual-role process separating the proposer and the implementer can be adopted: the proposer analyzes the task definition, the existing execution framework, and historical experiments, locates capability gaps, and proposes new ideas; the implementer is responsible for coding, debugging, getting tests to pass, and returning results. The two roles use different models and different prompting strategies, effectively avoiding the confirmation bias of “being reluctant to abandon one’s own idea.”

    4. Asset Layer: Turning Successful Experience into Reusable Skills

    What the workspace solves is not “storing code” but “storing capability.” It is recommended to organize assets into four categories:

    • Skill entries: callable functional units with input/output contracts, plus usage examples and known limitations.
    • Experience entries: the strategy memory mentioned above, describing when and why to use it.
    • Intermediate artifacts: dataset slices, evaluation scripts, baseline metric snapshots, ensuring experiment reproducibility.
    • Failure archives: explicit counterexamples and pitfall records, often more valuable than success cases.

    Validation is required before reuse, as illustrated below:

    1. def reuse(skill, ctx):
    2. if not skill.contract_compatible(ctx):
    3. return None
    4. if ctx.noise_rate > skill.invalid_threshold:
    5. return None
    6. return skill.apply(ctx) # fall back to regeneration if incompatible

    5. Measurement Layer: No Trustworthy Evaluation, No Evolution

    The “evolution” of RSI must be confirmed by external measurement; otherwise the model generates code that looks more complex but has no actual improvement. The evaluation arena should: fix the evaluation set and random seeds, isolate the runtime environment, record metrics and resource consumption, and support repeated runs of the same patch to identify chance effects. Judging progress is recommended to use a composite criterion—for example, the primary metric improvement must exceed the noise threshold while latency and cost do not deteriorate significantly.

    A concise acceptance condition:

    1. def accept(new, base, eps=0.01):
    2. return (new.metric > base.metric + eps
    3. and new.cost <= base.cost * 1.1
    4. and new.latency <= base.latency * 1.1)

    6. Implementation Advice and Common Pitfalls

    • Fix evaluation first, then talk about automation. When evaluation is untrustworthy, automation only accelerates the accumulation of wrong conclusions.
    • Make the budget explicit. Write rounds, compute, and time into the state so the strategy layer learns the trade-off of “spend until exhausted.”
    • Control context length. Expose only summaries and key metrics to the decision model, and retrieve details on demand.
    • Keep a human gate. Actions involving data, permissions, and production releases should require human confirmation.
    • Watch out for memory pollution. A chance success written into memory may be amplified repeatedly, so always require a minimum number of evidence items.

    On a general cloud environment, deploying this framework does not require special capabilities: a container platform hosts isolated evaluation, object storage holds versions and artifacts, a message queue decouples the proposer and the implementer, and logging and monitoring services track metrics for each round, together forming a sustainable evolution loop.

    In summary, the bottleneck of RSI is usually not “whether the model can write code” but “whether the system can make decisions.” Decoupling strategy from execution, and jointly constraining the iteration direction with uncertainty-aware exploration, conditional memory, and trustworthy evaluation, even small models can become the key role driving continuous overall progress.