TL;DR
Multi-agent LLM systems promise to accelerate complex tasks like software engineering through parallelization, but naive task distribution often leads to massive communication overhead and broken code interfaces. This paper introduces Co-Coder, a framework that treats repository-level multi-agent orchestration as a classic distributed computing graph-partitioning problem. By balancing parallel computation against context-transfer costs, Co-Coder achieves up to a 2.10× wall-clock speedup, reduces API costs by up to 35%, and improves code pass rates by up to 14.0% over sequential baselines.
What Problem Does This Paper Address?
When tackling large-scale software engineering tasks, deploying multiple LLM agents in parallel seems like an obvious win for throughput and latency. However, in practice, adding more agents often degrades performance and skyrockets costs.
The root cause is the communication-to-computation trade-off, a fundamental principle in distributed computing. In a repository-level coding task, files heavily depend on one another via imports and function calls. If interdependent files are assigned to different agents, those agents must constantly exchange context tokens to stay synchronized. Naive parallelization (such as assigning one agent per file) causes agents to generate conflicting interfaces, leading to expensive, unproductive repair loops and broken code quality. The authors set out to formalize and solve this structural bottleneck.
Methods
The authors introduce Co-Coder (Cohesion-aware Coder), an orchestration framework that models a coding project as a weighted dependency graph and optimizes task partitioning.
The Co-Coder pipeline consists of three main stages:
- Graph Construction: Co-Coder prompts an LLM to generate a Repository Interface Blueprint (RIB), mapping out file-level dependencies and defined symbols. It computes edge weights based on symbol sharing (e.g., if file A defines a symbol that file B uses, the coupling weight is high).
- Cohesion-Based Graph Partitioning:
- Structural Hub Isolation: Code graphs are highly heterogeneous. Co-Coder identifies and isolates "in-hubs" (widely used utilities/constants) and "out-hubs" (top-level aggregators) so they don't pollute the modular structure of the remaining graph.
- Community Detection: The remaining graph is partitioned using the Infomap algorithm, which simulates random walks to find highly cohesive clusters, minimizing cross-agent communication.
- Latent Parallelism Exploitation: A post-processing step "lifts" independent leaf files into singletons if doing so shortens the critical path without excessively increasing communication costs.
- Dependency-Aware Parallel Execution: Instead of using rigid synchronization barriers, Co-Coder uses a shared task list and a greedy list-scheduling policy. Agents execute tasks the moment their upstream dependencies are completed, ensuring they build upon actual generated interfaces rather than speculative placeholders.
Datasets
Co-Coder was evaluated across 28 real-world tasks from two repository-level code generation benchmarks:
- DevEval: A benchmark consisting of compact, self-contained repositories (averaging 3.1 files and 243 lines of code).
- CodeProjectEval: A more challenging benchmark curated from real-world open-source libraries (averaging 11.9 files and 2,371 lines of code), featuring dense cross-file dependencies and large integration surfaces.
Key Insights and Ideas
- Multi-Agent Orchestration is a Graph Problem: The bottleneck in multi-agent LLM systems isn't just agent capability; it's structural coordination. Applying classical distributed systems theory to LLM context windows provides a mathematically grounded way to optimize agent workloads.
- The Danger of Aggressive Concurrency: Baselines like Claude Code with Agent Teams achieve fast wall-clock times by aggressively distributing tasks, but they suffer from low pass rates because agents lack the concrete context of upstream implementations.
- Code Heterogeneity Matters: Generic graph clustering algorithms fail on codebases because a few utility files connect to everything. Isolating these structural hubs first is essential to uncovering the true modular "communities" within a repository.
Key Results
Co-Coder consistently advanced the Pareto frontier across pass rate, latency, and cost on both benchmarks.
- On DevEval: Co-Coder lifted the average pass rate to 68.1% (up from 56.8% sequential), while delivering a 1.81× speedup and a 28% cost reduction.
- On CodeProjectEval: The gains widened significantly due to the denser dependency structures. Co-Coder achieved a 34.1% pass rate (a 14.0% absolute increase over sequential), a 2.10× speedup, and a 35% cost reduction.
- Vs. Commercial Baselines: While Claude Code with Agent Teams achieved high speedups, its pass rate dropped to 16.3% on CodeProjectEval due to uncoordinated generation. Co-Coder successfully maintained interface consistency, proving that cohesion-aware orchestration preserves correctness while exploiting parallelism.
Limitations and Future Work
The authors note two primary limitations:
- High Coupling Degradation: If a project exhibits near-complete coupling (where almost every file depends on every other file), Co-Coder's partitioning algorithm naturally collapses the tasks into a single group, degrading performance back to sequential execution.
- Language Scope: The current evaluation is strictly limited to Python repositories. It remains an open question how these insights transfer to statically typed languages (like Rust or Java) that provide richer compiler feedback during the generation and repair loops.
Summary updated