Recent advancements in automatic code generation using large language model (LLM) agent have brought us closer to the future of automated software development. However, existing single-agent approaches face limitations in generating and improving large-scale, complex codebases due to constraints in context length. To tackle this challenge, we propose Self-Organized multi-Agent framework (SoA), a novel multi-agent framework that enables the scalable and efficient generation and optimization of large-scale code. In SoA, self-organized agents operate independently to generate and modify code components while seamlessly collaborating to construct the overall codebase. A key feature of our framework is the automatic multiplication of agents based on problem complexity, allowing for dynamic scalability. This enables the overall code volume to be increased indefinitely according to the number of agents, while the amount of code managed by each agent remains constant. We evaluate SoA on the HumanEval benchmark and demonstrate that, compared to a single-agent system, each agent in SoA handles significantly less code, yet the overall generated code is substantially greater. Moreover, SoA surpasses the powerful single-agent baseline by 5% in terms of Pass@1 accuracy.
翻译:近年来,基于大语言模型智能体的自动代码生成技术已显著推进自动化软件开发的进程。然而,现有单智能体方法因上下文长度限制,在生成和优化大规模复杂代码库方面存在局限性。为解决这一挑战,我们提出自组织多智能体框架——一种能实现大规模代码可扩展高效生成与优化的新型多智能体框架。在该框架中,自组织智能体独立运作以生成和修改代码组件,同时通过无缝协作构建完整代码库。其核心特性在于智能体数量可根据问题复杂度自动倍增,从而实现动态可扩展性。这一机制使整体代码量能随智能体数量无限增长,而每个智能体管理的代码量保持恒定。我们在HumanEval基准测试上评估了SoA框架,结果表明:与单智能体系统相比,SoA中每个智能体处理的代码量显著减少,但整体生成的代码量大幅增加。此外,SoA在Pass@1准确率上较强大的单智能体基线提升5%。