Experiential Co-Learning of Software-Developing Agents

Chen Qian, Yufan Dang, Jiahao Li, Wei Liu, Zihao Xie, Yifei Wang, Weize Chen, Cheng Yang, Xin Cong, Xiaoyin Che, Zhiyuan Liu, Maosong Sun

Abstract

Recent advancements in large language models (LLMs) have brought significant changes to various domains, especially through LLM-driven autonomous agents. A representative scenario is in software development, where LLM agents demonstrate efficient collaboration, task division, and assurance of software quality, markedly reducing the need for manual involvement. However, these agents frequently perform a variety of tasks independently, without benefiting from past experiences, which leads to repeated mistakes and inefficient attempts in multi-step task execution. To this end, we introduce Experiential Co-Learning, a novel LLM-agent learning framework in which instructor and assistant agents gather shortcut-oriented experiences from their historical trajectories and use these past experiences for future task execution. The extensive experiments demonstrate that the framework enables agents to tackle unseen software-developing tasks more effectively. We anticipate that our insights will guide LLM agents towards enhanced autonomy and contribute to their evolutionary growth in cooperative learning.

Introduction

While multi-agent systems like ChatDev have shown promise in automating software engineering, they often suffer from a form of "procedural amnesia." Even if an agent has spent hours debugging a specific type of logic error in one project, it typically does not "remember" that experience when starting the next. This lack of cross-task learning leads to redundant iterations, where agents take inefficient paths to solve familiar problems, and regressions, where agents may inadvertently break working code during optimization. To address these challenges, we present Experiential Co-Learning, a framework that allows a pair of agents—an Instructor and an Assistant—to extract and utilize "shortcuts" from their historical task trajectories.

Methodology

The Experiential Co-Learning framework operates through a three-stage pipeline designed to transform raw interaction history into actionable knowledge.

The three-stage pipeline of Experiential Co-Learning: Co-Tracking, Co-Memorizing, and Co-Reasoning.
  1. Co-Tracking (The Rehearsal): An Instructor agent and an Assistant agent work through training tasks. Their interactions—sequences of instructions and resulting code snippets—are recorded as procedural trajectories.
  2. Co-Memorizing (The Shortcut Extraction): This stage converts linear trajectories into a Task Execution Graph. Nodes are deduplicated using code hashes (MD5). The system identifies "shortcuts"—edges connecting non-adjacent nodes that result in significant "information gain," such as skipping redundant steps or loops that led to compilation errors. These are stored in experience pools for both agents.
  3. Co-Reasoning (The Application): When faced with a new task, agents use Retrieval-Augmented Generation (RAG) to pull relevant shortcuts. These serve as high-quality, task-specific few-shot prompts that guide the agents toward efficient solutions.

Experimental Evaluation

The framework was evaluated using the Software Requirement Description Dataset (SRDD), which contains 1,200 requirements across categories like Education, Work, Life, Games, and Creation. The tasks range from simple utilities to complex games like Tetris variants. The system was compared against major baselines, including GPT-Engineer, MetaGPT, and ChatDev.

Results and Key Insights

Experiential Co-Learning demonstrated substantial improvements across all primary metrics:

  • Quality and Executability: The framework achieved a quality score of 0.7304, nearly doubling ChatDev’s 0.4267. Furthermore, the code produced had a 96.5% success rate in compilation, significantly higher than the 35-42% seen in single-agent or standard SOP-based frameworks.
  • Efficiency: By utilizing shortcuts, the framework reduced average task duration to 122 seconds (compared to ChatDev's 148 seconds), as agents required fewer communication rounds to reach a final solution.
  • Human Preference: In head-to-head comparisons, human evaluators preferred Co-Learning's output over ChatDev's in 59% of cases.
Win rate comparison of Experiential Co-Learning against major baselines using both LLM and human evaluation.

A critical insight from this research is that shortcuts are superior to full history. Simply memorizing every step of a past project can be detrimental because historical trajectories often contain "dead ends." By specifically mining for shortcuts that skip these inefficiencies, agents become more decisive and effective. Additionally, the framework leverages objective feedback; successful compilation serves as a primary signal for whether a past experience is worth remembering.

Conclusion

Experiential Co-Learning represents a significant step toward autonomous, evolving LLM agents. By treating past successes and failures as reusable shortcuts, agents can overcome the limitations of "procedural amnesia." Future work will focus on addressing the "simplest logic" bias—where agents may implement the most basic version of a requirement—and scaling these techniques to massive, multi-file enterprise repositories.

Summary updated

BibTeX
@inproceedings{qian2024experiential,
  author = {Chen Qian and Yufan Dang and Jiahao Li and Wei Liu and Zihao Xie and Yifei Wang and Weize Chen and Cheng Yang and Xin Cong and Xiaoyin Che and Zhiyuan Liu and Maosong Sun},
  title = {{Experiential Co-Learning of Software-Developing Agents}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  url = {https://openreview.net/forum?id=1sqA7NHGp7},
}
Figure