When Are Parallel Subagents Effective for Coding? An Empirical Study on Repository Construction

Summary (Overview)

  • Core question: Do parallel subagents improve coding outcomes on repository-construction tasks, and does the added cost justify the gain?
  • Key finding: On randomly drawn tasks, parallel subagents raise hidden-test pass rates by only ~1–5 percentage points while costing 2.6–3.8× more than a single agent; at equal cost, a single agent matches or beats multi-agent setups.
  • Three mechanisms identified: self-checking (how much an agent verifies before stopping), fresh context (starting with empty conversation vs. resumed session), and modularity (code divided into files/functions vs. single file).
  • Model generation effect: The gain from subagents shrinks from GPT-5.6 Sol to GPT-6.1 Sol as newer single agents self-check more and write more modular code on their own.
  • Practical recoveries: A one-sentence prompt to probe a reference program recovers most of the multi-agent gain at a fraction of the cost; chains of fresh sessions start faster than resumed sessions.

Introduction and Theoretical Foundation

Background

LLM-based coding agents have progressed from single-function implementation to multi-hour repository construction tasks. Products like Codex and Claude Code allow a main agent to delegate work to parallel subagents, multiplying cost without clear evidence of benefit.

Key Tension

Two properties make coding tasks less suited to parallelism than research or math tasks:

  1. Hard to verify: Hidden tests mean agents must decide when to stop without external feedback.
  2. Hard to decompose: Modules share state and depend on each other, making integration costly.

