Learning How Much to Collaborate: Difficulty-Aware Topology Selection for Multi-Agent Code Generation
Abstract
Multi-agent code-generation systems often use one communication topology for every problem. Across five topologies and 614 problems from APPS, HumanEval+ and LiveCodeBench, the advantage of hierarchical collaboration over a single agent grows from 2.4 points of pass@1 on the easiest third to 21.1 points on the hardest third, at about ten times the token cost. We propose the Difficulty-Aware Topology Selector (DATS), which predicts each topology's success probability and maximises predicted success minus cost. Its graph predictor treats topologies as nodes of a connectivity order. The complete graph-head comparison reports a 1.7-point advantage over a flat multi-label head while changing several mechanisms; capacity-matched adjacency controls show smaller descriptive differences. A scalar cost penalty can be recalibrated without retraining for approximately matched-spend comparisons when targets are attained. With a shared penalty, six methods span 21.6 percentage points of spend; two leading baselines fall behind DATS after method-specific calibration near the common target. At 40% of always-hierarchical cost, DATS reaches 77.7% pass@1 versus 73.6% for always-hierarchical and 74.3% for the strongest learned competitor. The main comparison includes Holm--Bonferroni-adjusted McNemar tests; unequal-cost differences do not imply matched-budget superiority. Backbone-specific gains are 4.07--4.23 points across four backbones. Alternatives to the 39 interpretable features, including a hybrid encoder, yield a largest observed gain of 1.3 points, with no significant pairwise improvement; this establishes neither equivalence nor an upper bound. A study on 400 mathematical reasoning problems reproduces difficulty-dependent collaboration gains, widening from 2.5 to 20.9 points.
Create a lesson
Metadata
- Categories
- cs.MA, cs.SE
- Comments
- Accepted for publication in Neurocomputing. Revised manuscript incorporating peer-review revisions. 23 pages, 11 figures
Related papers
FlowMAS: Learning Multi-Agent Workflow Topology via Information-guided Generative Flow Network
Shared title terminologycs.MAHaitao Wang, Chenjing Liang, Haipeng Zhang et al.
Rank Without an Oracle: Deviation-Aware Interaction-Rank Selection from Offline Multi-Agent Logs
Shared title terminologycs.MAXiangwu Wang, Chengwei Cao, Hongyuan Tang
Reward-Guided Autoregressive Graph Generation for Efficient Multi-Agent Communication Topology Design
Shared title terminologycs.MAPoomphob Suwannapichat, Boonyarit Changaival, Caesar Wu et al.
When Successful Collaboration Becomes an Attack Surface: Insider Memory Poisoning in Multi-Agent Systems
Shared title terminologycs.MAJihyung Ahn, Buru Chang
Selective Verification in Multi-Agent Orchestration with Large Language Models
Shared title terminologycs.MARamesh Krishnamaneni, Muralidhar Kurni
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Shared title terminologycs.MAZijia Cao, Hanqing Dou