When Parallelism Pays Off: Cohesion-Aware Task Partitioning for Multi-Agent Coding

Xu Yang, Lunyiu Nie, Ethan Chandra, Stanislav Gannutin, Fangru Lin, Swarat ChaudhuriNeurIPS 2026

TL;DR

Throwing more LLM agents at a coding project doesn’t automatically make it faster or better—just like human software teams, poorly organized agents drown in communication overhead and conflicting code. This paper treats multi-agent coding as a classic distributed computing problem, grouping tightly coupled files together so agents rarely have to interrupt each other. The resulting system, Co-Coder, writes better code up to 3.13× faster and at 42% lower cost than a single agent working alone.

What Problem Does This Paper Address?

If one LLM agent can write code, surely ten agents working in parallel can build a whole repository ten times faster, right? Surprisingly, recent attempts show the opposite: adding agents often slows things down, inflates API bills, and breaks the code.

The authors point out that this isn't a weird quirk of LLMs—it’s the communication-to-computation trade-off, a foundational rule from forty years of distributed computing. Every time Agent A works on a file that depends on Agent B’s file, they have to share context tokens. If you split tightly coupled files across different agents, those agents spend all their time waiting on peers, re-reading updated states, or hallucinating incompatible interfaces. Prior multi-agent frameworks focused on how agents talk to each other, largely ignoring the structural question of how to divide the work in the first place.

Methods

To balance parallel speed against coordination costs, the authors introduce Cohesion-aware Coder (Co-Coder), an orchestrator that plans who does what before a single line of code is written:

Figure 2: Overview of Co-Coder. The input specifications from the benchmarks are first parsed into a Repository Interface Blueprint that encodes file-level dependencies, which subsequently constructs the weighted graph. We then perform cohesion-based partitioning over the graph via structural hub isolation, community detection, and latent parallelism exploitation. Finally, on the right side, parallel coding agents execute in a dependency-aware timeline, where multiple tasks across different groups follow a lifecycle and may fire in parallel once their upstream dependencies are completed. Note that dependency arrows are reversed for illustration: arrows point from dependency to dependent, opposite to the actual dependency graph convention.
  1. Graph Construction: An LLM reads project specs (like UML diagrams and requirements) to generate a Repository Interface Blueprint—an outline of every file, the symbols (classes, functions) it defines, and what it imports. This becomes a directed graph where node weights estimate file generation time and edge weights measure how heavily two files share symbols.
  2. Cohesion-Based Partitioning: Standard graph-clustering chokes on codebases because of "hub" files. Co-Coder first isolates in-hubs (shared utilities/constants imported everywhere) into solo tasks and groups out-hubs (top-level entry points) together so they don't bottleneck everyone else. It then runs Infomap—a random-walk community detection algorithm—to cluster tightly coupled files onto the same agent. Finally, it peels off independent "leaf" files inside clusters so they can run in parallel.
  3. Dependency-Aware Execution: Instead of making all agents pause at rigid step-by-step barriers, Co-Coder uses a classic greedy list-scheduler. As soon as a file’s upstream dependencies finish, its task flips from pending to ready for its assigned agent, followed by a centralized test-and-repair loop led by a single leader agent.

Datasets

No training datasets are used. The authors evaluate from-scratch repository generation across two existing Python benchmarks (no new benchmarks are introduced):

  • DevEval (Python subset): 10 compact, self-contained projects averaging 3.1 files and 243 lines of code (LOC).
  • CodeProjectEval: 18 complex projects curated from real open-source libraries, averaging 11.9 files and 2,371 LOC with deep cross-file dependencies. (A small appendix test also checks 1 C++ and 1 Java project).

Key Insights and Ideas

  • Brooks's Law applies to AI: Naively assigning one agent per file (File-based Parallel) causes agents to invent conflicting interfaces, leading to expensive regeneration loops. Conversely, letting agents self-organize (Claude Code w/ Agent Teams) finishes quickly, but code quality tanks below that of a single sequential agent.
  • Complexity amplifies the payoff: On tiny, loosely connected projects, almost any setup works. Across CodeProjectEval, the denser a project's import graph ($|E|/|V|$), the bigger Co-Coder’s accuracy jump over sequential coding ($r = 0.65$). Keeping coupled files inside one agent's context window prevents interface mismatches before they happen.
  • Smarter base models still need structure: Upgrading from GPT-5 Mini to Claude Sonnet 4.6 makes a single sequential agent much stronger, causing uncoordinated parallel baselines to look even worse by comparison. Yet Co-Coder still beats the stronger sequential agent while stretching its speedup even further.

Key Results

Evaluated across 28 tasks using both GPT-5 Mini and Claude Sonnet 4.6, Co-Coder advances the Pareto frontier—improving test pass rates, wall-clock speed, and API cost simultaneously:

Pass rate, wall-clock speedup, and API cost across DevEval and CodeProjectEval for GPT-5 Mini and Claude Sonnet 4.6.
  • Vs. Sequential Single Agent: On CodeProjectEval, Co-Coder boosts unit test pass rates from 20.1% to 34.1% (GPT-5 Mini) and from 34.0% to 39.4% (Claude Sonnet 4.6), while running 2.10× to 3.13× faster and cutting API costs by 35% to 42%.
  • Vs. Naive File-Parallel: File-based parallelism inflates API costs by up to 60% on CodeProjectEval for minimal accuracy gains; Co-Coder beats its pass rate by up to 10.8% at less than half the cost.
  • Vs. Claude Code w/ Agent Teams: Co-Coder improves pass rates by 9.8% to 17.8% across benchmarks, while running up to 1.41× faster (on CodeProjectEval with Sonnet 4.6) and up to 22% cheaper.

Limitations and Future Work

  • Heuristic cost proxies: Node and edge weights rely on interface size and symbol overlap rather than exact runtime or token measurements, meaning the system optimizes an approximation of the true objective.
  • Pre-defined file layouts: Both benchmarks supply the target file tree upfront. While Co-Coder could theoretically sit downstream of an architecture-planning agent in open-ended tasks, that combination remains untested here.
  • Language scope & tiny repos: Main results are restricted to Python (with only two C++/Java tasks in the appendix). Furthermore, when a repository has only one or two files with no parallelizable structure (4 of the 28 tasks), Co-Coder naturally reduces to a single sequential agent.

Summary updated

Abstract

LLM-based multi-agent systems decompose complex tasks such as coding through parallelization and context isolation, yet inter-agent communication overhead can offset the efficiency gains. We formalize multi-agent orchestration as a graph partitioning problem that captures the *communication-to-computation trade-off*: task decomposition shortens critical-path computation, but cross-agent dependencies require costly context transfer. We instantiate this view in repository-level software engineering with Cohesion-aware Coder (Co-Coder), which builds dependency graphs from code architecture design, 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 with two base models, Co-Coder advances the Pareto frontier over all baselines, with up to a $3.13\times$ speedup and a 42% cost reduction over the sequential version. Against Claude Code with Agent Teams, it raises pass rate by 9.8% to 17.8% while running up to $1.41\times$ faster at up to 22% lower cost.
BibTeX
@inproceedings{yang2026when,
  author = {Xu Yang and Lunyiu Nie and Ethan Chandra and Stanislav Gannutin and Fangru Lin and Swarat Chaudhuri},
  title = {{When Parallelism Pays Off: Cohesion-Aware Task Partitioning for Multi-Agent Coding}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=wYda526jWp},
}
Figure