Self-Collaboration Code Generation via ChatGPT

By Yihong Dong, Xue Jiang, Zhi Jin, Ge Li. ACM Transactions on Software Engineering and Methodology, 2023

528 citations recorded by the source corpus.

Although large language models (LLMs) have demonstrated remarkable code-generation ability, they still struggle with complex tasks. In real-world software development, humans usually tackle complex tasks through collaborative teamwork, a strategy that significantly controls development complexity and enhances software quality. Inspired by this, we present a self-collaboration framework for code generation employing LLMs, exemplified by ChatGPT. Specifically, through role instructions, (1) Multiple LLM agents act as distinct “experts,” each responsible for a specific subtask within a complex task; (2) Specify the way to collaborate and interact, so that different roles form a virtual team to facilitate each other’s work, ultimately the virtual team addresses code generation tasks collaboratively without the need for human intervention. To effectively organize and manage this virtual team, we incorporate software-development methodology into the framework. Thus, we assemble an elementary team consisting of three LLM roles (i.e., analyst, coder, and tester) responsible for software development’s analysis, coding, and testing stages. We conduct comprehensive experiments on various code-generation benchmarks. Experimental results indicate that self-collaboration code generation relatively improves 29.9–47.1% Pass@1 compared to the base LLM agent. Moreover, we showcase that self-collaboration could potentially enable LLMs to efficiently handle complex repository-level tasks that are not readily solved by the single LLM agent.

Subfields: Artificial Intelligence, Information Systems

View Paper: https://www.semanticscholar.org/paper/ba2f935d2578fbf77ec1aa79e26e3db396771e38

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Maosong Sun
  2. Zhiyuan Liu
  3. Cheng Yang
  4. Shin Yoo
  5. Nitesh V. Chawla
  6. Mark Harman
  7. Qingyun Wu
  8. Mingwei Liu

In Information Systems

  1. Shin Yoo
  2. Mark Harman
  3. Maosong Sun
  4. Zhiyuan Liu
  5. Shubho Sengupta
  6. Mitya Lyubarskiy
  7. Jie M. Zhang
  8. Angela Fan

Citations in the corpus