arrow
Return

Self-Collaboration Code Generation via ChatGPT

delete2024-09-27
delete5
delete
OA
AI
Y
Yihong Dong
X
Xue Jiang
Z
Zhi Jin
G
Ge Li *
DOI:10.1145/3672459delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
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 selfcollaboration could potentially enable LLMs to efficiently handle complex repository-level tasks that are not readily solved by the single LLM agent.
Keywords:
Code generation
large language models
multi-agent collaboration
software development

Journal

A
ACM Transactions on Software Engineering and Methodology
IF:
6.2
Papers:
1.2K
Citations:
3.4K

Organization

P
peking university
Scholars:
11.9W
Papers: 8.7W
Citations: 146
Cited Papers

Cited Papers

High-resolution seismic reflection profiles from Lake Titicaca, Peru-Bolivia: Evidence for Holocene aridity in the tropical Andes
err1998-01-01
err0
PREAI
errGeoffrey O. Seltzer; Paul Baker; Scott Cross; Robert Dunbar; Sherilyn Fritz
errShare
errSave
Serum lipid abnormalities in heart transplant recipients: predominance of HDL2-like particles in the HDL pattern
err1990-03-01
err0
PREAI
errVéronique Atger; Michèle Cambillau; Romain Guillemain; Dominique Farge; Gilles Dreyfus; Sylvie Hamon; Anik Girard; Alain Carpentier; Nicole Moatti
errShare
errSave
Design Space Approach for Preservative System Optimization of an Anti-Aging Eye Fluid Emulsion
err2015-10-15
err0
errOAAI
errFelipe Rebello Lourenço; Fabiane Lacerda Francisco; Márcia Regina Spuri Ferreira; Terezinha De Jesus Andreoli; Raimar Löbenberg; Nádia Bou-Chacra
errShare
errSave
errShare
errSave
CodeScore: Evaluating Code Generation by Learning Code Execution
err2025-02-23
err0
PREAI
errYihong Dong; Jiazheng Ding; Xue Jiang; Ge Li; Zhuo Li; Zhi Jin
errShare
errSave
The impact of flow PRA on outcome in pediatric heart recipients in modern era: An analysis of the Pediatric Heart Transplant Study database
err2017-11-16
err0
PREAI
errB. B. Das; E. Pruitt; K. Molina; W. Ravekes; S. Auerbach; A. Savage; L. Knox; J. K. Kirklin; D. C. Naftel; D. Hsu
errShare
errSave
How Can We Know What Language Models Know?
err2020-12-01
err555
errOAAI
errJiang, Zhengbao; Xu, Frank F.; Araki, Jun; Neubig, Graham
errShare
errSave
Variable effects of temperature on insect herbivory
err2014-05-06
err0
errOAAI
errNathan P. Lemoine; Deron E. Burkepile; John D. Parker
errShare
errSave
researcher View more