跳转至

文章背景与核心概要

大语言模型(LLM)在处理复杂的竞技编程任务时往往表现受限,传统的通用规划器、代码编写器和调试器角色难以应对深度算法挑战。为此,本文推出了 MARS(多专业大模型多智能体接力,Multi-Agent Relay of Specialized LLMs)框架。该框架摒弃了通用的多智能体分工,转而部署通过算法理论语料库进行检索增强生成(RAG)的领域特定主题专家(如动态规划、图论、几何、字符串等)。

MARS 采用基于接力的流水线机制,由动态选出的专家团队协同解决问题:首发模型生成初始 C++17 解决方案,随后在沙箱中进行迭代测试、修复,或通过结构化数据包在专家之间进行任务交接,最终通过基础设施修复通道规范化模板代码。在 CodeContests 测试集上基于 Gemma 4 的评估表明,MARS 取得了 \(0.624 \pm 0.006\) 的通过率,相比直接提示词提升了 14.4 个百分点,在大幅缩小与 CodeSIM(\(0.731\))性能差距的同时,实现了低 3.3 倍的实际运行成本以及更低的每任务 Token 方差。


MARS: Multi-Specialist LLM Relay System for Competitive Programming

Summary

MARS (Multi-Agent Relay of Specialized LLMs) is a novel prompt-only framework designed to address the limitations of Large Language Models (LLMs) in competitive programming. Instead of relying on generic planner, coder, and debugger roles, MARS deploys domain-specific topic specialists (e.g., dynamic programming, graph theory, geometry, strings) grounded by retrieval-augmented generation (RAG) over an algorithm-theory corpus.

Using a relay-based pipeline, problems are solved by dynamically selected specialist teams. A starter generates an initial C++17 solution, which is iteratively tested in a sandbox, repaired, or handed off via structured packets between specialists. A final infrastructure-fixer pass then normalizes the boilerplate code.

Evaluated on the CodeContests test split using Gemma 4, MARS achieves a \(0.624 \pm 0.006\) pass rate (\(+14.4\) percentage points over direct prompting), closing most of the performance gap with CodeSIM (\(0.731\)) at \(3.3\times\) lower wall-clock cost and lower per-task token variance.


论文元数据

  • arXiv ID: arXiv:2608.23918 [cs.AI]
  • 作者: Andrei Mikhailov, Mikhail Burtsev, Alsu Sagirova
  • 主学科: 人工智能 (cs.AI)
  • 次学科: 多智能体系统 (cs.MA)、编程语言 (cs.PL)
  • 会议/活动: EMNLP 2026(13页,8幅图)
  • 提交日期: 2026年8月24日
  • DOI: 10.48550/arXiv.2608.23918

Paper Metadata

  • arXiv ID: arXiv:2608.23918 [cs.AI]
  • Authors: Andrei Mikhailov, Mikhail Burtsev, Alsu Sagirova
  • Primary Subject: Artificial Intelligence (cs.AI)
  • Secondary Subjects: Multiagent Systems (cs.MA), Programming Languages (cs.PL)
  • Conference/Event: EMNLP 2026 (13 pages, 8 figures)
  • Submitted Date: August 24, 2026
  • DOI: 10.48550/arXiv.2608.23918

核心特性与架构

  • 主题专业化智能体: 用量身定制、专攻特定算法领域(图论、动态规划、字符串等)的专家替代通用角色。
  • 检索增强生成(RAG): 利用算法理论语料库为每个专家提供基础知识支撑。
  • 接力流水线机制:
  • 通过检索为具体问题挑选专业专家团队。
  • 启动模型编写初始 C++17 解决方案。
  • 在安全沙箱中针对公开示例对候选代码进行持续测试。
  • 活跃的专家通过结构化数据包保持、修复或交接代码。
  • 流水线末端包含一个基础设施修复通道,用于清理样板代码。

Key Features & Architecture

  • Topic-Specialized Agents: Replaces generic roles with experts tailored to specific algorithmic domains (graphs, dynamic programming, strings, etc.).
  • Retrieval-Augmented Generation (RAG): Grounds each specialist using an algorithm-theory corpus.
  • Relay Pipeline Mechanism:
  • Retrieval selects a specialized team for the specific problem.
  • A starter model writes an initial C++17 solution.
  • Candidates are continuously tested against public examples inside a secure sandbox.
  • Active specialists keep, repair, or hand off code through structured packets.
  • An infrastructure-fixer pass cleans up boilerplate code at the end of the pipeline.

资源与链接