Software engineering experience suggests parallel work adds coordination overhead (Brooks's law: adding developers increases communication costs). Anthropic reports that token usage explains 80% of performance variance in multi-agent systems, and coding has fewer parallelizable parts than research.

Theoretical Framework

The paper organizes its study around three mechanisms (Figure 1):

  • Self-checking: How much an agent verifies its work before stopping
  • Fresh context: Whether a session starts with an empty conversation
  • Modularity: Whether code is divided into modules or kept in one file

Benchmarks

Two repository-construction benchmarks are used:

NL2RepoProgramBench
InputWritten specification (API signatures, usage examples)Documentation, example inputs, executable reference program
OutputPython packageSource code + compile.sh building to ./executable
Hidden testspytest suiteRuns built program, compares output/exit code/files
Self-checkOnly against specificationAlso by running reference program on chosen inputs

Methodology

Setups

Six setups are compared (Table 2):

SetupDescription
SingleOne agent works alone; ends at natural stop (4h cap)
MultiMain agent may delegate to up to 20 subagents; permission sentence only
Single-ProbeSingle + one-sentence instruction to probe reference program first
Single-ExtendedContinues past stops until time budget (up to 20h) runs out
Multi-ExtendedMulti with aggressive parallelism instruction + extended budget (4h)

Key Design Decisions

  • Models: GPT-5.6 Sol (default), GPT-6 Sol, GPT-6.1 Sol; replication with Opus 5.5 on Claude Code, Grok 4.6, MiniMax-M3
  • Tasks: 30 random tasks per benchmark (10 per difficulty level) for RQ1; 16 ProgramBench-Hard tasks for RQ2; 3 hard tasks (delta, lightningcss, solar) for RQ3 extended runs
  • Scoring: Workspace snapshots every 5–10 minutes; score = share of active hidden tests passed
  • Cost: List-price token costs; GPT-6 models priced at GPT-5.6 Sol prices to compare token usage

Measures

  • Self-checking: Run time TrT_r (minutes to natural stop) and differential tests DrD_r (commands running reference and agent programs on same input)
  • Cost multiple: Ratio of two setups' mean costs over tasks

Empirical Validation / Results

RQ1 (Parallelism): Small Gain at Several Times the Cost

Key quantitative results (Table 3, GPT-5.6 Sol, random tasks):

NL2Repo SingleNL2Repo MultiProgramBench SingleProgramBench Multi
Final score67.7%70.6%76.2%77.4%
Duration (min)26.619.339.340.2
Cost (USD)3.0211.565.6918.32

Across model generations (Table 4, ProgramBench):

GPT-5.6 SolGPT-6 SolGPT-6.1 Sol
Single final score76.2%69.5%79.5%
Multi final score77.4%71.0%84.2%
Gain (points)+1.2+1.5+4.7
Cost multiple3.2×3.1×2.6×

Finding 1: Subagents add small gains at several times the cost; at equal cost, single agents match or beat them. Gain is larger on hard tasks (median +2.0 to +8.4 points on hard vs. +0.6 to +1.7 on easy/medium).

RQ2 (Self-Checking): The Gain Is Associated with Checks Single Skips

Key results (Table 5, 16 hard ProgramBench tasks):

Single ScoreMulti GainProbe GainSingle Time (min)Multi Time ΔProbe Time Δ
GPT-5.6 Sol56.4%+8.8+6.732+30%+55%
GPT-6 Sol55.5%+6.0+0.819+54%+14%
GPT-6.1 Sol73.5%+2.8−1.567−11%−16%

Key observations:

  • Single agents stop right after their own checks pass, even when hidden tests still fail
  • On atlas (database schema tool): Single stops at 47%, Multi reaches 77%, Single-Probe reaches 75%
  • With GPT-6.1 Sol, Single already checks adequately (works longer than Multi), so the gain shrinks to +2.8 points

Finding 2: When a single agent stops early, the subagent gain is associated with skipped checks; one sentence telling GPT-5.6 Sol to probe the reference recovers most of the gain at a fraction of the cost.

RQ3 (Fresh Context and Modularity): Long-Run Mechanisms

Extended runs (Figure 4): Multi-Extended overtakes Single-Extended late at equal cost, except on solar where Single-Extended ends higher.

Fresh context (Figure 5): Chains of fresh sessions start faster than resumed sessions in all 6 panels; clearly higher final score only with GPT-6.1 Sol on delta.

Modularity (Table 6, medians over 3 tasks):

MetricSingle-Ext. (GPT-5.6)Multi-Ext. (GPT-5.6)Single-Ext. (GPT-6.1)Multi-Ext. (GPT-6.1)Upstream
Files120212699
Lines/file4,1931,217397597273
Mean CCN/function25.616.017.613.24.5
Mean function length3324302118

Coupling breaks: Multi-Extended breaks code more often (15/22 attributable breaks are coupling breaks); in 14/15 cases, agents ran their own tests but none used inputs the edit now rejects.

Finding 3: In extended runs, Multi overtakes Single late at equal cost unless code breaks; fresh context gives faster starts; remaining gap is associated with modularity (on delta, Single keeps code in one file).

Replication (Section 6)

  • Claude Code + Opus 5.5: RQ1 finding holds (Multi ends +4.7 points at 3.1× cost on ProgramBench); RQ2 early stopping holds; RQ3 progress slows similarly
  • dsh + GPT-5.6 Sol: Early stopping holds; probe sentence does not transfer to dsh or NL2Repo

Theoretical and Practical Implications

For Users

  1. Reserve parallelism for hard tasks — subagents cost 2.6–3.8× more for a few points on random tasks
  2. Get self-checking by instruction or newer models — one probe sentence recovers most of the gain at a fraction of the cost (with GPT-5.6 Sol)
  3. Use fresh sessions when progress slows — fresh sessions start faster than resumed ones
  4. Check code division on long tasks — modularity matters where subagents still win
  5. Compare setups over cost and model generation — final scores alone hide cost; gains can disappear across model generations

For Model and Product Developers

  • None of the three factors is specific to subagents; each can be built into a single agent
  • Self-checking: Target an agent that looks for where its program is wrong, not one that confirms it runs
  • Fresh context: Needs only a product feature that clears the conversation
  • Modularity: Newer single agents divide code into more files; re-checks after integration should use new inputs rather than stored ones

Theoretical Significance

  • Provides evidence for test-time scaling limits in coding: unlike math problems with verifiers, repository construction has no verifier, so extra compute (subagents) doesn't reliably improve outcomes
  • Identifies early stopping as a failure mode of older single agents (too little compute), contrasting with BAGEN's finding of agents consuming too much compute on unfinishable tasks
  • Shows context rot and modularity as distinct mechanisms affecting long-horizon agent performance

Conclusion

Parallel subagents add a small gain on randomly drawn repository-construction tasks at several times the cost, with larger gains on hard tasks. The gain is associated with three mechanisms:

  1. Self-checking: Subagents run more differential tests; a single agent told to probe the reference program recovers most of the gain
  2. Fresh context: Chains of fresh sessions start faster than resumed sessions when progress slows
  3. Modularity: Multi-agent code is more modular (more files, shorter functions), which helps on tasks where single agents keep code in one file

Newer model generations (GPT-6.1 Sol) self-check more and write more modular code on their own, shrinking the gain from parallelism. The gain from subagents is therefore conditional: it appears when (i) a single agent stops checking too early, (ii) a long session keeps reworking code with little improvement, or (iii) modular code helps on the task. Otherwise, subagents mainly add cost.

Future Directions

  • Why fresh context helps (resembles random restart escaping local minima)
  • Testing predictions on other tasks: clearing context when score plateaus should help any long task; telling a single agent to write modules should close part of the gap
  • How to train self-checking toward finding flaws rather than confirming functionality

Related papers