Papers
Topics
Authors
Recent
Search
2000 character limit reached

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

Published 31 May 2026 in cs.LG and cs.MA | (2606.00953v1)

Abstract: Multi-agent 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.

Summary

  • The paper introduces a dependency graph model to partition file-level tasks, reducing inter-agent communication costs and improving cohesion.
  • Empirical results show up to a 14% increase in unit test pass rates, coupled with reduced latency and API costs compared to baseline methods.
  • The Co-Coder framework leverages hub isolation, Infomap-based community detection, and event-driven scheduling to optimize parallel code generation.

Cohesion-Aware Orchestration for Multi-Agent Code Generation: Analysis of Co-Coder

Motivation and Problem Formalization

As LLM-based agentic coding frameworks scale to handle repository-level software engineering, naive parallelization delivers non-monotonic returns. The core difficulty derives from the communication-to-computation trade-off: while sharding tasks among multiple agents can theoretically reduce wall-clock latency and improve resource utilization, inter-agent context transfer incurs substantial overhead, and cross-partition dependencies often undermine interface consistency and overall code quality. The paper proposes to formalize this dilemma rigorously by representing the composite code generation task as a weighted dependency graph, where vertices encode file-level workloads and edges encode coupling costs reflecting the context transfer incurred by allocating dependent files to separate agents.

The Co-Coder Framework

The Co-Coder orchestrator is instantiated as a cohesive multi-stage pipeline (Figure 1). It parses repository specifications into a Repository Interface Blueprint (RIB) capturing all relevant symbols, imports, and interface types. The resulting structure seeds a weighted, directed dependency graph, with computation and communication costs assigned to vertices and edges respectively. Figure 1

Figure 1: High-level architecture of Co-Coder: parsing input specs to a blueprint, creation and partitioning of the dependency graph, and dependency-aware parallel execution by agents.

Central to Co-Coder is the recognition of repository structure: rather than performing naive file-based partitioning (which ignores inter-file dependencies), the method first isolates structural hubs (high-degree utility and integration files), which are recurrent serialization bottlenecks in heterogeneous software graphs. Community detection via Infomap then yields high-cohesion clusters, minimizing cut edges (and thus communication cost) while maximizing intra-group coupling. To further reduce the critical path, singleton clusters are created for leaf files whenever their cut cost is dominated by the computation cost.

Scheduling is dependency-aware and event-driven: agents are released as soon as their upstream dependencies become available, avoiding global synchronization barriers that erode parallelism in conventional layered deployments. After the initial coding phase, failures are localized by partition and repairs dispatched agent-wise, minimizing unnecessary context bloat.

Empirical Results: Strong Quantitative Evidence

Extensive experiments are conducted on DevEval and CodeProjectEval, two repo-level, unit test-driven benchmarks of varying complexity and dependency density. Three baselines are compared: sequential (monolithic agent), naive file-parallel (one agent per file), and Claude Code with Agent Teams.

Across 28 real-world projects, Co-Coder consistently advances the Pareto frontier in code quality (unit test pass rate), wall-clock latency, and API usage cost:

  • On DevEval: Pass rate increased by 11.3% (from 56.8% to 68.1%) versus sequential, with a 45% latency reduction and 28% API cost reduction.
  • On CodeProjectEval: Most notably, Co-Coder achieves a 14.0% absolute increase in pass rate (from 20.1% to 34.1%), a 2.1×2.1\times speedup, and 35% API cost reduction, outperforming both file-based parallel and commercial agent-team methods, with gains amplified in projects exhibiting high cross-file dependency density.

In contrast, naive file-based parallelism suffers inefficient redundancy and communication bottlenecks, frequently incurring higher cost with meager quality improvements. Commercial agent orchestration (Claude Code) achieves lower latency but at the expense of severe accuracy degradation.

Theoretical Implications

The formalization of the agent orchestration as a weighted graph partitioning task reframes the multi-agent LLM system design problem. Previous approaches either optimized for role-specialization or focused on runtime communication protocols, neglecting the underlying workload structure. By integrating classic distributed systems theory (minimization of critical path plus weighted cut cost), Co-Coder presents a blueprint for principled, efficient system design.

The Infomap-based community detection method directly models inter-agent information flow rather than relying on ad hoc heuristics. Hub isolation and latent parallelism exploitation are justified by dependency graph topology and by aligning the communication-computation curve to project-specific structure.

Practical Implications and Limitations

In practical deployment, the improvement in cost and correctness is particularly salient for large, tightly coupled repositories. For cases with low coupling density, Co-Coder reduces to trivial single-agent execution, matching sequential baselines. The main bottleneck emerges when nearly every file depends on every other, in which case no partitioning can effectively expose parallelism.

While the system is validated on Python repositories, the methodology is extensible to statically-typed languages, provided accurate interface extraction and dependency graph construction is possible. There is, however, limited evidence to date regarding performance in languages with richer type systems and compiler feedback loops.

Future Directions

This work suggests a broader architectural principle for LLM-based multi-agent systems: orchestration must be structure-aware, with task partitioning jointly optimized with dependency-respecting scheduling. Open research directions include adaptive graph construction in the presence of incomplete or ambiguous specification, dynamic agent allocation, and robustification against error cascades in the presence of runtime agent failures.

It is also natural to extend this paradigm to other domains where composite tasks can be statically analyzed to expose latent structure, including complex decision-making, multi-document generation, and compositional planning.

Conclusion

The Co-Coder framework demonstrates that the quality and efficiency of multi-agent LLM systems hinge on structure-aware, cohesion-driven orchestration. By casting agent allocation as joint minimization of critical-path workload and cross-agent communication, and operationalizing this via dependency graph partitioning and informed scheduling, the method achieves simultaneous gains in code correctness, latency, and resource economy. The approach underlines the principle that scalable AI systems must embed workload structure directly into orchestration, presaging more sophisticated, theory-driven multi-agent frameworks for software engineering and beyond.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.