Multi-agent Large Language Model (LLM) systems offer a way to decompose complex tasks, such as coding, through parallelization and context isolation. However, adding agents in practice introduces inter-agent communication overhead, which incurs extra cost and can sometimes offset the efficiency gains. We formalize multi-agent orchestration as a graph partitioning problem that captures the communication-to-computation trade-off: task decomposition can shorten critical-path computation, but cross-agent dependencies require costly context transfer. We instantiate this view in repository-level software engineering and present Cohesion-aware Coder (Co-Coder), which builds dependency graphs from static analysis, isolates structural hub files, partitions the graph via community detection, and executes the partition with a dependency-aware scheduler. Across 28 real-world tasks on DevEval and CodeProjectEval, Co-Coder advances the Pareto-frontier over sequential and file-based parallel baselines as well as Claude Code with Agent Teams, lifting pass rate by up to 14.0%, achieving up to a 2.10x wall-clock speedup, and reducing API cost by up to 35%, with the largest gains on the most dependency-dense projects. Co-coder demonstrates how cohesion-aware orchestration can make parallel coding agents both theoretically grounded and practically efficient, suggesting a broader design principle for multi-agent systems.
翻译:多智能体大语言模型系统通过并行化和上下文隔离为分解复杂任务(如编程)提供了途径。然而,在实践中增加智能体会引入智能体间通信开销,这会产生额外成本,有时甚至会抵消效率提升。本文将多智能体编排形式化为一个图划分问题,该问题捕捉了通信与计算之间的权衡:任务分解可以缩短关键路径计算,但跨智能体依赖关系需要代价高昂的上下文传递。我们将这一观点实例化到仓库级软件工程中,并提出了凝聚感知编码器(Co-Coder),它从静态分析中构建依赖图,隔离结构枢纽文件,通过社区检测划分图,并使用依赖感知调度器执行划分。在 DevEval 和 CodeProjectEval 的 28 个实际任务中,Co-Coder 推进了相较于顺序和基于文件的并行基线以及使用智能体团队的 Claude Code 的帕累托前沿,通过率最高提升了 14.0%,实际时间加速比最高达到 2.10 倍,API 成本最高降低了 35%,且在依赖最密集的项目上收益最大。Co-Coder 展示了凝聚感知编排如何使并行编程智能体既具备理论根基又具有实践效率,为多智能体系统提出了更广泛的设计原则。