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 条
  • [31] Modular Visual Question Answering via Code Generation
    Subramanian, Sanjay
    Narasimhan, Medhini
    Khangaonkar, Kushal
    Yang, Kevin
    Nagrani, Arsha
    Schmid, Cordelia
    Zeng, Andy
    Darrell, Trevor
    Klein, Dan
    61ST CONFERENCE OF THE THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS, ACL 2023, VOL 2, 2023, : 747 - 761
  • [32] Automatic Documentation Generation via Source Code Summarization
    McBurney, Paul W.
    2015 IEEE/ACM 37TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, VOL 2, 2015, : 903 - 906
  • [33] Using Code from ChatGPT: Finding Patterns in the Developers' Interaction with ChatGPT
    Terzi, Anastasia
    Bibi, Stamatia
    Tsitsimiklis, Nikolaos
    Angelidis, Pantelis
    REUSE AND SOFTWARE QUALITY, ICSR 2024, 2024, 14614 : 137 - 152
  • [34] On the Use of ChatGPT for Code Review Do Developers Like Reviews By ChatGPT?
    Watanabe, Miku
    Kashiwa, Yutaro
    Lin, Bin
    Hirao, Toshiki
    Yamaguchi, Ken'ichi
    Iida, Hajimu
    PROCEEDINGS OF 2024 28TH INTERNATION CONFERENCE ON EVALUATION AND ASSESSMENT IN SOFTWARE ENGINEERING, EASE 2024, 2024, : 375 - 380
  • [35] Defending ChatGPT against jailbreak attack via self-reminders
    Yueqi Xie
    Jingwei Yi
    Jiawei Shao
    Justin Curl
    Lingjuan Lyu
    Qifeng Chen
    Xing Xie
    Fangzhao Wu
    Nature Machine Intelligence, 2023, 5 : 1486 - 1496
  • [36] Defending ChatGPT against jailbreak attack via self-reminders
    Xie, Yueqi
    Yi, Jingwei
    Shao, Jiawei
    Curl, Justin
    Lyu, Lingjuan
    Chen, Qifeng
    Xie, Xing
    Wu, Fangzhao
    NATURE MACHINE INTELLIGENCE, 2023, 5 (12) : 1486 - 1496
  • [37] Write me this Code: An Analysis of ChatGPT Quality for Producing Source Code
    Moratis, Konstantinos
    Diamantopoulos, Themistoklis
    Nastos, Dimitrios-Nikitas
    Symeonidis, Andreas
    2024 IEEE/ACM 21ST INTERNATIONAL CONFERENCE ON MINING SOFTWARE REPOSITORIES, MSR, 2024, : 147 - 151
  • [38] On Automatic Generation of VHDL Code for Self-Organizing Map
    Onoo, Akira
    Hikawa, Hiroomi
    Miyoshi, Seiji
    Maeda, Yutaka
    IJCNN: 2009 INTERNATIONAL JOINT CONFERENCE ON NEURAL NETWORKS, VOLS 1- 6, 2009, : 953 - +
  • [39] Self-Planning Code Generation with Large Language Models
    Jiang, Xue
    Dong, Yihong
    Wang, Lecheng
    Fang, Zheng
    Shang, Qiwei
    Li, Ge
    Jin, Zhi
    Jiao, Wenpin
    ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2024, 33 (07)
  • [40] Facilitation of IoT software maintenance via code analysis and generation
    Manev, Dimitar
    Dimov, Aleksandar
    2017 2ND INTERNATIONAL MULTIDISCIPLINARY CONFERENCE ON COMPUTER AND ENERGY SCIENCE (SPLITECH), 2017, : 105 - 110