arrow
Return

AdaCoder: An Adaptive Planning and Multi-Agent Framework for Function-Level Code Generation

delete2025-12-12
delete0
PRE
AI
Y
Yueheng Zhu
C
Chao Liu
X
Xuan He
X
Xiaoxue Ren
刘忠鑫 (Zhongxin Liu)
R
Ruwei Pan
张宏玉 (Hongyu Zhang)
DOI:10.1109/TSE.2025.3642621delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Recently, researchers have proposed many multi-agent frameworks for function-level code generation, which aim to improve software development productivity by automatically generating function-level source code based on task descriptions. A typical multi-agent framework consists of Large Language Model (LLM)-based agents that are responsible for task planning, code generation, testing, debugging, etc. Studies have shown that existing multi-agent code generation frameworks perform well on ChatGPT. However, their generalizability across other foundation LLMs remains unexplored systematically. In this paper, we report an empirical study on the generalizability of four state-of-the-art multi-agent code generation frameworks across 12 open-source LLMs with varying code generation and instruction-following capabilities. Our study reveals the unstable generalizability of existing frameworks on diverse foundation LLMs. Based on the findings obtained from the empirical study, we propose AdaCoder, a novel adaptive planning, multi-agent framework for function-level code generation. AdaCoder has two phases. Phase-1 is an initial code generation step without planning, which uses an LLM-based coding agent and a script-based testing agent to unleash LLM’s native power, identify cases beyond LLM’s power, and determine the errors hindering execution. Phase-2 adds a rule-based debugging agent and an LLM-based planning agent for iterative code generation with planning. Our evaluation shows that AdaCoder achieves higher generalizability on diverse LLMs. Compared to the best baseline MapCoder, AdaCoder is on average 27.69% higher in Pass@1, 16 times faster in inference, and 12 times lower in token consumption.
Keywords:
Large language model
function-level code generation
multi-agent framework

Journal

IEEE Transactions on Software Engineering cover
IEEE Transactions on Software Engineering
IF:
5.6
Papers:
2.8K
Citations:
1.1W

Organization

Z
Zhejiang University
Scholars:
1.5W
Papers: 5.2K
Citations: 17.8W
C
chongqing university
Scholars:
1.1W
Papers: 4.3K
Citations: 1
Z
zhejiang university
Scholars:
17.4W
Papers: 12.0W
Citations: 152
researcher View more organizations