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

**Authors:** Yueheng Zhu, Chao Liu, Xuan He, Xiaoxue Ren, Zhongxin Liu, Ruwei Pan, Hongyu Zhang  
**arXiv:** [2504.04220](https://arxiv.org/abs/2504.04220)  
**Date:** 2025-04-05  
**Summary page:** https://www.summarizepaper.com/en/arxiv-id/2504.04220v1/

## Key points

- Authors Yueheng Zhu, Chao Liu, Xuan He, Xiaoxue Ren, Zhongxin Liu, Ruwei Pan, and Hongyu Zhang focus on multi-agent frameworks for function-level code generation
- Frameworks aim to enhance software development productivity by automatically generating source code based on task descriptions
- Agents powered by Large Language Models (LLMs) handle planning, code generation, testing, and debugging tasks
- Study evaluates generalizability of existing frameworks across different foundation LLMs
- Introduction of AdaCoder as an adaptive planning and multi-agent framework for function-level code generation by <Organization>
- AdaCoder operates in two phases: initial code generation without planning in Phase-1 and iterative code generation with strategic planning in Phase-2
- Evaluation shows AdaCoder's superior generalizability across diverse LLMs compared to existing frameworks
- AdaCoder achieves a 27.69% higher Pass@1 rate than the best baseline MapCoder, is 16 times faster in inference speed, and consumes 12 times fewer tokens during operation

## Summary

In their paper titled "AdaCoder: An Adaptive Planning and Multi-Agent Framework for Function-Level Code Generation," authors Yueheng Zhu, Chao Liu, Xuan He, Xiaoxue Ren, Zhongxin Liu, Ruwei Pan, and Hongyu Zhang delve into the realm of multi-agent frameworks designed for function-level code generation. The primary goal of these frameworks is to enhance software development productivity by automatically generating source code at the function level based on task descriptions. Typically, these frameworks consist of agents powered by Large Language Models (LLMs) that handle various tasks such as planning, code generation, testing, and debugging. Previous studies have demonstrated the effectiveness of existing multi-agent code generation frameworks on platforms like ChatGPT. However, their adaptability across different foundation LLMs has not been extensively explored. To address this gap in knowledge, the authors conducted an empirical study to assess the generalizability of four cutting-edge multi-agent code generation frameworks across six distinct open-source LLMs with varying parameter sizes, architectures, and performance levels. The results of their study unveiled the inconsistent generalizability of existing frameworks when applied to diverse foundation LLMs. Building upon the insights gained from their empirical investigation,<Organization> introduce AdaCoder as a novel adaptive planning and multi-agent framework for function-level code generation. <Organization> operates in two phases: Phase-1 involves initial code generation without planning using an LLM-based coding agent and a script-based testing agent to leverage the native capabilities of LLMs while identifying cases beyond their scope and pinpointing execution hindrances. In Phase-2,<Organization> incorporates a rule-based debugging agent and an LLM-based planning agent for iterative code generation with strategic planning. The evaluation of <Organization> demonstrates its superior generalizability across diverse LLMs compared to existing frameworks. On average, <Organization> achieves a 27.69% higher Pass@1 rate than the best baseline MapCoder while being 16 times faster in inference speed and consuming 12 times fewer tokens during operation. This showcases <Organization>'s efficacy in addressing challenges related to function-level code generation on varied foundation LLM platforms.
