Manuscript Offprint

arXiv:2610.07835

DHCG: Dynamic Construction of Hierarchical Collaboration Graphs for LLM-Based Multi-Agent Reasoning

Jie Ren, Jiakang Yuan, Chenyu Huang, Hezeer Ma, Jiayuan Fan, Tao Chen

Abstract

LLM-based multi-agent systems (MAS) have demonstrated strong capabilities in solving complex problems across diverse domains. Recently, the dynamic orchestration of agent systems has become an important research direction. However, existing methods suffer from limited composition, misaligned dependencies, and inflexible scale, restricting their ability to adapt to reasoning requirements during execution. To address these limitations, we reframe MAS design as a partially observable Markov decision process, in which both the composition and scale of the MAS are dynamically determined. We propose DHCG, a novel framework that coordinates three modules (Planner, Worker, and Generator) to progressively construct a dynamic hierarchical collaboration graph from scratch based on the query and evolving execution feedback. At each step, guided by feedback, the Planner generates a set of distinct and complementary roles tailored to the current reasoning needs and selectively routes relevant information to each role. It can also finalize the hierarchical collaboration graph early or progressively expand it when additional reasoning is required. We further introduce action-aware preference optimization to train the Planner to make more effective decisions when constructing hierarchical collaboration graphs. We systematically evaluate DHCG across code generation, mathematical reasoning, and domain-specific reasoning benchmarks. DHCG achieves state-of-the-art average performance among the compared methods, improving over the single-agent baseline by 13.06 points and outperforming both static and dynamic MAS baselines by 2.77–8.02 points. Additional experiments further demonstrate its generalization across different Planner backbones and unseen Worker models.

1 Introduction

Agents powered by large language models (LLMs) have demonstrated strong capabilities across a wide range of tasks, including code generation, decision making, and question answering (Yao et al. 2023; Shinn et al. 2023; Zhang et al. 2024; Schick et al. 2023). Despite these advances, a single agent may still face challenges when solving complex problems involving diverse expertise and verification from multiple perspectives. Recent studies have increasingly explored LLM-based multi-agent systems (MAS) (Wu et al. 2024; Team et al. 2025; Li et al. 2023), where multiple agents collaborate

(a) Graph-based MAS

x Fixed Role

x Weak Dependency

Figure

Graph Template

Task-specific Sparse Topology

(b) Workflow-based MAS

x Predefined Operator

x Rigid Execution

Initial Workflow

Task-specific Workflow

(c) Feedback-driven Graph Construction (Ours)

✓ Dynamic Role

✓ Dependency Routing

✓ Dynamic Scale

Iterate Feedback

Figure 1: Comparison of three MAS construction paradigms: (a) graph-based MAS; (b) workflow-based MAS; and (c) our feedback-driven graph construction paradigm.

through role specialization and communication. Early frameworks such as AutoGen (Wu et al. 2024), CAMEL (Li et al. 2023), and MetaGPT (Hong et al. 2024) largely rely on manually designed roles and interaction patterns, requiring considerable human effort and providing limited task-specific adaptability. These limitations have motivated growing efforts to automatically design and adapt multi-agent collaboration for different tasks.

Existing approaches to automated MAS design can be broadly categorized into two paradigms: graph-based MAS and workflow-based MAS, as shown in Fig. 1(a) and Fig. 1(b). Graph-based MAS optimize inter-agent communication topologies through graph optimization, pruning, or topology generation (Zhuge et al. 2024; Zhang et al. 2025b; Li et al. 2026). A representative example is G-Designer (Zhang et al. 2025c), which employs graph neural networks to generate a task-adaptive communication topology. In parallel, workflow-based MAS construct and optimize executable workflows by organizing components through

∗^{*}Corresponding Author search, evolution, or feedback-driven refinement (Hu, Lu, and Clune 2025; Hu et al. 2026; Wang et al. 2025a). For example, AFlow (Zhang et al. 2025d) uses Monte Carlo tree search to iteratively optimize workflows.

