AgentConductor: Topology Evolution for Multi-Agent Competition-Level Code Generation
Abstract
Large language model(LLM)-driven multi-agent systems(MAS) coordinate specialized agents through predefined topologies and show promise for complex tasks such as competition-level code generation. Recent studies demonstrate that carefully designed multi-agent workflows and communication graphs can significantly improve code generation performance by leveraging collaborative reasoning. However, existing methods neither adapt topology density to task difficulty nor refine the topology within an instance using execution feedback, which leads to redundant communication and performance bottlenecks. To address these issues, we propose AgentConductor: a reinforcement learning-optimized MAS with an LLM-based orchestrator agent as its core, which enables end-to-end feedback-driven dynamic generation of interaction topologies. For each query, AgentConductor infers agent roles and task difficulty, then constructs a task-adapted, density-aware layered directed acyclic graph(DAG) topology, underpinned by two key innovations. First, we design a novel topology density function to quantify communication-aware multi-agent interactions. Second, we adopt difficulty interval partitioning to avoid excessive pruning for precise topological density upper bound measurement per difficulty level and finer-grained control. Across five code datasets, AgentConductor outperforms the strongest baseline by up to 14.6\% in pass@1, with 13\% lower topology density and 68\% lower token cost.
Lay Summary
Many difficult programming problems cannot be solved well by a single AI model, so researchers often let multiple AI agents work together like a team. However, most existing teams use a fixed communication pattern, even though easy and hard problems need different levels of collaboration. This can waste computation on simple problems and still fail to provide enough coordination for harder ones. We introduce AgentConductor, an AI system that acts like a conductor for a team of coding agents. For each programming problem, it estimates the difficulty, chooses suitable agent roles, and decides how the agents should communicate. If the first attempt fails, it uses feedback from code execution to revise the team structure and try again. This makes multi-agent coding systems more adaptive, accurate, and efficient. Across several coding benchmarks, AgentConductor solves more problems than previous methods while using substantially fewer tokens, showing that better coordination can improve both performance and cost.