NeurIPS 2026Coming to NeurIPS in Sydney?Explore papers, orals & directions

MapCoder-Lite: Squeezing Multi-Agent Coding into a Single Small LLM

Woongkyu Lee, Junhee Cho, Jungwook ChoiarXiv 2025 · DOI

Abstract

Multi-agent frameworks have significantly advanced competitive programming by decomposing complex tasks into specialized roles. However, these systems typically rely on large-scale models (30B+ parameters) to maintain reasoning depth and format adherence. This paper introduces MapCoder-Lite, a framework that distills multi-agent reasoning into a single 7B-parameter model. By employing pass-based trajectory distillation, supervisor-guided correction, and agent-wise LoRA specialization, MapCoder-Lite achieves performance comparable to much larger models while reducing memory and latency by 4x. On the xCodeEval benchmark, the model's accuracy improved from 13.2% to 28.3%, demonstrating the viability of sophisticated multi-agent workflows in resource-constrained environments.

Introduction

Competitive programming requires deep algorithmic knowledge and the ability to handle complex edge cases, tasks where standard Large Language Models (LLMs) often struggle with single-prompt approaches. Multi-agent systems, such as the original MapCoder, address this by utilizing a pipeline of specialized agents: a Retriever for algorithms, a Planner for logic, a Coder for implementation, and a Debugger for error correction.

Despite their effectiveness, Small Language Models (SLMs) often fail within these pipelines due to "format fragility"—an inability to follow strict schemas—and "reasoning collapse," where they lose the global context necessary for multi-step problem-solving. MapCoder-Lite addresses these challenges by distilling the reasoning of high-capacity models into an efficient 7B-parameter backbone.

The MapCoder pipeline: a multi-agent workflow for competitive programming.

Methodology

The MapCoder-Lite framework rests on three primary pillars designed to bridge the capacity gap between small and large models:

  1. Pass-Based Trajectory Distillation: Rather than training on all outputs from a teacher model (e.g., DeepSeek-V3), the system filters for "trajectories"—the complete step-by-step reasoning across all agents—that successfully pass all unit tests. This ensures the 7B model learns only valid reasoning paths.
  2. Supervisor-Guided Correction: When the 7B model fails during data collection, a high-capacity "Supervisor" model analyzes the failure, identifies the responsible agent (e.g., a missing edge case in the Planning stage), and provides targeted feedback for regeneration. This creates a high-quality dataset of the small model learning to correct its own mistakes.
  3. Agent-Wise LoRA Specialization: To maintain efficiency, a single frozen Qwen2.5-7B backbone is used. Four independent Low-Rank Adaptation (LoRA) adapters (rank-32) are trained, each specializing in one of the four roles: Retrieval, Planning, Coding, and Debugging. This modular approach adds less than 3% parameter overhead while allowing the model to switch roles seamlessly.
Pass-based trajectory distillation and supervisor-guided data collection.

Experimental Setup

The model was evaluated on rigorous competitive programming benchmarks, including xCodeEval, APPS, and CodeContests. Additionally, general coding benchmarks like HumanEval and MBPP were used to assess generalization to simpler function-level tasks.

Results and Discussion

MapCoder-Lite demonstrated significant performance gains across all metrics:

  • Accuracy: On xCodeEval, accuracy increased from 13.2% to 28.3%, outperforming Qwen-14B and approaching 32B model performance.
  • Format Adherence: Fine-tuning eliminated 100% of XML schema errors, proving that SLMs can be trained to follow strict interaction protocols.
  • Efficiency: The 7B model achieved a 4x reduction in GPU memory usage and token generation latency compared to 32B alternatives.
  • Generalization: A 10% improvement on HumanEval suggests that multi-agent distillation enhances core coding logic beyond specific competitive programming patterns.

The use of LoRA proved particularly effective, acting as a regularizer that preserved general reasoning while providing modular control, outperforming full fine-tuning which often led to overfitting on superficial patterns.

Conclusion

MapCoder-Lite successfully demonstrates that complex multi-agent reasoning can be compressed into a single small LLM without substantial performance loss. While a capacity gap remains for the most extreme algorithmic challenges, this work paves the way for sophisticated, on-device AI coding assistants. Future research will explore adaptive tuning methods to dynamically adjust model capacity based on problem difficulty.

Summary updated

Abstract

Large language models (LLMs) have advanced code generation from single-function tasks to competitive-programming problems, but existing multi-agent solutions either rely on costly large-scale (>30B) models or collapse when downsized to small open-source models. We present MapCoder-Lite, a framework for distilling the complex reasoning of large, multi-agent coding systems into a single 7B model. Our contribution is a novel, three-pillar methodology that synergistically generates, refines, and encodes multi-agent knowledge: (i) pass-based trajectory distillation from strong LLMs fixes format fragility in retrieval and reduces failures in debugging, (ii) supervisor-guided correction with global feedback strengthens planning and coding agents, and (iii) agent-wise LoRA fine-tuning delivers memory-efficient specialisation. Comprehensive evaluation on xCodeEval, APPS, and CodeContests shows that MapCoder-Lite more than doubles xCodeEval accuracy (from 13.2% to 28.3%), eliminates all format failures, while reducing GPU memory and token-generation time by 4x compared to a 32B model. It also achieves over 10% gains on simpler coding benchmarks, demonstrating broad improvements beyond competitive programming. These results demonstrate that careful agent-wise fine-tuning unleashes high-quality multi-agent coding on a small language model. Our code is publicly available at https://github.com/aiha-lab/MapCoder-Lite.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
xCodeEvalMapCoder (Qwen7B)Pass@1 accuracy13.21%Code Translation
Source quote
L211: Qwen7B │ 13.21 │ 6.00 │ 6.06 │ 15.26 │ 12.29
APPSMapCoder (Qwen7B)Pass@1 accuracy6.00%Code Generation · split: test
Source quote
L211: Qwen7B │ 13.21 │ 6.00 │ 6.06 │ 15.26 │ 12.29
CodeContestsMapCoder (Qwen7B)Pass@1 accuracy6.06%Code Generation · split: test
Source quote
L211: Qwen7B │ 13.21 │ 6.00 │ 6.06 │ 15.26 │ 12.29
BibTeX
@misc{lee2025mapcoder,
  author = {Woongkyu Lee and Junhee Cho and Jungwook Choi},
  title = {{MapCoder-Lite: Squeezing Multi-Agent Coding into a Single Small LLM}},
  year = {2025},
  eprint = {2509.17489},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.17489},
}
Figure