Self-Evolving Agent Framework: Enabling Continuous Self-Improvement in Small Models
This article explains a self-evolving agent framework that lets small models improve over time. It covers three components: a shared search state that archives every experiment, a dual-track learning approach that combines UCB-based exploration with structured policy memory, and a Proposer-Worker research workflow that moves beyond incremental code patches. It also discusses practical considerations for reliable evaluation, budget allocation, memory management, and human oversight.
Introduction: Why Self-Improvement Is a New Challenge for Agents
In recent years, gains in large language model capability have relied mainly on two approaches: scaling up model size and adding more training data. Both approaches are becoming more expensive, while their marginal returns keep shrinking. This raises a natural question: can a model improve without a larger parameter count, by learning and correcting itself while it works, so that it “evolves on the job”?
This is the core question that self-evolving agent frameworks try to answer. Unlike the traditional approach of generating an answer in a single call, these frameworks treat the agent as a continuously running experimental system. The agent records every attempt, evaluates every success and failure, distills lessons from them, and uses those lessons to guide its next decisions. This article breaks down the design ideas and implementation essentials of such a framework across three layers: shared state management, policy learning mechanisms, and the research workflow.
1. Shared Search State: The Agent’s Experiment Archive
The starting point of any self-improving system is a complete record of its history. If an agent makes every decision without memory, learning is not possible. The first core component of the framework is therefore the shared search state, a continuously updated archive of experiments.
This archive contains at least five types of information:
- Historical code versions: all implementations that have been tried, organized chronologically;
- Evolution graph: the derivation relationships between versions, showing which version was modified from which, forming an “evolution tree”;
- Experiment results: the success or failure conclusion of each experiment, along with quantifiable evaluation metrics;
- Unexplored directions list: hypotheses and ideas that have been identified but not yet tried;
- Remaining experiment budget: resource constraints, including time, compute, and number of calls.
Based on this archive, the agent’s decision process has three steps. First, it selects a historical node from the evolution tree that is worth optimizing further. This requires weighing both the node’s past performance and the potential of its branches. Second, it decides whether to explore (try entirely new ideas) or exploit (improve existing methods). Third, it selects the candidate action with the highest expected value and feasibility and executes it.
The strength of this design is that it turns “what to improve” from an intuition-driven question into a computable, traceable search problem.
2. Dual-Track Policy Learning: UCB and Policy Memory Working Together
An archive alone is not enough. The key is how the system uses its history to make increasingly accurate decisions. The framework uses two complementary policy learning mechanisms for this.
2.1 Upper Confidence Bound (UCB) Policy Learning
The first mechanism borrows a classic idea from multi-armed bandit problems. It uses the upper confidence bound (UCB) method, specifically a variant called KL-UCB that accounts for differences between distributions. For each candidate direction, the core logic weighs two quantities: historical reward (how well past attempts performed) and uncertainty (how thoroughly this direction has been explored).
The decision formula can be abstracted as:
score(a) = mean_reward(a) + exploration_bonus(a, t)
The exploration bonus term decays as the number of attempts on a direction increases. Directions that perform well and have been well validated get priority for exploitation. Rarely tested directions, which may still hold surprises, receive periodic chances. Through this mechanism, the framework keeps a dynamic balance between relying on what works and taking risks, which helps it avoid converging too early on a local optimum.
2.2 Memory-Based Policy Learning
The second mechanism is closer to how human experts accumulate experience. It distills knowledge validated in past experiments into structured policy memory. Ordinary logs only record that a method succeeded. Policy memory contains three levels:
- Conclusion: the effect a method produced, and on which metrics;
- Applicability conditions: the prerequisites for the method to work, such as task type, data characteristics, or existing system structure;
- Operational guidance: how to apply the lesson in practice, including implementation steps and common pitfalls.
Policy memory is updated over time. New experiments reinforce credible lessons, revise partially outdated ones, and retire obsolete ones. This complements the UCB mechanism. UCB quantifies decisions well but does not explain why they work. Policy memory provides knowledge that is interpretable and transferable. The first ensures exploration efficiency, and the second ensures that experience compounds over time.
3. Research Workflow: Moving Beyond Patch-Style Improvement
If an existing method has structural limitations, patching the code rarely produces a major gain. To address this, the framework introduces a research workflow. Role division closes the loop from idea to validation.
3.1 Proposer: Diagnosing Weaknesses and Proposing Hypotheses
The Proposer analyzes three inputs: the nature of the current task, the existing execution framework (the Harness), and historical experiment results. From these, it answers two questions: where are the capability weaknesses of the current system, and what new idea could address them?
The Proposer’s output is not code. It is a research hypothesis with supporting reasoning. For example: “The existing solution has a high failure rate on long-context tasks. The root cause may be that information compression loses critical details. Introducing a hierarchical summarization mechanism is recommended.”
3.2 Worker: Implementing and Validating
The Worker receives the Proposer’s plan and handles the code implementation, debugging, and testing. It feeds the validation results, whether successes or failures, back to the shared search state along with detailed execution traces. The policy learning mechanisms then consume this data.
This division of labor has two benefits. First, thinking and doing are separated, so execution details do not obscure the overall direction. Second, failed experiments still carry value. They update the unexplored directions list and the applicability conditions in policy memory, so the system learns that a path is a dead end or viable only under specific conditions.
4. Key Engineering Considerations
Several easily overlooked points deserve attention when putting this kind of framework into practice:
- Reliability of evaluation signals: Self-improvement depends on a trustworthy evaluation function. If the test set is too narrow or the metrics can be gamed, the agent will learn shortcuts instead of genuinely improving. Multi-dimensional evaluation sets that include adversarial cases are recommended.
- Budget allocation: The experiment budget should be released in stages. Early on, it should favor exploration. Later, it should favor exploitation. This matches the decaying exploration trend in UCB.
- Managing memory growth: Policy memory needs regular compression and deduplication. Otherwise, contradictory lessons will interfere with decisions. Confidence weighting and conflict arbitration mechanisms can help.
- Human-in-the-loop interface: Full autonomy is not always the best choice. Keeping human approval checkpoints for high-risk changes balances safety and efficiency.
Conclusion
A self-evolving agent framework engineers the process of improvement itself. It uses shared state to preserve history, UCB to balance exploration and exploitation, policy memory to accumulate transferable experience, and a Proposer-Worker workflow to move beyond local patching. The significance of this approach is that capability growth no longer depends entirely on model parameter scale. With good memory and decision mechanisms, small models can keep getting stronger in specific domains. As cloud container platforms, object storage, and logging services continue to mature, the barrier to building long-running agent systems like this is dropping quickly. Developers who follow agent technology should study and practice this approach in depth.
