MARS: 競技プログラミングのためのマルチスペシャリストLLMリレーシステム
MARS: Multi-Specialist LLM Relay System for Competitive Programming
August 24, 2026
著者: Andrei Mikhailov, Mikhail Burtsev, Alsu Sagirova
cs.AI
要旨
大規模言語モデルはコード生成に優れているが、競技プログラミングは持続的な失敗モードを露呈する。既存のマルチエージェントパイプラインは、汎用的なプランナー、コーダー、デバッガーという役割に作業を分散し、アルゴリズム手法の選択をバックボーン(基盤モデル)のみに委ねている。我々はMARS(専門化LLMのマルチエージェントリレー)を提案する。これはプロンプトのみのフレームワークであり、各エージェントは動的計画法、グラフ、文字列、幾何学などのトピック専門家であり、アルゴリズム理論コーパスに対する検索拡張生成によって基盤付けられる。問題が与えられると、検索が関連する専門家の小チームを選択する。スターターが初期のC++17解答を作成し、その後の各ターンでは、サンドボックス内で公開サンプルに対して候補を実行し、担当スペシャリストがドラフトを保持・修正・引き継ぎを行えるようにし、構造化されたパケットを次のスペシャリストに転送する。最後に、単一のインフラ修正パスがボイラープレートを正規化する。Gemma 4を使用したCodeContestsテスト分割において、MARSはタスクあたり平均2.3の記録済みパイプラインステージで0.624±0.006の合格率を達成し(直接プロンプト比+14.4パーセントポイント)、実行時間コストを3.3倍低く抑えつつ、タスクごとのトークン消費の分散を大幅に小さくして、CodeSIM(0.731)との差の大部分を埋めた。ソースコードはGitHubで公開されている: https://github.com/fckand/mars。
English
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 pm 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.