MARS: Multi-Specialist LLM Relay System for Competitive Programming
cs.AI, cs.MA, cs.PL
Submitted: 2026-08-24
Updated: 2026-08-24
Comments: 13 pages, 8 figures, EMNLP 2026
Code: https://github.com/fckand/mars
License: http://creativecommons.org/licenses/by/4.0/
The gist: Large Language Models excel at code generation, yet competitive programming exposes a persistent failure mode: existing multi-agent pipelines distribute work over generic planner, coder, and debugger
Terminology
Abstract
Large Language Models excel at code generation, yet competitive programming exposes a persistent failure mode: existing multi-agent pipelines distribute work over generic planner, coder, and debugger roles and delegate the choice of algorithmic technique to the backbone alone. We present MARS (Multi-Agent Relay of Specialized LLMs), a prompt-only framework in which each agent is a topic specialist---dynamic programming, graphs, strings, geometry, and so on---grounded by retrieval-augmented generation over an algorithm-theory corpus. Given a problem, retrieval selects a small team of relevant specialists; a starter writes an initial C++17 solution, and each subsequent turn runs the candidate against public examples in a sandbox, lets the active specialist keep, repair, or hand off the draft, and forwards a structured packet to the next specialist. A single infrastructure-fixer pass normalizes boilerplate at the end. On the CodeContests test split with Gemma 4, MARS reaches 0.624 plus or minus 0.006 pass rate at 2.3 recorded pipeline stages per task (+14.4 percentage points over direct prompting), closing most of the gap to CodeSIM (0.731) at 3.3 times lower wall-clock cost and substantially smaller variance in per-task token spend. The source code is available on GitHub: https://github.com/fckand/mars.
Sources
- AutoAgents: A Framework for Automatic Agent Generation
- Evaluating Large Language Models Trained on Code
- A Survey on LLM-based Multi-Agent System: Recent Advances and New Frontiers in Application
- xCodeEval: A Large Scale Multilingual Multitask Benchmark for Code Understanding, Generation, Translation and Retrieval
- AgentVerse: Facilitating Multi-Agent Collaboration and Exploring Emergent Behaviors
- MACM: Utilizing a Multi-Agent System for Condition Mining in Solving Complex Mathematical Problems
- Teaching Large Language Models to Self-Debug
- CAMEL: Communicative Agents for "Mind" Exploration of Large Language Model Society
- Solvita: Enhancing Large Language Models for Competitive Programming via Agentic Evolution
- Large Language Model based Multi-Agents: A Survey of Progress and Challenges
- Xolver: Multi-Agent Reasoning with Holistic Experience Learning Just Like an Olympiad Team
- AgentCoder: Multi-Agent-based Code Generation with Iterative Testing and Optimisation
- A Dynamic LLM-Powered Agent Network for Task-Oriented Agent Collaboration
- Self-Refine: Iterative Refinement with Self-Feedback
- Can Language Models Solve Olympiad Programming?
- Reflexion: Language Agents with Verbal Reinforcement Learning
- MedAgents: Large Language Models as Collaborators for Zero-shot Medical Reasoning
- Multi-Agent Collaboration Mechanisms: A Survey of LLMs
- DocPrompting: Generating Code by Retrieving the Docs
- Mixture-of-Agents Enhances Large Language Model Capabilities
Related papers
- MAVEN-T: Reinforced Heterogeneous Distillation for Real-Time Multi-Agent Trajectory Prediction
- Model Discovery Agent: LLM-assisted Bayesian experiment design for data-efficient discovery of mechanistic world models
- Agents' Last Exam
- The Clinician's Veto: Navigating Trust, Liability, and Uncertainty in Autonomous AI Prescribing
- MindHelper: Closed-Loop Embodied Mental-State Reasoning for Precision Intervention
- Incumbent Advantage: Brand Bias and Cognitive Manipulation Dynamics in LLM Recommendation Systems