Abstract
Autonomous agents powered by large language models (LLMs) show significant potential for achieving high autonomy in various scenarios such as software development. Recent research has shown that LLM agents can leverage past experiences to reduce errors and enhance efficiency. However, the static experience paradigm, reliant on a fixed collection of past experiences acquired heuristically, lacks iterative refinement and thus hampers agents' adaptability. In this paper, we introduce the Iterative Experience Refinement framework, enabling LLM agents to refine experiences iteratively during task execution. We propose two fundamental patterns: the successive pattern, refining based on nearest experiences within a task batch, and the cumulative pattern, acquiring experiences across all previous task batches. Augmented with our heuristic experience elimination, the method prioritizes high-quality and frequently-used experiences, effectively managing the experience space and enhancing efficiency. Extensive experiments show that while the successive pattern may yield superior results, the cumulative pattern provides more stable performance. Moreover, experience elimination facilitates achieving better performance using just 11.54% of a high-quality subset.
Introduction
While LLM-based agents have shown promise in automating software development, they typically suffer from a "static experience" problem. Most current agents learn from a fixed set of past trajectories or "shortcuts" (successful code optimizations) acquired in a single pass. In the real world, software development is iterative. A static pool of experience lacks adaptability; it might contain low-quality advice or become bloated with redundant information as the agent encounters more tasks. The challenge is: how can an agent continuously "level up" its knowledge base, keeping what works and discarding what doesn't, to handle increasingly complex software requirements?
Methodology: Iterative Experience Refinement (IER)
The IER framework treats task execution as a series of batches, allowing agents to refine their past experiences dynamically. The approach consists of three core components:
1. Experience Acquisition & Utilization
Following the "shortcut" method, agents record their communication and code changes. They identify "shortcuts"—transitions between non-adjacent steps in a development chain that lead to better code—and store these as key-value pairs (instruction-to-solution) for future retrieval.
2. Propagation Patterns
To manage how knowledge moves between tasks, we define two primary patterns:
- Successive Pattern: The agent inherits the experience pool only from the immediately preceding task batch. This prioritizes the "latest" knowledge but can be sensitive to the quality of the previous batch.
- Cumulative Pattern: The agent inherits experiences from all previous batches, providing a more stable but larger experience pool.
3. Heuristic Experience Elimination
To prevent the experience pool from becoming inefficient, a filtering mechanism uses Information Gain (measuring code quality improvement) and Retrieval Frequency (how often an experience is chosen). This keeps the experience space efficient and high-quality.
Experimental Setup
The study uses the Software Requirement Description Dataset (SRDD), containing 1,200 software requirement descriptions across 40 categories. The dataset was divided into 6 non-overlapping task batches through hierarchical sampling to ensure a similar distribution of software categories in each batch, facilitating the study of iterative refinement.
Results and Discussion
The researchers compared IER against several baselines, including GPT-Engineer, MetaGPT, ChatDev, and Experiential Co-Learning (ECL).
Performance Trends
As shown in the experimental results, both patterns demonstrate significant improvements over successive batches. The Successive Pattern often reaches higher performance peaks because it focuses on the most recent and presumably most refined data. However, the Cumulative Pattern is more reliable and less prone to performance drops from "bad batches" because it draws from a broader history.
Key Insights
- Software Quality: IER-Successive achieved the highest overall quality score (0.6372), a significant jump over the baseline ChatDev (0.4665) and the previous state-of-the-art ECL (0.5775).
- Efficiency: Despite the extra steps of retrieval and refinement, the average duration for software manufacturing did not increase substantially compared to baselines, thanks to efficient vector-based retrieval.
- The "Long-Tail" and Elimination: Experience utilization follows a long-tail distribution. By pruning the experience pool down to just the top 11.54% of experiences (930 out of 8,053), the agents actually performed better than they did with the full set, suggesting that "noise" in an agent's memory is a significant hurdle to performance.
Conclusion
The IER framework demonstrates that moving from static to dynamic experience management significantly enhances the performance of software-developing agents. While the Successive pattern offers high peaks, the Cumulative pattern provides stability. Most importantly, the effectiveness of the elimination mechanism highlights that high-quality, curated experience is more valuable than sheer volume. Future work will explore the computational costs associated with multi-agent communication and the generalizability of these mechanisms to non-coding domains.
Summary updated