Table of Contents
Fetching ...

Cogito, ergo sum: A Neurobiologically-Inspired Cognition-Memory-Growth System for Code Generation

Yanlong Li, Jindong Li, Qi Wang, Menglin Yang, He Kong, Shengsheng Wang

TL;DR

Cogito reimagines code-generation by adopting a reverse, growth-based learning cycle in a multi-agent setting and embedding a hippocampus-like memory module to accumulate experience. Through three evolving roles—Debugger, Coder, and Planner—and a Super-Role that ultimately solves tasks autonomously, Cogito achieves state-of-the-art results while reducing token and API-call costs. Extensive experiments on eight benchmarks show substantial gains over MapCoder, especially with GPT-3.5-turbo, and meaningful improvements on complex problems, with GPT-4 further enhancing accuracy. This biologically-inspired design demonstrates that memory-guided, growth-driven collaboration can outperform traditional planning-first pipelines in both performance and efficiency, with practical implications for scalable AI-assisted software development.

Abstract

Large language models based Multi Agent Systems (MAS) have demonstrated promising performance for enhancing the efficiency and accuracy of code generation tasks. However,most existing methods follow a conventional sequence of planning, coding, and debugging,which contradicts the growth-driven nature of human learning process. Additionally,the frequent information interaction between multiple agents inevitably involves high computational costs. In this paper,we propose Cogito,a neurobiologically inspired multi-agent framework to enhance the problem-solving capabilities in code generation tasks with lower cost. Specifically,Cogito adopts a reverse sequence: it first undergoes debugging, then coding,and finally planning. This approach mimics human learning and development,where knowledge is acquired progressively. Accordingly,a hippocampus-like memory module with different functions is designed to work with the pipeline to provide quick retrieval in similar tasks. Through this growth-based learning model,Cogito accumulates knowledge and cognitive skills at each stage,ultimately forming a Super Role an all capable agent to perform the code generation task. Extensive experiments against representative baselines demonstrate the superior performance and efficiency of Cogito. The code is publicly available at https://anonymous.4open.science/r/Cogito-0083.

Cogito, ergo sum: A Neurobiologically-Inspired Cognition-Memory-Growth System for Code Generation

TL;DR

Cogito reimagines code-generation by adopting a reverse, growth-based learning cycle in a multi-agent setting and embedding a hippocampus-like memory module to accumulate experience. Through three evolving roles—Debugger, Coder, and Planner—and a Super-Role that ultimately solves tasks autonomously, Cogito achieves state-of-the-art results while reducing token and API-call costs. Extensive experiments on eight benchmarks show substantial gains over MapCoder, especially with GPT-3.5-turbo, and meaningful improvements on complex problems, with GPT-4 further enhancing accuracy. This biologically-inspired design demonstrates that memory-guided, growth-driven collaboration can outperform traditional planning-first pipelines in both performance and efficiency, with practical implications for scalable AI-assisted software development.

Abstract

Large language models based Multi Agent Systems (MAS) have demonstrated promising performance for enhancing the efficiency and accuracy of code generation tasks. However,most existing methods follow a conventional sequence of planning, coding, and debugging,which contradicts the growth-driven nature of human learning process. Additionally,the frequent information interaction between multiple agents inevitably involves high computational costs. In this paper,we propose Cogito,a neurobiologically inspired multi-agent framework to enhance the problem-solving capabilities in code generation tasks with lower cost. Specifically,Cogito adopts a reverse sequence: it first undergoes debugging, then coding,and finally planning. This approach mimics human learning and development,where knowledge is acquired progressively. Accordingly,a hippocampus-like memory module with different functions is designed to work with the pipeline to provide quick retrieval in similar tasks. Through this growth-based learning model,Cogito accumulates knowledge and cognitive skills at each stage,ultimately forming a Super Role an all capable agent to perform the code generation task. Extensive experiments against representative baselines demonstrate the superior performance and efficiency of Cogito. The code is publicly available at https://anonymous.4open.science/r/Cogito-0083.

Paper Structure

This paper contains 30 sections, 2 equations, 12 figures, 5 tables, 1 algorithm.

Figures (12)

  • Figure 1: The intuitions behind this work. (Top): brain’s different regions are dedicated to distinct functions and tasks. Inspired by this functional specialization, we design an agent with distinct roles that evolve through stages. (Bottom): the growth trajectory of an individual, progressing from observation and learning in childhood, to practice and imitation in young adulthood, and finally to independent problem-solving and planning in the expert stage.
  • Figure 2: Overview of Cogito. The upper section illustrates the learning process of the Super-Role stored in the memory module. The lower section provides a detailed explanation of the process: initially, it assumes the role of the debugger within the group, followed by transitions to the coder and planner roles. After completing the learning cycle, the final answer is provided by the Super-Role.
  • Figure 3: The abbreviated explanation of the process and sample outputs for each step.
  • Figure 5: The comparison results with respect to the algorithm and difficulty levels (APPS dataset).
  • Figure 6: An example of answers from the same group members and different group members on HumanEval.
  • ...and 7 more figures