Small Models Directing Large Models: Designing a Recursive Self-Improvement Framework

    When large language models handle the full "find—fix—verify" loop on their own, they often fall into a local patching trap and rarely question whether the original approach was wrong. This article explores a recursive self-improvement (RSI) framework in which a small model acts as the strategist and a large model as the executor. It breaks down the three core modules—a policy-learning decision core, a skill-and-experience workspace, and an independent evaluation arena—and shares practical lessons on separating decision-making from execution, structuring conditional memory, balancing exploration and exploitation with UCB-style algorithms, and verifying real progress through isolated evaluation.

    Small Models Directing Large Models: Designing a Recursive Self-Improvement Framework

    1. Why “Improving Yourself” Easily Fails

    While exploring recursive self-improvement (RSI), researchers have observed a counterintuitive phenomenon: when a large model is responsible for the entire “identify the problem—fix the problem—verify the result” loop, it easily falls into a fixed mindset. If the code has a bug, it keeps patching the bug; if the patch still fails, it patches again in a different way—rarely stopping to reflect on whether the technical approach chosen at the very beginning was wrong.

    This “local patching trap” is especially common in automated coding tasks. The model tends to make incremental adjustments to the existing solution. Even after repeated failed fixes, it will not proactively overturn its premises and switch to a different algorithmic framework. An interesting practical finding is that much smaller models—for example, open-source models at the billion-parameter scale—can sometimes break out of the existing line of thinking, propose an entirely different algorithmic direction, and then hand it off to the large model for implementation.

    The possible reasons behind this are worth pondering: small models lack “path dependence” on any specific solution and are less constrained by implementation details when making decisions at an abstract strategy level. Large models, although strong at coding, mix “figuring out what to do” with “writing how to do it” in a single context, and the two easily interfere with each other.

    This gives rise to an efficient division of labor:

    • Strategy model (small model): analyzes the task, evaluates historical experiments, and decides the exploration direction;
    • Execution model (large model): turns the strategy into code, handling implementation, debugging, and testing.

    Through multiple rounds of iteration, the two collaborate to form a continuously evolving agent system. Following the typical architecture of such systems, the sections below break down the design of three core modules.

    2. Core Architecture: Responsibilities of the Three Modules

    A complete RSI framework typically consists of three parts:

    1. Decision core: teaches the agent “what to do next”;
    2. Workspace: accumulates skills and experience to avoid repeating mistakes;
    3. Evaluation arena: objectively measures whether the agent is truly learning and improving.

    2.1 Decision Core: Online Policy Learning over a Shared Search State

    The prerequisite for decision-making is “remembering what happened.” The system maintains a continuously updated shared search state—essentially an experiment archive—that typically includes:

    • All code versions attempted so far;
    • The evolutionary relationships between versions (which version was improved from which);
    • The success or failure outcome of each experiment;
    • Candidate directions that remain unexplored;
    • The remaining experiment budget.

    Based on this archive, the system completes three decision steps in each iteration: select a historical version worth further optimization; decide whether to explore a brand-new idea or improve an existing method; and pick the most promising and feasible option from the candidate actions.

    To make decisions increasingly accurate, two complementary policy-learning mechanisms can be introduced.

    (1) UCB-based policy learning. The classic KL-UCB approach considers both the effectiveness of past attempts and current uncertainty, striking a balance between “exploiting proven successes” and “exploring unknown directions.” The illustrative logic is as follows:

    1. def select_action(arms):
    2. # arms: [(action_id, mean_reward, n_trials), ...]
    3. total = sum(n for _, _, n in arms)
    4. best, best_score = None, -inf
    5. for aid, mean, n in arms:
    6. if n == 0:
    7. return aid # Prioritize unexplored actions
    8. bonus = sqrt(log(total) / n) # Uncertainty bonus
    9. score = mean + bonus
    10. if score > best_score:
    11. best, best_score = aid, score
    12. return best

    This ensures the system neither converges prematurely to a seemingly decent solution nor diverges endlessly.

    (2) Memory-based policy learning. Effective experience from historical experiments is distilled into “policy memory,” which records not only whether a method succeeded but also its applicable conditions and concrete guidance. As new experiments are produced, this experience is reinforced, revised, or retired when it no longer applies. Compared with plain outcome statistics, conditional experience transfers better to similar but different tasks.

    2.2 Research Workflow: Proposer–Worker Collaboration

    If the existing method itself is fundamentally limited, merely patching code is unlikely to bring real breakthroughs. Therefore, beyond the decision core, a structured research workflow is needed:

    • Proposer: analyzes the current task, the existing evaluation environment, and historical experiment results; identifies the system’s capability gaps; and proposes new solution ideas;
    • Worker: puts the proposal into practice—implementing, debugging, and testing it in code—then feeds the execution results back to the proposer.

    This “propose a hypothesis—verify experimentally—refine with feedback” loop essentially engineers the scientific research methodology into the agent system.

    2.3 Workspace: Letting the Agent Remember Successful Experience

    Experience management is the key to continuous evolution. The workspace module typically handles three types of responsibilities:

    • Skill consolidation: packaging validated, general-purpose capabilities (such as algorithm templates or debugging routines) into reusable “skill entries” that can be retrieved and invoked directly in later tasks;
    • Experience structuring: attaching metadata—applicable conditions, failure causes, improvement suggestions—to each piece of experience, so the strategy model can perform conditional matching during retrieval;
    • Lifecycle management: as experiments progress, outdated or falsified experience must be downweighted or removed in time, preventing memory pollution from misleading subsequent decisions.

    3. How to Objectively Evaluate “Real Progress”

    The biggest risk of an RSI system is “feeling good about itself”—the agent claims it has improved while its actual capability is unchanged or even degraded. An independent evaluation module is therefore essential, with the following design points:

    • Task set isolation: evaluation tasks must not participate in training or policy learning, avoiding information leakage;
    • Before-and-after comparison: on the same task set, compare the agent’s pass rate, runtime, code quality, and other metrics before and after the improvement;
    • Multi-round stability: a single round of improvement may be luck; the significance of gains should be verified across multiple random seeds or task splits.

    Only through this kind of evaluation can we confirm whether the system truly possesses the ability to “learn and improve from tasks.”

    4. Practical Takeaways

    This “small model directing large model” paradigm offers several general lessons for building automated coding agents:

    1. Separate decision-making from execution: assigning “figuring out what to do” and “writing how to do it” to different model contexts significantly reduces fixed mindsets;
    2. Small models are not just for chores: at the abstract strategy level, small models are low-cost and flexible thinkers, making them good decision-makers;
    3. Memory must be conditional: storing only “success/failure” verdicts has limited value; experience with applicable conditions is transferable;
    4. Exploration–exploitation balance is the soul: explicitly modeling uncertainty with multi-armed bandit algorithms (such as UCB) is more robust than a purely greedy strategy;
    5. Evaluation must be independent: without an isolated evaluation environment, continuous evolution cannot be verified.

    Looking ahead, frameworks of this kind are expected to integrate with mainstream agent development platforms and become an important part of cloud-based automated R&D pipelines—developers only need to provide the task objective and budget, and the agent can iterate autonomously and evolve continuously in a controlled environment.