Despite their task-adaptive designs, existing dynamic MAS methods still suffer from several limitations. 1) Limited Composition. Existing methods construct MAS from predefined agent nodes or workflow operators. Consequently, they may provide insufficient role coverage because the agent composition cannot adapt to task-specific requirements or emerging reasoning needs during execution. 2) Misaligned Dependencies. Communication dependencies are often determined by predefined templates or global optimization objectives, rather than the actual information needs of downstream agents. Agents may receive irrelevant or redundant context while missing critical intermediate evidence, which can weaken collaboration and propagate errors through the reasoning process. 3) Inflexible scale. Fixed interaction rounds and one-shot workflow generation determine the reasoning scale before execution. This can cause the system to continue reasoning after sufficient evidence has been obtained, or stop before the remaining reasoning needs have been adequately addressed. Given the above limitations, a natural question arises: Can we dynamically design MAS at inference time, adapting their components, dependencies, and scale to the evolving reasoning state?

To seek the answer to the above question, we draw inspiration from how real-world teams incrementally recruit experts according to evolving task needs, rather than assembling all members in advance. This motivates a feedback-driven dynamic collaboration graph construction paradigm for MAS design, as shown in Fig. 1(c). Unlike existing paradigms that determine agent components, communication structures, and interaction scales before execution, our paradigm constructs the MAS progressively from scratch using real-time execution feedback. At each construction step, unresolved reasoning needs are identified, and an appropriate number of complementary roles are generated, enabling task- and state-specific capability composition. Dependencies are then established according to each new role's information requirements, aligning communication with downstream needs. Finally, the construction process adaptively determines whether to expand the collaboration graph or finalize the reasoning process, allowing the system scale to evolve with the current reasoning state. Together, these mechanisms help alleviate the limitations in role composition, dependency alignment, and system scalability, respectively.

Building on this new paradigm, we propose DHCG: Dynamic construction of Hierarchical Collaboration Graphs for MAS. We formulate MAS construction as a partially observable Markov decision process, in which a Planner makes sequential decisions based on the query and evolving execution feedback. At each layer, the Planner generates complementary roles for unresolved reasoning needs, assigns relevant predecessors through dependency-aware instructions, and decides whether to expand or finalize the graph. Consequently, both the collaboration structure and scale evolve with the reasoning process. Training such a sequential construction policy online is expensive. We therefore devise an offline action-aware preference optimization strategy that reuses collected trajectory trees to construct multiple preference pairs from relatively few trajectories. It evaluates alternative Planner actions through downstream outcomes, constructs within- and cross-action preferences, and weights the pairs by their value gaps. This offline training strategy guides the Planner toward more effective role-generation, dependency-routing, and finalization decisions. Empirical results show that DHCG achieves the highest average performance, outperforming the strongest static, workflow-based, and graph-based MAS baselines by 4.76, 2.77, and 3.33 points, respectively. The framework also generalizes across Planner backbones and transfers effectively to unseen Worker models. Additional analyses show that DHCG adapts its collaboration structure and scale to task difficulty.

Our main contributions are summarized as follows:

• We introduce an inference-time dynamic graph construction paradigm for MAS design, where collaboration structures are progressively constructed according to the query and real-time execution feedback, rather than being fully specified before execution.

• We propose DHCG, a Planner-driven framework that formulates MAS construction as a POMDP and adaptively determines roles, dependencies, and graph scale. We further introduce offline action-aware preference optimization, which derives within- and cross-action preferences from downstream trajectory quality and action-level execution cost.

• We evaluate DHCG on seven benchmarks spanning mathematical reasoning, code generation, and general knowledge. The results validate DHCG's effectiveness and its generalization across Planner backbones and unseen Worker models. Additional analyses show that DHCG adapts its collaboration structure and scale to task difficulty.

References (40)