Self-Collaboration Code Generation via ChatGPT

被引:6
|
作者
Dong, Yihong [1 ,2 ]
Jiang, Xue [1 ,2 ]
Jin, Zhi [1 ,2 ]
Li, Ge [1 ,2 ]
机构
[1] Peking Univ, Key Lab High Confidence Software Technol, Minist Educ, Beijing, Peoples R China
[2] Peking Univ, Sch Comp Sci, Beijing, Peoples R China
基金
中国国家自然科学基金;
关键词
Code generation; large language models; multi-agent collaboration; software development;
D O I
10.1145/3672459
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页数:38
相关论文
共 50 条
  • [41] GENERATION OF MORE EFFICIENT FORTRAN CODE VIA SYMBOLIC SOFTWARE
    PAJUNEN, P
    SUPERCOMPUTER, 1990, 7 (01): : 36 - 41
  • [42] Code Generation via Higher-Order Rewrite Systems
    Haftmann, Florian
    Nipkow, Tobias
    FUNCTIONAL AND LOGIC PROGRAMMING, PROCEEDINGS, 2010, 6009 : 103 - 117
  • [43] Robustness evaluation of code generation systems via concretizing instructions
    Yan, Ming
    Chen, Junjie
    Zhang, Jie M.
    Cao, Xuejie
    Yang, Chen
    Harman, Mark
    INFORMATION AND SOFTWARE TECHNOLOGY, 2025, 179
  • [44] Generating Java']Java code pairing with ChatGPT
    Zhao, Zelong
    Zhang, Nan
    Yu, Bin
    Duan, Zhenhua
    THEORETICAL COMPUTER SCIENCE, 2024, 1021
  • [45] Code on Demand: A Comparative Analysis of the Efficiency Understandability and Self-Correction Capability of Copilot ChatGPT and Gemini
    Batista, Samuel Silvestre
    Castro, Otávio
    Branco, Bruno
    Avelino, Guilherme
    ACM International Conference Proceeding Series, : 351 - 361
  • [46] Discriminating Human-authored from ChatGPT-Generated Code Via Discernable Feature Analysis
    Li, Ke
    Hong, Sheng
    Fu, Cai
    Zhang, Yunhe
    Liu, Ming
    2023 IEEE 34TH INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING WORKSHOPS, ISSREW, 2023, : 120 - 127
  • [47] Strengthening software self-cheeksumming via self-modifying code
    Giffin, JT
    Christodorescu, M
    Kruger, L
    21st Annual Computer Security Applications Conference, Proceedings, 2005, : 18 - 27
  • [48] Cracking the Code of Sustained Collaboration
    Gino, Francesca
    HARVARD BUSINESS REVIEW, 2019, 97 (06) : 71 - +
  • [49] The Generation of Collaboration
    Chen, Lin
    Xu, Samantha
    Bribriesco, Alejandro C.
    ANNALS OF THORACIC SURGERY, 2022, 113 (06): : 2113 - 2114
  • [50] Reusing legacy COBOL code with UNIL collaboration diagrams via a wide spectrum language
    Pu, JJ
    Zhang, ZP
    Xu, Y
    Yang, HJ
    PROCEEDINGS OF THE 2005 IEEE INTERNATIONAL CONFERENCE ON INFORMATION REUSE AND INTEGRATION, 2005, : 78 - 83