MARS: 경쟁 프로그래밍을 위한 복수의 전문가 LLM 중계 시스템
MARS: Multi-Specialist LLM Relay System for Competitive Programming
August 24, 2026
저자: Andrei Mikhailov, Mikhail Burtsev, Alsu Sagirova
cs.AI
초록
대규모 언어 모델(LLM)은 코드 생성에 뛰어나지만, 경쟁적 프로그래밍에서는 지속적인 실패 모드가 드러난다. 기존의 다중 에이전트 파이프라인은 작업을 일반적인 플래너, 코더, 디버거 역할로 분배하고 알고리즘 기법 선택을 백본에만 맡긴다. 우리는 MARS(전문 LLM 다중 에이전트 릴레이, Multi-Agent Relay of Specialized LLMs)를 제시한다. 이는 각 에이전트가 동적 계획법, 그래프, 문자열, 기하 등과 같은 주제 전문가인 프롬프트 전용 프레임워크로, 알고리즘 이론 말뭉치에 대한 검색 증강 생성(retrieval-augmented generation)으로 뒷받침된다. 문제가 주어지면 검색이 관련 전문가들로 구성된 소규모 팀을 선택한다. 스타터가 초기 C++17 솔루션을 작성하고, 이후 각 턴에서는 샌드박스에서 공개 예제에 대해 후보를 실행하여 활성 전문가가 초안을 유지, 수리, 또는 인계하도록 한 뒤, 구조화된 패킷을 다음 전문가에게 전달한다. 마지막에는 단일 인프라 수정(infrastructure-fixer) 패스가 상용구(boilerplate) 코드를 정규화한다. Gemma 4를 사용한 CodeContests 테스트 분할에서 MARS는 작업당 측정된 2.3개의 파이프라인 단계에서 0.624 ± 0.006의 통과율을 달성한다(직접 프롬프팅 대비 +14.4퍼센트 포인트). 이는 3.3배 낮은 벽시계 시간(wall-clock) 비용과 작업당 토큰 사용량의 훨씬 작은 분산으로 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.