AgentCoder: Multi-Agent-based Code Generation with Iterative Testing and Optimisation
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
The advancement of natural language processing (NLP) has been significantly boosted by the development of transformer-based large language models (LLMs). These models have revolutionized NLP tasks, particularly in code generation, aiding developers in creating software with enhanced efficiency. Despite their advancements, challenges in balancing code snippet generation with effective test case generation and execution persist. To address these issues, this paper introduces Multi-Agent Assistant Code Generation (AgentCoder), a novel solution comprising a multi-agent framework with specialized agents: the programmer agent, the test designer agent, and the test executor agent. During the coding procedure, the programmer agent will focus on the code generation and refinement based on the test executor agent's feedback. The test designer agent will generate test cases for the generated code, and the test executor agent will run the code with the test cases and write the feedback to the programmer. This collaborative system ensures robust code generation, surpassing the limitations of single-agent models and traditional methodologies. Our extensive experiments on 9 code generation models and 12 enhancement approaches showcase AgentCoder's superior performance over existing code generation models and prompt engineering techniques across various benchmarks. For example, AgentCoder (GPT-4) achieves 96.3% and 91.8% pass@1 in HumanEval and MBPP datasets with an overall token overhead of 56.9K and 66.3K, while state-of-the-art obtains only 90.2% and 78.9% pass@1 with an overall token overhead of 138.2K and 206.5K.
Key facts. Cited by 31 papers in the map (data through 7 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 36 of its 41 references that are in the map. First posted on arXiv 20 Dec 2023.
Builds on
36 of 41 references.
Closest ancestors · 1
Same direction, newest first
Other references · 35
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023GPT-4 Technical Reportcited by 18,132
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,064
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Generative Agents: Interactive Simulacra of Human Behaviorcited by 3,500
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,317
- 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,155
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2023MetaGPT: Meta Programming for A Multi-Agent Collaborative Frameworkcited by 1,761
23 more
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2023CAMEL: Communicative Agents for "Mind" Exploration of Large Language Model Societycited by 1,348
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2023Teaching Large Language Models to Self-Debugcited by 963
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2023Reasoning with Language Model is Planning with World Modelcited by 846
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
- 2023AgentVerse: Facilitating Multi-Agent Collaboration and Exploring Emergent Behaviorscited by 580
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2021Unified Pre-training for Program Understanding and Generationcited by 361
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 327
- 2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-Xcited by 294
- 2023Large Language Models as Tool Makerscited by 293
- 2023Structured Chain-of-Thought Prompting for Code Generationcited by 136
- 2023CodeGen2: Lessons for Training LLMs on Programming and Natural Languagescited by 124
- 2023Self-planning Code Generation with Large Language Modelscited by 121
- 2023Self-Edit: Fault-Aware Code Editor for Code Generationcited by 110
- 2023Mindstorms in Natural Language-Based Societies of Mindcited by 105
- 2023ProAgent: Building Proactive Cooperative Agents with Large Language Modelscited by 97
- 2022CERT: Continual Pre-Training on Sketches for Library-Oriented Code Generationcited by 87
- 2023CodeScore: Evaluating Code Generation by Learning Code Executioncited by 66
- 2023CodeChain: Towards Modular Code Generation Through Chain of Self-revisions with Representative Sub-modulescited by 58
Built on by
Citing papers per year: 2024: 7; 2025: 17; 2026: 7.
31 papers.
Sort:
By area:
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systemscited by 125
- 2025Chain-of-Agents: End-to-End Agent Foundation Models via Multi-Agent Distillation and Agentic RLcited by 75
- 2025Do as We Do, Not as You Think: the Conformity of Large Language Modelscited by 48
- 2025Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMscited by 47
- 2026Code as Agent Harnesscited by 40
- 2024MAGE: A Multi-Agent Engine for Automated RTL Code Generationcited by 31
- 2025ReasonMed: A 370K Multi-Agent Generated Dataset for Advancing Medical Reasoningcited by 26
- 2025LLM-based Agentic Reasoning Frameworks: A Survey from Methods to Scenarioscited by 25
- 2025Revisit Self-Debugging with Self-Generated Tests for Code Generationcited by 21
- 2025LoCoBench-Agent: An Interactive Benchmark for LLM Agents in Long-Context Software Engineeringcited by 16
- 2024A Human-Like Reasoning Framework for Multi-Phases Planning Task with Large Language Modelscited by 12
- 2025SOP-Agent: Empower General Purpose AI Agent with Domain-Specific SOPscited by 11
19 more
- 2025SyncMind: Measuring Agent Out-of-Sync Recovery in Collaborative Software Engineeringcited by 8
- 2025HoarePrompt: Structural Reasoning About Program Correctness in Natural Languagecited by 7
- 2025Pragmatic Reasoning improves LLM Code Generationcited by 6
- 2024Think Thrice Before You Act: Progressive Thought Refinement in Large Language Modelscited by 5
- 2026RepoReasoner: Evaluating Repository-Level Code Reasoning Ability of Long-Context Language Modelscited by 5
- 2025MAPLE: Multi-Agent Adaptive Planning with Long-Term Memory for Table Reasoningcited by 4
- 2024Can Github issues be solved with Tree Of Thoughts?cited by 3
- 2024MaCTG: Multi-Agent Collaborative Thought Graph for Automatic Programmingcited by 3
- 2024Seed-CTS: Unleashing the Power of Tree Search for Superior Performance in Competitive Coding Taskscited by 3
- 2024Thinking Before Running! Efficient Code Generation with Thorough Exploration and Optimal Refinementcited by 3
- 2025AgentCDM: Enhancing Multi-Agent Collaborative Decision-Making via ACH-Inspired Structured Reasoningcited by 2
- 2026TDD-Agent: Test-Driven Reasoning for Code Generationcited by 2
- 2025Lessons Learned: A Multi-Agent Framework for Code LLMs to Learn and Improvecited by 0
- 2025Reasoning Distillation and Structural Alignment for Improved Code Generationcited by 0
- 2025SOCIA-Nabla: Textual Gradient Meets Multi-Agent Orchestration for Automated Simulator Generationcited by 0
- 2026DIANOIA: Diagnostic Decomposition and Joint Optimization for Multi-Agent Reasoningcited by 0
- 2026Selective Left-Shift: Turning Test-Time Compute and Difficulty-based Curation into Training Data for Low-Resource Code Generationcited by 0
- 2026Homogenization in Multi-Agent Systemscited by 0
- 2026TestGRAD: Evolving Test Suites via Failure Pattern Momentum for SWE-Agent Ensemblecited by 0
- 2026TestGRAD: Evolving Test Suites via Failure Pattern Momentum for SWE-Agent Ensemble7 Oct 2026
- 2026Homogenization in Multi-Agent Systems7 Oct 2026
- 2026TDD-Agent: Test-Driven Reasoning for Code Generation17 Aug 2026
- 2026RepoReasoner: Evaluating Repository-Level Code Reasoning Ability of Long-Context Language Models28 Jul 2026
- 2026Selective Left-Shift: Turning Test-Time Compute and Difficulty-based Curation into Training Data for Low-Resource Code Generation8 Jul 2026
- 2026Code as Agent Harness18 May 2026
- 2026DIANOIA: Diagnostic Decomposition and Joint Optimization for Multi-Agent Reasoning9 Feb 2026
- 2025LoCoBench-Agent: An Interactive Benchmark for LLM Agents in Long-Context Software Engineering17 Nov 2025
- 2025SOCIA-Nabla: Textual Gradient Meets Multi-Agent Orchestration for Automated Simulator Generation21 Oct 2025
- 2025Reasoning Distillation and Structural Alignment for Improved Code Generation20 Oct 2025
- 2025LLM-based Agentic Reasoning Frameworks: A Survey from Methods to Scenarios25 Aug 2025
- 2025AgentCDM: Enhancing Multi-Agent Collaborative Decision-Making via ACH-Inspired Structured Reasoning16 Aug 2025
19 more
- 2025Chain-of-Agents: End-to-End Agent Foundation Models via Multi-Agent Distillation and Agentic RL6 Aug 2025
- 2025ReasonMed: A 370K Multi-Agent Generated Dataset for Advancing Medical Reasoning11 Jun 2025
- 2025MAPLE: Multi-Agent Adaptive Planning with Long-Term Memory for Table Reasoning6 Jun 2025
- 2025Lessons Learned: A Multi-Agent Framework for Code LLMs to Learn and Improve29 May 2025
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systems31 Mar 2025
- 2025HoarePrompt: Structural Reasoning About Program Correctness in Natural Language25 Mar 2025
- 2025Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMs26 Feb 2025
- 2025Pragmatic Reasoning improves LLM Code Generation20 Feb 2025
- 2025SyncMind: Measuring Agent Out-of-Sync Recovery in Collaborative Software Engineering10 Feb 2025
- 2025Do as We Do, Not as You Think: the Conformity of Large Language Models23 Jan 2025
- 2025Revisit Self-Debugging with Self-Generated Tests for Code Generation22 Jan 2025
- 2025SOP-Agent: Empower General Purpose AI Agent with Domain-Specific SOPs16 Jan 2025
- 2024Thinking Before Running! Efficient Code Generation with Thorough Exploration and Optimal Refinement30 Dec 2024
- 2024Seed-CTS: Unleashing the Power of Tree Search for Superior Performance in Competitive Coding Tasks17 Dec 2024
- 2024MAGE: A Multi-Agent Engine for Automated RTL Code Generation10 Dec 2024
- 2024MaCTG: Multi-Agent Collaborative Thought Graph for Automatic Programming25 Oct 2024
- 2024Think Thrice Before You Act: Progressive Thought Refinement in Large Language Models17 Oct 2024
- 2024A Human-Like Reasoning Framework for Multi-Phases Planning Task with Large Language Models28 May 2024
- 2024Can Github issues be solved with Tree Of Thoughts?20 May 2024
- 2025Chain-of-Agents: End-to-End Agent Foundation Models via Multi-Agent Distillation and Agentic RLcited by 75
- 2025Do as We Do, Not as You Think: the Conformity of Large Language Modelscited by 48
- 2025Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMscited by 47
- 2025ReasonMed: A 370K Multi-Agent Generated Dataset for Advancing Medical Reasoningcited by 26
- 2025LLM-based Agentic Reasoning Frameworks: A Survey from Methods to Scenarioscited by 25
- 2024A Human-Like Reasoning Framework for Multi-Phases Planning Task with Large Language Modelscited by 12
- 2025HoarePrompt: Structural Reasoning About Program Correctness in Natural Languagecited by 7
- 2025Pragmatic Reasoning improves LLM Code Generationcited by 6
- 2024Think Thrice Before You Act: Progressive Thought Refinement in Large Language Modelscited by 5
- 2026RepoReasoner: Evaluating Repository-Level Code Reasoning Ability of Long-Context Language Modelscited by 5
- 2025MAPLE: Multi-Agent Adaptive Planning with Long-Term Memory for Table Reasoningcited by 4
- 2024Can Github issues be solved with Tree Of Thoughts?cited by 3
12 most cited of 20 All 20 (JSON)
- 2026TDD-Agent: Test-Driven Reasoning for Code Generation17 Aug 2026
- 2026RepoReasoner: Evaluating Repository-Level Code Reasoning Ability of Long-Context Language Models28 Jul 2026
- 2026Selective Left-Shift: Turning Test-Time Compute and Difficulty-based Curation into Training Data for Low-Resource Code Generation8 Jul 2026
- 2026DIANOIA: Diagnostic Decomposition and Joint Optimization for Multi-Agent Reasoning9 Feb 2026
- 2025Reasoning Distillation and Structural Alignment for Improved Code Generation20 Oct 2025
- 2025LLM-based Agentic Reasoning Frameworks: A Survey from Methods to Scenarios25 Aug 2025
- 2025AgentCDM: Enhancing Multi-Agent Collaborative Decision-Making via ACH-Inspired Structured Reasoning16 Aug 2025
- 2025Chain-of-Agents: End-to-End Agent Foundation Models via Multi-Agent Distillation and Agentic RL6 Aug 2025
- 2025ReasonMed: A 370K Multi-Agent Generated Dataset for Advancing Medical Reasoning11 Jun 2025
- 2025MAPLE: Multi-Agent Adaptive Planning with Long-Term Memory for Table Reasoning6 Jun 2025
- 2025HoarePrompt: Structural Reasoning About Program Correctness in Natural Language25 Mar 2025
- 2025Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMs26 Feb 2025
12 newest of 20 All 20 (JSON)
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systemscited by 125
- 2026Code as Agent Harnesscited by 40
- 2024MAGE: A Multi-Agent Engine for Automated RTL Code Generationcited by 31
- 2025LoCoBench-Agent: An Interactive Benchmark for LLM Agents in Long-Context Software Engineeringcited by 16
- 2025SOP-Agent: Empower General Purpose AI Agent with Domain-Specific SOPscited by 11
- 2025SyncMind: Measuring Agent Out-of-Sync Recovery in Collaborative Software Engineeringcited by 8
- 2025Lessons Learned: A Multi-Agent Framework for Code LLMs to Learn and Improvecited by 0
- 2025SOCIA-Nabla: Textual Gradient Meets Multi-Agent Orchestration for Automated Simulator Generationcited by 0
- 2026Code as Agent Harness18 May 2026
- 2025LoCoBench-Agent: An Interactive Benchmark for LLM Agents in Long-Context Software Engineering17 Nov 2025
- 2025SOCIA-Nabla: Textual Gradient Meets Multi-Agent Orchestration for Automated Simulator Generation21 Oct 2025
- 2025Lessons Learned: A Multi-Agent Framework for Code LLMs to Learn and Improve29 May 2025
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systems31 Mar 2025
- 2025SyncMind: Measuring Agent Out-of-Sync Recovery in Collaborative Software Engineering10 Feb 2025
- 2025SOP-Agent: Empower General Purpose AI Agent with Domain-Specific SOPs16 Jan 2025
- 2024MAGE: A Multi-Agent Engine for Automated RTL Code Generation10 Dec 2024
Similar, not cited
Close in wording, no citation either way
- 2025CodeCoR: An LLM-Based Self-Reflective Multi-Agent Framework for Code Generation
- 2024MapCoder: Multi-Agent Code Generation for Competitive Problem Solving
- 2025AdaCoder: An Adaptive Planning and Multi-Agent Framework for Function-Level Code Generation
- 2026LLM-Based Multi-Agent Systems for Code Generation: A Multi-Vocal Literature Review
- 2025A Survey on Code Generation with LLM-based Agents
- 2024CodeAgent: Enhancing Code Generation with Tool-Integrated Agent Systems for Real-World Repo-level Coding Challenges
- 2024Self-Organized Agents: A LLM Multi-Agent Framework toward Ultra Large-Scale Code Generation and Optimization
- 2025CodeVisionary: An Agent-based Framework for Evaluating Large Language Models in Code Generation