arXiv:2608.23918cs.AIcs.MA2026-08

MARS用专家型模型接力解编程题,准确率超传统方法14.4个百分点。

MARS: Multi-Specialist LLM Relay System for Competitive Programming

论文配图:MARS: Multi-Specialist LLM Relay System for Competitive Programming
图 1 · 摘自论文原文
  • 每个环节由算法领域专家负责,通过检索增强生成精准协作。
  • 在CodeContests上达0.624的通过率,每题仅需2.3个阶段。
  • 适合想提升竞赛编程准确率的研究者与开发者使用。

大型语言模型在代码生成方面表现优异,但编程竞赛中仍存在持续性失败模式:现有多智能体流水线采用通用规划、编码、调试角色分工,将算法选择任务完全交由主干模型处理。我们提出MARS(多专家智能体接力系统),一个纯提示框架,其中每个智能体为特定领域专家——动态规划、图论、字符串、几何等,基于算法理论语料库的检索增强生成进行定位。给定题目后,检索选出一组相关专家;起始者撰写初始C++17代码,后续每轮在沙箱中运行候选方案并对比公开样例,当前专家可保留、修复或移交草案,并传递结构化信息给下一专家。最后通过一次基础设施修复环节统一规范模板代码。在Gemma 4模型下,于CodeContests测试集上,MARS达到0.624±0.006的通过率,每任务仅2.3个阶段,比直接提示提升14.4个百分点,接近CodeSIM的0.731准确率,但耗时仅为后者的1/3.3,且单题令牌消耗方差显著更小。源码已开源:https://github.com/fckand/mars。

原文摘要 · Abstract (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.

编程竞赛多智能体专家系统代码生成

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。