When Are Parallel Subagents Effective for Coding? An Empirical Study on Repository Construction
Organizations: University of Illinois Urbana-Champaign, USA
Abstract
LLM-based coding agents are increasingly used for long-horizon tasks such as building an entire program from a specification. Products like Codex and Claude Code let an agent delegate work to parallel subagents, multiplying run cost, yet it remains unclear whether and when delegation produces a better program. We compare a single agent with a main agent delegating to subagents on repository-construction tasks from NL2Repo and ProgramBench (which also provides an executable reference program). We compare scores at equal time and equal cost, run intervention experiments, and analyze fine-grained behavior. On randomly drawn tasks, parallel subagents raise hidden-test pass rates by only about 1 to 5 percentage points at up to 3.8x the cost of a single agent. Their gain is larger on hard tasks, where we find evidence of three mechanisms. Self-checking: with GPT-5.6 Sol, one sentence telling a single agent to probe the reference program first recovers most of this gain at a fraction of the cost; from GPT-5.6 Sol to GPT-6.1 Sol, the gain shrinks as single agents check their own work more. Fresh context: in extended runs, a single agent that periodically starts a new session with an empty conversation makes faster early progress in every comparison than one that resumes its conversation. Modularity: multi-agent runs produce more modular code (more files and shorter functions), closer to the upstream source. We observe similar patterns in a smaller replication with Opus 5.5 on Claude Code. Overall, subagents help when (i) a single agent stops checking too early, (ii) a long session keeps editing with little improvement, or (iii) modular code helps on the task; otherwise, they mainly add cost.
Figures & tables
| NL2Repo | ProgramBench | |
|---|---|---|
| Input | A written specification of a Python library: API signatures and usage examples | The program’s documentation, example inputs, and an executable of the program to be rebuilt (the reference program ) |
| Output | The Python package | Source code written from scratch, plus a compile.sh that builds it into ./executable , the path of the reference program |
| Hidden tests | A pytest suite that imports the package and calls its functions | Each test runs the built program and compares output, exit code and written files with the reference program’s |
| Self-check | Only against the specification | Also by running the reference program on any input it chooses |
| NL2Repo 30 | ProgramBench 30 | |||||
| Single | Multi (Weaker) | Multi (Same) | Single | Multi (Weaker) | Multi (Same) | |
| Score at a given time | ||||||
| 5 minutes | 16.9 | 30.3 | 47.2 | 0.0 | 0.0 | 0.0 |
| 20 minutes | 64.6 | 59.6 | 70.1 | 69.4 | 69.7 | 68.9 |
| Final | 67.7 | 65.3 | 70.6 | 76.2 | 74.0 | 77.4 |
| What a run takes | ||||||
| GPT-5.6 Sol | GPT-6 Sol | GPT-6.1 Sol | ||||
| Single | Multi | Single | Multi | Single | Multi | |
| Score at a given time | ||||||
| 20 minutes | 69.4 | 68.9 | 66.9 | 64.0 | 61.8 | 66.6 |
| Final | 76.2 | 77.4 | 69.5 | 71.0 | 79.5 | 84.2 |
| What a run takes | ||||||
| Mean duration (minutes) | 39.3 | 40.2 | 18.0 | 24.0 | 60.8 | 52.4 |
| Score (%) | Run time | List-price cost | Differential tests | |||||||||
| Single | Multi | Probe | Single | Multi | Probe | Single | Multi | Probe | Single | Multi | Probe | |
| gain | gain | (min) | (USD) | |||||||||
| GPT-5.6 Sol | 56.4 (54.6) | +8.8 (+4.9) | +6.7 (+1.3) | 32 | +30% | +55% | 5.99 | +275% | +50% | 15.3 | 17 | 23.5 |
| GPT-6 Sol | 55.5 (57.2) | +6.0 (+6.7) | +0.8 (+2.5) | 19 | +54% | +14% | 1.97 | +291% | +5% | 7 | 26 | 8 |
| GPT-6.1 Sol | 73.5 (75.2) | +2.8 (+3.1) | 1.5 ( 0.8) | 67 | 11% | 16% | 6.96 | +176% | 9% | 19 | 56 | 10 |
| GPT-5.6 Sol | GPT-6.1 Sol | ||||
| Single-Ext. | Multi-Ext. | Single-Ext. | Multi-Ext. | Upstream | |
| Lines of code | 4,193 | 11,418 | 8,341 | 16,130 | 27,030 |
| Files | 1 | 20 | 21 | 26 | 99 |
| Classes | 1 | 23 | 12 | 36 | 341 |
| Functions | 113 | 443 | 331 | 616 | 1,671 |
| Lines per file | 4,193 | 1,217 | 397 | 597 | 273 |
| Tests Single-Extended loses | Tests Multi-Extended loses | Net | |||||||||
| Single-Extended first compared | lost while writing | never | |||||||||
| Task (hours) | 1 h | 1–4 h | 4 h | never | All | main only | subagents too | passed | All | tests | points |
| delta (20 / 8.5 h) | 65 | 39 | 40 | 21 | 165 | 0 | 1 (0) | 10 | 11 | 154 | |
| lightningcss (18.2 / 4 h) | 121 | 59 | 0 | 17 | 197 | 23 (0) | 22 (11) | 135 | 180 | ||
| solar (8.4 / 4 h) | 26 | 0 | 4 | 0 | 30 | 138 (137) | 0 | 296 | 434 | 404 | |
Appendix figures & tables20 assets
Supplementary material from the paper’s appendix.
Appendix
| Defect | What happened | Correction | Affected numbers |
|---|---|---|---|
| jsonschema : pytest -x | The task’s official test script runs pytest -x , which stops at the first failure, so most tests are never run. | Snapshots are rescored without -x , and both versions are reported. The defect affects every snapshot. | Single 57.5 92.2. Tables 3 and 4 use the corrected score on every row. |
| Hung tests, extended runs | One hanging test drops the remaining tests of its process. | Tests lost in this way are rerun individually and merged into the snapshot’s score. | Up to 4.45 points on one solar Single snapshot (a mean of 1.2 over its snapshots). It affects all extended-run scores, including solar at 4 h (Multi-Extended 46.0 against Single 61.4) and Figure 4 , and the solar takeovers and chains (Tables 14 and 15 , § E.3 ). |
| Hung tests, natural-stop runs | The same loss affects run 1 of solar Single (990 tests passed after correction, 964 before) and of stgit Multi (Same Subagent) (955 after, 939 before), and run 2 of solar Multi (Same Subagent) (942 after, 922 before). On jp2a , 35 tests of 17 snapshots in six runs were still not run after this rerun and are run one per container (for example, in run 1 of Single, 452 tests passed after and 418 before). | The RQ1 rerun comparison (§ C ) uses the corrected run-1 scores; Tables 3 , 4 and 5 use the corrected run-2 score. | Rerun variation (RQ1). On jp2a , it changes Single in Tables 3 and 4 by at most 0.2 points. |
| NL2Repo: test isolation and denominators | Some tests fail only when the whole suite runs in one process, and the official test counts (denominators) of justext and jsonlines are swapped with each other. | Failing tests are rerun alone, file by file. justext and jsonlines use their own test counts. | Table 3 (NL2Repo). With the official counts, the Final row reads 67.1, 65.3 and 69.4 instead of 67.7, 65.3 and 70.6, and the order of the setups is unchanged. |
| NL2Repo: boto without pytest | The evaluation image of boto lacks pytest, so every snapshot of its 10 runs scored 0. | pytest is added to the image, with the same test commands and test count (1014); the reference program passes 1009 tests, and all 110 snapshots are rescored. | Table 3 (NL2Repo) and Figure 2 . The Final row rises by 2.5, 1.8 and 2.6 points. |
| Per-shard time limit | The ProgramBench evaluator applies an undocumented 1 h limit to each test shard, which cuts off slow shards. | Slow shards are rescored under a relaxed limit of 4 h per shard; runs that were not rescored are marked. | skeema , miller and broot on the hard tasks (Table 10 ). |
| GPT-5.6 Sol | GPT-6.1 Sol | |||||
|---|---|---|---|---|---|---|
| Task | Single | Multi | Single (min) | Multi | Subagents | |
| i3-style | 94.8 | 94.8 | 99.8 (61) | 99.4 | 2 / 3 | |
| dua-cli | 92.1 | 90.8 | 96.1 (118) | 96.1 | 2 / 2 | |
| delta | 52.9 | 53.1 | 72.6 (96) | 81.6 | 4 / 4 | |
| doxygen | 36.2 | 37.1 | 38.0 (87) | 37.6 | 5 / 5 | |
| datasurgeon | 78.7 | 82.7 | 85.5 (60) | 86.3 | 3 / 3 | |
| Generation | Setup | atlas | gittype | broot | skeema |
|---|---|---|---|---|---|
| GPT-5.6 Sol | Single | 50.4 / 45.0 / 46.7 | 51.0 / 52.2 / 51.7 | 55.9 / 57.4 / 64.3 | 65.3 / 67.7 / 73.1 |
| Single-Probe | 75.3 / 74.7 | 79.0 / 76.1 | 72.1 / 71.0 | 86.1 / 90.0 | |
| Multi | 76.3 / 77.3 | 77.5 / 72.1 | 75.5 / 72.7 | 88.0 / 83.4 | |
| GPT-6 Sol | Single | 70.2 | 64.5 | 59.9 | 83.2 |
| Single-Probe | 72.8 | 66.9 | 62.6 | 82.7 | |
| Multi | 79.1 | 84.3 | — | 87.2 |
| GPT-5.6 Sol | GPT-6 Sol | GPT-6.1 Sol | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Task | S | M | P | S | M | P | S | M | P |
| ffmpeg | 7.4 | +3.2 | +1.3 | 11.5 | +0.3 | +0.5 | 12.7 | +2.0 | +0.7 |
| doxygen | 35.4 | +1.7 | +1.3 | 37.6 | 0.9 | 1.3 | 38.0 | 0.4 | 0.9 |
| delta | 43.3 | +9.9 | — | 36.6 | +9.7 | +5.2 | 72.6 | +9.0 | 0.8 |
| atlas | 47.4 | +29.5 | +27.6 | 70.2 | +9.0 | +2.7 | 88.2 | +2.3 | +0.2 |
| typst | 49.1 | +1.4 | +0.9 | 38.5 | +6.8 | +6.1 | 61.1 | +9.5 | +7.1 |
| Single | Multi-Extended | |||||
|---|---|---|---|---|---|---|
| Task | Score | Hours | Cost | Score | Hours | Cost |
| delta | 75.2 | 20.0 | $260 | 91.5 | 8.5 | $1,201 |
| lightningcss | 77.1 | 18.2 | $435 | 77.7 | 4.0 | $269 |
| solar | 66.4 | 8.4 | $128 | 46.0 | 4.0 | $73 |
| GPT-5.6 Sol | GPT-6 Sol | GPT-6.1 Sol | |||||
| Single | Multi | Single | Multi | Single | Multi | Upstream | |
| Lines of code | 798 | 1,076 | 406 | 781 | 1,738 | 2,563 | 13,610 |
| Files | 1 | 1 | 1 | 4 | 3 | 7 | 78 |
| Classes | 4 | 4 | 1 | 2 | 5 | 8 | 94 |
| Functions | 39 | 40 | 17 | 36 | 64 | 112 | 668 |
| Lines per file | 714 | 936 | 406 | 305 | 410 | 463 | 196 |
| Task | Seed | New Single | New Multi-Extended |
|---|---|---|---|
| delta | 709 / 949 | 719 (mean of two) | 791; 0 (747 at 2.5 h) |
| lightningcss | 2,140 / 2,828 | 2,186; 2,238 | 2,216; 2,318 |
| solar | 1,314 / 1,978 | 1,317; 1,298 | 1,471; 1,423 |
| Chain | Seed | Session 1 | 2 | 3 | 4 | Cost | Multi-Extended final (cost) | Equal cost | Chain equal cost |
|---|---|---|---|---|---|---|---|---|---|
| delta 1 | 709 | 719 | 721 | 728 | 734 | $220 | 791 ($279) | 765 | 2.3 |
| delta 2 | 709 | 719 | 731 | 739 | 752 | $196 | |||
| lightningcss 1 | 2,140 | 2,186 | 2,202 | 2,253 | 2,282 | $142 | 2,267 ($340) | 2,230 | 2.3 |
| lightningcss 2 | 2,140 | 2,238 | 2,267 | 2,294 | 2,307 | $174 | |||
| solar 1 | 1,314 | 1,317 | 1,359 | 1,362 | 1,407 | $195 | 1,447 ($283) | 1,434 | 0.9 |
| solar 2 | 1,314 | 1,298 | 1,375 | 1,417 | 1,424 | $158 |
| Task | Tests / features | Comparisons, S / M | Lost tests in features S compared |
|---|---|---|---|
| delta | 949 / 85 | 1,278 / 6,133 | 144 of 165 |
| lightningcss | 2,828 / 503 | 340 / 1,295 | 180 of 197 |
| solar | 1,978 / 98 | 562 / 404 | 30 of 30 |
| Runs | Hand-backs | Checked within 10 min | Shared-code edits | Re-checked (broad) | Loss intervals, main agent only |
|---|---|---|---|---|---|
| delta (8.5 h) | 425 | 97% | 179 | 100% (98%) | 0 of 1 |
| lightningcss (4 h) | 65 | 100% | 271 | 81% (48%) | 8 of 11 |
| solar (4 h) | 0 | — | 142 | 94% (26%) | 2 of 2 |
| nine 2 h runs | 72 | — | 1,086 | 63–96% | 14 of 16 |
| all | 562 | 97% | 1,678 | 85% (43%) | 24 of 30 (386 of 454 tests) |
| Score | Cost | ||||||
| Task | Single | Multi | Haiku | Single | Multi | Haiku | Subagents |
| ProgramBench | |||||||
| elfcat | 100.0 | 99.1 | 100.0 | 8 | 9 | 10 | 0 |
| hex | 100.0 | 100.0 | 100.0 | 2 | 5 | 2 | 0 |
| quinn | 98.3 | 99.8 | 98.3 | 20 | 20 | 14 | 1 |
| delta | 63.4 | 80.7 a | 84.3 | 55 | 289 | 141 | 6 |
| Conclusion | Codex, GPT-5.6 Sol | Claude Code, Opus 5.5 |
|---|---|---|
| Main agent delegates under the permission sentence | every run; subagents only probe | mostly on hard tasks: 4–13 subagents on delta , solar , jsonschema , lightningcss and atlas ; 0–2 on the other six random ProgramBench tasks (Table 18 ) |
| Score rises sooner, ends level (Finding 1) | holds on NL2Repo | holds for 2 h against 4 h where it delegates: in the eight 4 h versus 2 h pairs ( delta and solar three times each, lua and mdBook once), Multi leads at 2 h in seven and ties on mdBook , and Single given twice the time ends level (mean +0.8), whereas at the natural stop and with 4 h against 8 h Multi ends higher on delta and solar ; without delegation the setups tie ( elfcat 99.1 vs. 100, hex 100 vs. 100) |
| Lower-cost subagents do not beat Single (RQ1) | holds: Luna subagents end 2.4 (NL2Repo) and 2.2 (ProgramBench) points below Single | holds: over the ten NL2Repo tasks, Haiku subagents end below Single (88.0 vs. 94.4, and 93.4 vs. 94.0 without python-pathspec ) |
| Single stops early (Finding 2) | holds | holds: on atlas Single stops at 61 min at 81.7; continued to 4 h it reaches 91.1, told to probe first 91.5 |
| Default subagents mainly check (Finding 2) | holds | does not apply: its subagents often write product code without being told to |
| Extra cost of the multi-agent setup (Finding 1) | 3.2 to 3.8 | about 1.8 Single’s cost over the first 2 h of the paired runs; 1.7–5.2 in runs to a natural stop or in extended runs |
| Task | Tests | Single | Multi | Single-Probe |
|---|---|---|---|---|
| boltons | 423 | 69.3 / 70.2 (69.7) | 78.3 / 78.7 (78.5) | 34.0 / 53.0 (43.5) |
| deepdiff | 970 | 50.9 / 48.9 (49.9) | 58.0 / 61.3 (59.7) | 40.3 / 33.0 (36.6) |
| deslib | 532 | 48.7 / 48.3 (48.5) | 57.3 / 52.4 (54.9) | 30.6 / 25.4 (28.0) |
| jinja | 911 | 75.5 / 74.9 (75.2) | 68.1 / 64.7 (66.4) | 0.0 / 56.3 (28.2) |
| Product / model | Delegation | delta | solar |
|---|---|---|---|
| Codex, GPT-5.6 Sol (4 h gap a ) | Multi: spawns 4–20, subagents write no code in 29 of 30 runs ( jsonschema 0.65); Multi-Extended: subagent share 0–0.93 | +13.8 a | 15.4 a |
| Opus 5.5 | delta 4–6 calls per pair, 4 / 5 writers in pair 1; solar 4 calls per pair, 1 / 4 and 0 / 4 writers in pairs 1 and 2 | +14.4, 4.2, +1.9 (mean +4.0) | +3.8, 4.9, 4.1 (mean 1.7) |
| GLM-5.3 | delta 4 calls, 1 / 4 writers; solar 0 calls | 22.3 | 6.3 b,c |
| Grok 4.6 | 0 calls on both tasks | n/a d | 5.1, 9.6 b |
| MiniMax-M3 | 0 calls on both tasks | +16.9 b,e , +2.6 b | 12.2 b |
| Task setup | 1 h | 2 h | 4 h | 8 h | Last hour | Subagents | Cost |
|---|---|---|---|---|---|---|---|
| delta Single | 0.0 a | 71.2 | 74.8 | 78.4 | +3.6 | — | $94 |
| delta Multi | 64.5 | 80.4 | 81.3 | — | +0.1 | 28 / 28, 14 | $217 |
| solar Single | 63.3 | 69.3 | 77.9 | 81.3 | +0.2 | — | $102 |
| solar Multi | 67.6 | 76.1 | 91.5 | — | +1.6 | 9 / 12, 4 | $167 |
Multi-Agent Coding
Multi-agent coding studies how AI agents can collaborate to generate, test, debug, and maintain software.
See all 91 papers