Multi-Specialist LLM Relay System for Competitive Programming

Andrei Mikhailov, Mikhail Burtsev, Alsu Sagirova


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 ± 0.006 pass rate at 2.3 relay steps per task, +13.9pp over direct prompting, closing most of the gap to CodeSIM at 0.731 with 3.3× lower wall-clock cost and substantially smaller variance in per-task token spend.
Anthology ID:
2026.emnlp-main.1359
Volume:
Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
EMNLP
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
30995–31007
Language:
URL:
https://aclanthology.org/2026.emnlp-main.1359/
DOI:
10.18653/2026.emnlp-main.1359
Bibkey:
Cite (ACL):
Andrei Mikhailov, Mikhail Burtsev, and Alsu Sagirova. 2026. Multi-Specialist LLM Relay System for Competitive Programming. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing, pages 30995–31007, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
Multi-Specialist LLM Relay System for Competitive Programming (Mikhailov et al., EMNLP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.emnlp-main.1359.pdf