Small Model-Powered Self-Evolving Agent Framework: Architecture Explained

    This article breaks down a self-evolving agent framework built around a small parameter model as its execution core. It explains why larger models are not the only path to higher capability, how a Shared Search State turns memory into a computable structure, how the three-step decision loop of select, decide, and act drives iteration, and how outcome-centric strategy distillation and preference-centric calibration improve decisions over time. It also covers engineering practices under budget constraints, such as budget layering, sandbox isolation, state persistence, deduplication and pruning, and observability, along with the framework's suitable use cases and limitations.

    1. The Starting Point: Why “Bigger Models” Are Not the Only Answer

    In scenarios where agents take on tasks such as automated coding and automated experiment tuning, a long-standing intuition holds that the capability ceiling is determined by the number of model parameters. Yet engineering practice repeatedly reveals a counterintuitive phenomenon: a small model at roughly the 9 billion parameter level can keep producing better solutions across multiple rounds of iteration, as long as it is placed inside a suitable “evolutionary loop.” A large model that simply stacks parameters, but lacks memory, evaluation, and scheduling mechanisms, can instead fall into repeated trial and error.

    The reason is not mysterious. The difficulty of agent tasks often lies not in “whether a single reasoning step is smart,” but in “whether long-horizon decisions stay consistent”: where to make the next change, whether it is worth continuing to invest, and when to abandon the current branch. Problems of this kind depend far more on state management, evaluation feedback, and policy updates than on isolated intelligence. The topic of this article can therefore be stated neutrally as follows: how to build an agent evolution framework that uses a small parameter model as its execution core and has the capacity for continuous self-improvement.

    2. The Core Data Structure: Shared Search State

    The first cornerstone of the framework is an “experiment record” that can be shared across multiple rounds and multiple roles. It is not a simple log, but a structured state that typically contains at least five categories of information:

    1. Candidate version set: code or solution versions generated throughout history, together with their artifacts.
    2. Evolutionary relationships: the derivation relationships between versions, forming a tree or graph structure that supports traceback and comparison.
    3. Evaluation results: success or failure of each run, metric changes, and categorization of failure causes.
    4. Unexplored directions: modification points, parameter regions, or implementation paths that have not yet been tried.
    5. Remaining budget: time, number of calls, compute, or sandbox execution quota.

    Illustrative structure (language-agnostic):

    1. SearchState {
    2. nodes: [{id, parent_id, diff_summary, score, status}]
    3. edges: [(parent_id -> child_id)]
    4. frontier: [unexplored_direction]
    5. budget: {steps_left, runtime_left}
    6. }

    The value of this record is that it turns “memory” into a computable object: the agent no longer relies on fragments left in the context window, but explicitly reads state, makes choices, and writes results back, which supports long-horizon consistency.

    3. The Decision Loop: Select, Judge, Act

    On top of the shared state, the framework runs a stable three-step loop:

    • Select the baseline version: based on score, confidence, and diversity, pick a historical version from the evolution graph that is worth optimizing further, rather than always starting from the latest version.
    • Decide the strategy mode: determine whether to “explore new ideas” or “improve the existing approach.” This is essentially the exploration versus exploitation trade-off.
    • Generate the action plan: output the smallest verifiable next modification, such as a patch, a parameter adjustment, or an implementation replacement.

    Pseudocode example:

    1. while state.budget.steps_left > 0:
    2. base = select_node(state) # Select the baseline
    3. mode = decide_mode(state, base) # explore / exploit
    4. action = propose_action(base, mode) # Generate the plan
    5. result = run_in_sandbox(action) # Execute and evaluate
    6. state.update(base, action, result) # Write back to shared state

    The key point is: the small model is only responsible for local but high-quality proposals, while global consistency is guaranteed by the state and the rules.

    4. Two Complementary Strategy Learning Mechanisms

    To make decisions increasingly accurate, the framework typically introduces two complementary mechanisms:

    1) Outcome-Centric Strategy Distillation

    Both successes and failures are transcribed into reusable experience: successful paths are abstracted into “applicable conditions + operation patterns,” while failed paths are labeled as “risk patterns.” When the small model makes proposals in the next round, it reads this experience and avoids repeating the same mistakes.

    2) Preference-Centric Strategy Calibration

    Different solutions under the same baseline are compared pairwise to form preference signals, which are used to calibrate selection tendencies: whether to prefer lower-risk changes or higher-reward changes. Preference signals are more stable than absolute scores and are well suited to automated evaluation environments with high noise.

    The two are complementary: outcome distillation provides “factual memory,” while preference calibration provides “value ranking.”

    5. Engineering Practices Under Budget Constraints

    Continuous evolution must be stoppable, reproducible, and auditable. The following points are worth attention when putting it into practice:

    • Budget layering: split the total budget into an exploration budget and an exploitation budget to avoid burning through the quota early.
    • Sandbox isolation: execute all proposals in an isolated environment, with logging services and monitoring alerts to locate failures.
    • State persistence: write the shared state to object storage or a database to support resuming from breakpoints.
    • Deduplication and pruning: merge highly similar solutions and prune branches that have yielded no gains for a long time.
    • Observability: record the basis for each decision (why a given version was selected, why exploration was chosen) to make retrospectives easier.

    6. Applicability and Benefits

    This framework is especially suited to tasks with clear evaluation and decomposable steps, such as automated code iteration, experiment parameter search, and process optimization. The benefits appear mainly in three areas: reduced dependence on ultra-large models, improved stability on long-horizon tasks, and experience that can be accumulated and reused. The limitations are equally clear: if the evaluation signal is too noisy or the task cannot be decomposed, the evolutionary loop will degrade. Overall, a small model plus shared state plus strategy learning forms a pragmatic and scalable path toward self-evolution.