arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.15852cs.SEcs.AI
收藏

SOEN-101: 利用大语言模型智能体模拟软件过程模型实现代码生成

SOEN-101: Code Generation by Emulating Software Process Models Using Large Language Model Agents

Concordia University(康考迪亚大学);DePaul University(德保罗大学)

Feng Lin, Dong Jae Kim, Tse-Husn, Chen

AI总结:

本研究提出模拟软件过程模型的多LLM智能体代码生成框架FlowGen,在多个基准上实现显著性能提升,验证了软件过程对提升LLM代码生成质量与稳定性的作用。

摘要:

软件过程模型是促进软件团队协作与沟通以解决复杂开发任务的关键要素。受这些软件工程实践的启发,我们提出了FlowGen——一种基于多个大语言模型(LLM)智能体模拟软件过程模型的代码生成框架。我们模拟了三种过程模型:FlowGenWaterfall、FlowGenTDD和FlowGenScrum,通过分配LLM智能体扮演对应日常开发活动的角色(即需求工程师、架构师、开发者、测试人员和scrum主管),并组织它们的沟通模式。这些智能体借助思维链和提示组合协同工作,并通过持续自我优化提升代码质量。我们使用GPT3.5作为底层大语言模型,选取多个基线方法(RawGPT、CodeT、Reflexion),在四个基准数据集HumanEval、HumanEval-ET、MBPP和MBPP-ET上评估代码生成效果。研究结果表明,FlowGenScrum的表现优于其他过程模型,在HumanEval、HumanEval-ET、MBPP和MBPP-ET上的Pass@1分别达到75.2、65.5、82.5和56.7(较RawGPT平均提升15%)。与其他前沿技术相比,FlowGenScrum在MBPP上的Pass@1高于CodeT,且两者均优于Reflexion。值得注意的是,将CodeT集成到FlowGenScrum中带来了统计意义上的显著提升,取得了最高的Pass@1分数。我们的分析还显示,不同开发活动对代码异味和异常处理的影响存在差异,其中设计和代码评审环节增加了更多异常处理逻辑,同时减少了代码异味。最后,FlowGen模型在不同GPT3.5版本和温度参数下均能保持稳定的Pass@1分数,凸显了软件过程模型在提升LLM生成代码的质量与稳定性方面的有效性。

英文摘要:

Software process models are essential to facilitate collaboration and communication among software teams to solve complex development tasks. Inspired by these software engineering practices, we present FlowGen - a code generation framework that emulates software process models based on multiple Large Language Model (LLM) agents. We emulate three process models, FlowGenWaterfall, FlowGenTDD, and FlowGenScrum, by assigning LLM agents to embody roles (i.e., requirement engineer, architect, developer, tester, and scrum master) that correspond to everyday development activities and organize their communication patterns. The agents work collaboratively using chain-of-thought and prompt composition with continuous self-refinement to improve the code quality. We use GPT3.5 as our underlying LLM and several baselines (RawGPT, CodeT, Reflexion) to evaluate code generation on four benchmarks: HumanEval, HumanEval-ET, MBPP, and MBPP-ET. Our findings show that FlowGenScrum excels compared to other process models, achieving a Pass@1 of 75.2, 65.5, 82.5, and 56.7 in HumanEval, HumanEval-ET, MBPP, and MBPP-ET, respectively (an average of 15% improvement over RawGPT). Compared with other state-of-the-art techniques, FlowGenScrum achieves a higher Pass@1 in MBPP compared to CodeT, with both outperforming Reflexion. Notably, integrating CodeT into FlowGenScrum resulted in statistically significant improvements, achieving the highest Pass@1 scores. Our analysis also reveals that the development activities impacted code smell and exception handling differently, with design and code review adding more exception handling and reducing code smells. Finally, FlowGen models maintain stable Pass@1 scores across GPT3.5 versions and temperature values, highlighting the effectiveness of software process models in enhancing the quality and stability of LLM-generated code.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