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 条
  • [1] Unsupervised Image Denoising in Real-World Scenarios via Self-Collaboration Parallel Generative Adversarial Branches
    Lin, Xin
    Ren, Chao
    Liu, Xiao
    Huang, Jie
    Lei, Yinjie
    2023 IEEE/CVF INTERNATIONAL CONFERENCE ON COMPUTER VISION (ICCV 2023), 2023, : 12608 - 12618
  • [2] POSTER: Seccomp profiling with Dynamic Analysis via ChatGPT-assisted Test Code Generation
    Song, Somin
    Kundu, Ashish
    Tak, Byungchul
    PROCEEDINGS OF THE 19TH ACM ASIA CONFERENCE ON COMPUTER AND COMMUNICATIONS SECURITY, ACM ASIACCS 2024, 2024, : 1928 - 1930
  • [3] Automated code generation tools for collaboration systems
    Hartrum, Thomas C.
    CTS 2007: PROCEEDINGS OF THE 2007 INTERNATIONAL SYMPOSIUM ON COLLABORATIVE TECHNOLOGIES AND SYSTEMS, 2007, : 183 - 190
  • [4] An Empirical Study of the Non-Determinism of ChatGPT in Code Generation
    Ouyang, Shuyin
    Zhang, Jie m.
    Harman, Mark
    Wang, Meng
    ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2025, 34 (02)
  • [5] Investigating Code Generation Performance of ChatGPT with Crowdsourcing Social Data
    Feng, Yunhe
    Vanam, Sreecharan
    Cherukupally, Manasa
    Zheng, Weijian
    Qiu, Meikang
    Chen, Haihua
    Proceedings - International Computer Software and Applications Conference, 2023, 2023-June : 876 - 885
  • [6] Investigating Code Generation Performance of ChatGPT with Crowdsourcing Social Data
    Feng, Yunhe
    Vanam, Sreecharan
    Cherukupally, Manasa
    Zheng, Weijian
    Qiu, Meikang
    Chen, Haihua
    2023 IEEE 47TH ANNUAL COMPUTERS, SOFTWARE, AND APPLICATIONS CONFERENCE, COMPSAC, 2023, : 876 - 885
  • [7] A Pilot Study on Secure Code Generation with ChatGPT forWeb Applications
    Jamdade, Mahesh
    Liu, Yi
    PROCEEDINGS OF THE 2024 ACM SOUTHEAST CONFERENCE, ACMSE 2024, 2024, : 229 - 234
  • [8] Exploring Early Adopters' Perceptions of ChatGPT as a Code Generation Tool
    Scoccia, Gian Luca
    2023 38TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING WORKSHOPS, ASEW, 2023, : 88 - 93
  • [9] No Need to Lift a Finger Anymore? Assessing the Quality of Code Generation by ChatGPT
    Liu, Zhijie
    Tang, Yutian
    Luo, Xiapu
    Zhou, Yuming
    Zhang, Liang Feng
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2024, 50 (06) : 1548 - 1584
  • [10] A Closer Look at Different Difficulty Levels Code Generation Abilities of ChatGPT
    Yan, Dapeng
    Gao, Zhipeng
    Liu, Zhiming
    2023 38TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, ASE, 2023, : 1887 - 1898