Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

MapCoder: Multi-Agent Code Generation for Competitive Problem Solving

About

Code synthesis, which requires a deep understanding of complex natural language problem descriptions, generation of code instructions for complex algorithms and data structures, and the successful execution of comprehensive unit tests, presents a significant challenge. While large language models (LLMs) demonstrate impressive proficiency in natural language processing, their performance in code generation tasks remains limited. In this paper, we introduce a new approach to code generation tasks leveraging multi-agent prompting that uniquely replicates the full cycle of program synthesis as observed in human developers. Our framework, MapCoder, consists of four LLM agents specifically designed to emulate the stages of this cycle: recalling relevant examples, planning, code generation, and debugging. After conducting thorough experiments, with multiple LLM ablations and analyses across eight challenging competitive problem-solving and program synthesis benchmarks, MapCoder showcases remarkable code generation capabilities, achieving new state-of-the-art results (pass@1) on HumanEval (93.9%), MBPP (83.1%), APPS (22.0%), CodeContests (28.5%), and xCodeEval (45.3%). Moreover, our method consistently delivers superior performance across various programming languages and varying problem difficulties. We open-source our framework at https://github.com/Md-Ashraful-Pramanik/MapCoder.

Md. Ashraful Islam, Mohammed Eunus Ali, Md Rizwan Parvez• 2024

Related benchmarks

TaskDatasetResultRank
Code GenerationHumanEval
Pass@193.9
850
Mathematical ReasoningGSM8K (test)
Accuracy85.8
797
Code GenerationHumanEval (test)
Pass@196.4
444
Code GenerationMBPP (test)
Pass@194.1
276
Mathematical ReasoningAIME 2025
Accuracy80
227
Code GenerationMBPP
Accuracy87.2
90
Code GeneratingMBPP
Pass@183.1
88
Code GenerationHumanEval+ (test)--
81
Code GenerationHumanEval-ET
Pass@182.9
75
Code GenerationMBPP-ET
Pass@157.7
75
Showing 10 of 21 rows

Other info

Code

Follow for update