MARS System Boosts LLM Competitive Programming Performance

Andrei Mikhailov, Mikhail Burtsev, Alsu Sagirova· August 26, 2026 View original

Key takeaways

  • MARS uses specialized LLM agents in a relay system to solve competitive programming problems.
  • Each agent is a topic expert, augmented by retrieval from an algorithm corpus.
  • This approach significantly improves solution pass rates and efficiency.
  • Specialized, collaborative agents outperform generic multi-agent systems for complex tasks.

Who benefits

Software DevelopmentAI/ML EngineeringEducation (coding)Research & Development

Summary

MARS (Multi-Agent Relay of Specialized LLMs) is a prompt-only framework that uses a team of topic-specialist LLM agents to solve competitive programming problems. It significantly improves pass rates compared to direct prompting by distributing work among specialists and using retrieval-augmented generation.

Large Language Models often struggle with the nuanced challenges of competitive programming, particularly when existing multi-agent systems rely on generic roles like planner or coder. MARS introduces a novel approach by creating a relay system of highly specialized LLM agents. Each agent focuses on a specific algorithmic domain, such as dynamic programming or graph theory, and is enhanced by retrieval-augmented generation from an algorithm theory corpus. When presented with a problem, MARS selects a relevant team of specialists. A "starter" agent provides an initial solution, which is then iteratively refined by the active specialist. The solution is tested in a sandbox, and specialists can repair, keep, or hand off the draft to another specialist. This structured, collaborative approach significantly boosts the pass rate on competitive programming benchmarks, closing the gap with more expensive methods while being more cost-effective.

Why it matters

This demonstrates a powerful new paradigm for complex problem-solving with LLMs, moving beyond generic agents to specialized, collaborative systems, which could be applied to various technical domains beyond programming.

How to implement this in your domain

  1. 1Identify complex problem domains in your work that could benefit from specialized AI agents.
  2. 2Define distinct areas of expertise for potential LLM specialists within your domain.
  3. 3Curate a knowledge base or corpus for each specialist to enable retrieval-augmented generation.
  4. 4Design a relay or hand-off mechanism for agents to collaborate and refine solutions iteratively.
  5. 5Implement a sandbox environment for testing and validating intermediate solutions generated by agents.

Original post by Andrei Mikhailov, Mikhail Burtsev, Alsu Sagirova

"arXiv:2608.23918v1 Announce Type: new 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…"

View on X

Originally posted by Andrei Mikhailov, Mikhail Burtsev, Alsu Sagirova on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses