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.
Methodology
The MapCoder-Lite framework rests on three primary pillars designed to bridge the capacity gap between small and large models:
- 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.
- 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.
- 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.
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