Source-linked AI summary

DyTopo: Dynamic Topology Routing for Multi-Agent Reasoning via Semantic Matching

Yuxing Lu, Yucheng Hu, Xukai Zhao, Jiuxin Cao

arXiv:2602.06039v1cs.AI

TL;DR

Multi-agent reasoning pipelines often reuse fixed communication patterns despite stage-dependent problem-solving needs. DyTopo reconstructs a sparse directed graph each round by semantically matching agents’ descriptors under a manager’s goal. It is reported to outperform the strongest non-DyTopo baseline across the evaluated benchmarks and backbones.

  • Problem

    Many multi-agent reasoning pipelines use fixed, trajectory-wide communication patterns despite the stage-dependent needs of iterative problem solving.

    Source: §1 · p. 1
  • Method

    DyTopo uses a manager-specified round goal and semantic matching of agents’ natural-language need and offer descriptors to induce a directed communication graph and route messages along its active links.

    Source: §1 · pp. 1–2
  • Results

    DyTopo is best in all 16 backbone×dataset settings, improving over the strongest non-DyTopo baseline by 0.90-17.14 points (mean +6.09).

    Source: §5.1 · p. 7
  • Takeaways & Limitations

    Evolving graphs provide an interpretable coordination trace of how communication pathways reconfigure across rounds.

    Source: §1 · p. 2, §6 · p. 8

    DyTopo can fail when descriptors are misleading, causing misrouting and error propagation.

    Source: Impact Statement · p. 9

Abstract

from arXiv · show

Multi-agent systems built from prompted large language models can improve multi-round reasoning, yet most existing pipelines rely on fixed, trajectory-wide communication patterns that are poorly matched to the stage-dependent needs of iterative problem solving. We introduce DyTopo, a manager-guided multi-agent framework that reconstructs a sparse directed communication graph at each round. Conditioned on the manager's round goal, each agent outputs lightweight natural-language query (need) and \key (offer) descriptors; DyTopo embeds these descriptors and performs semantic matching, routing private messages only along the induced edges. Across code generation and mathematical reasoning benchmarks and four LLM backbones, DyTopo consistently outperforms over the strongest baseline (avg. +6.2). Beyond accuracy, DyTopo yields an interpretable coordination trace via the evolving graphs, enabling qualitative inspection of how communication pathways reconfigure across rounds.

1. Introduction

Multi-agent reasoning can benefit from interaction, but fixed communication patterns do not match the changing needs of multi-round problem solving. DyTopo makes communication goal-conditioned and dynamically routes messages, with evaluation across code generation and mathematical reasoning.

1. Introduction

  • The topology comparison contrasts single-agent prompting, a fixed graph reused across rounds, and DyTopo’s goal- and relevance-driven rewiring.Figure 1 depicts these three communication patterns.Source: Figure 1 · p. 1
  • Fixed, trajectory-wide communication patterns poorly match reasoning stages that shift from broad exploration to selective verification.The communication structure determines which agents exchange information and when.Source: §1 · p. 1
  • DyTopo uses a manager to set each round’s goal and decide whether the interaction should terminate.Given the round goal and agents’ stated needs and capabilities, it induces a directed graph and routes messages only along activated links.Source: §1 · p. 1
  • Agents provide natural-language query (need) and key (offer) descriptors, which DyTopo semantically matches to create round-specific communication links.The evolving graphs provide an interpretable trace of how communication pathways reconfigure over time.Source: §1 · p. 2
  • DyTopo is evaluated on multi-round code generation and mathematical reasoning against single-agent prompting, fixed or random topologies, and recent agentic frameworks.The introduction also previews analyses of performance across rounds, topology evolution, and semantic-matching hyperparameters.Source: §1 · p. 2

2. Related Work

Prior LLM-agent collaboration work uses role specialization, structured dialogue, deliberation, and tool delegation, while selective-routing work explores task-conditioned communication. DyTopo is positioned as an interpretable, inference-time routing approach using textual descriptors and semantic similarity.

2.1. LLM-Based Multi-Agent Collaboration

  • Prior LLM collaboration frameworks use role specialization, structured dialogue, standardized procedures, multi-round deliberation, or delegation to tools and specialized executors.Examples include CAMEL [Li et al., 2023], AutoGen, MetaGPT [Hong et al., 2023], and multiagent deliberation [Du et al., 2023].Source: §2.1 · p. 2
  • These collaboration approaches typically use fixed or dense communication patterns, leaving inference-time adaptive routing among agents open.Source: §2.1 · p. 2

2.2. Selective and Dynamic Communication Topologies

  • Selective communication research spans learned targeted messaging, sparse computation, content-based attention, message pruning, and generated or optimized agent topologies.Examples include TarMAC [Das et al., 2019], AgentPrune [Zhang et al., 2024a], G-Designer [Zhang et al., 2024b], and GTD [Jiang et al., 2025].Source: §2.2 · p. 2
  • DyTopo’s stated distinction is interpretable inference-time routing: textual Need and Offer descriptors induce a directed topology each round through semantic similarity.Source: §2.2 · p. 2

3. Methods

DyTopo reconstructs a directed communication graph at each round from agents’ information needs and offered capabilities, under a Manager that updates goals and context. A synchronization barrier, sparse routing, and deterministic message ordering govern how private messages enter agents’ next-round memories.

3. Methods

  • DyTopo formalizes interaction as a dynamic computation graph reconstructed each round under a Manager-specified goal, with the Manager updating context and deciding when to halt.The Manager aggregates public information into a global state and provides refined guidance for unresolved subgoals.Source: §3 · p. 2, §3.5.1 · p. 5, §3.5.2 · p. 6

3.2.1. SINGLE-PASS INFERENCE AND DESCRIPTOR GENERATION

  • Each worker makes one forward pass per round, producing task messages and lightweight natural-language query and key descriptors from its role, round goal, and local memory.Queries describe what an agent seeks; keys describe what it can provide.Source: §3.2.1 · p. 3, §3.1 · p. 3

3.2.2. SYNCHRONIZATION BARRIER AND CONTEXT UPDATE

  • A synchronization barrier routes private messages only after graph induction, then appends selected incoming messages to recipients’ next-round memories in a deterministic order.For acyclic graphs, DyTopo uses a topological sort; for cyclic graphs, it uses a greedy cycle-breaking heuristic based on restricted in-degree.Source: §3.2.2 · pp. 3–4, §3.4.2 · p. 5

3.3.1. SEMANTIC ALIGNMENT QUANTIFICATION

  • DyTopo embeds queries and keys, scores need–capability alignment with cosine similarity, and activates directed provider-to-consumer edges above a sparsity threshold.The threshold controls graph sparsity, while excluding self-loops; active edges determine which private messages are eligible for routing.Source: §3.3.1 · p. 4, §3.3.2 · p. 4, §3.3 · p. 4

3.3.3. TOPOLOGY ADAPTATION AND ROUTING SEMANTICS

  • Descriptors are recomputed as agent states and Manager context evolve, so links can change when capabilities become relevant or information needs are satisfied.The threshold also limits irrelevant message traffic and context overload.Source: §3.3.3 · p. 4

3.5. Meta-Control and Workflow Orchestration

  • The Manager aggregates public information into a global state, updates the next-round context, and can terminate the interaction, forming a feedback loop alongside round-level topology adaptation.The aggregation operator concatenates information in an order-preserving way, while refined context directs attention to unresolved subgoals.Source: §3.5.1 · p. 5, §3.5.2 · p. 6, §3.5.3 · p. 6

4. Experiments

The experiments use difficulty-graded code-generation and mathematical-reasoning benchmarks, evaluate multiple LLM backbones, and allow manager-controlled early stopping within a round cap.

4.1. Datasets

  • The suite spans code generation and mathematical reasoning, with difficulty graded from function-level correctness to competition- and Olympiad-level problem solving.It is designed to test reliability as task complexity and reasoning depth increase.Source: §4.1 · p. 6
  • HumanEval tests Python docstring understanding and function-level correctness, while 100 APPS Competition problems test more complex contest-style programming.APPS tasks typically require edge-case handling and more sophisticated algorithmic design.Source: §4.1 · p. 6
  • MATH-500 probes multi-step reasoning, while 70 stratified Omni-MATH problems test long-horizon, often Olympiad-level solution trajectories.The Omni-MATH sample uses seven domains, with 10 problems per domain.Source: §4.1 · p. 6

4.2. Settings

  • DyTopo is evaluated with proprietary and open-weight LLM backbones, using all-MiniLM-L6-v2 embeddings and cosine similarity for semantic encoding.The evaluated backbones are mimo-v2-flash, GPT-oss-120B, Llama-3-8B-Instruct, and Qwen3-8B.Source: §4.2 · pp. 6–7
  • Runs allow manager-controlled early stopping when task-specific completion criteria are met, with a hard cap of Tmax rounds.The communication-round ablation disables halting and forces exactly T rounds.Source: §4.2 · p. 7

5. Results

DyTopo outperforms non-DyTopo baselines across benchmarks and backbones, while analyses show that useful communication rounds and routing sparsity vary by task. Its evolving graphs provide an interpretable trace of stage-wise coordination.

5. Results

  • The results section reports benchmark performance, round-count effects, qualitative topology evolution, and ablations of the semantic-similarity threshold.Token usage and latency analysis is included in Appendix D.1.Source: §5 · p. 7

5.1. Main results across benchmarks

  • DyTopo is best in all 16 backbone–dataset settings, beating the strongest non-DyTopo baseline by 0.90–17.14 points (mean +6.09).The reported gains span code generation and mathematical reasoning across four LLM backbones.Source: §5.1 · p. 7
  • Harder math benchmarks show pronounced gains: Math-500 improves by up to +17.14 (Llama3-8B: 47.14 vs. 30.00), and Omni-Math by up to +15.72 (Qwen3-8B: 51.43 vs. 35.71).Code-generation gains include +9.11 on APPS-Competition with GPT-oss-120B (69.66 vs. 60.55) and +9.14 on HumanEval with Qwen3-8B (89.63 vs. 80.49).Source: §5.1 · p. 7
  • Random Topology helps inconsistently, whereas DyTopo improves uniformly, indicating that multi-round interaction alone is not sufficient.The accompanying analyses examine round count, topology evolution, and the similarity-threshold sparsity trade-off.Source: §5.1 · p. 7

5.2. Effect of communication rounds

  • Performance varies non-monotonically with communication rounds: HumanEval peaks at round 5 (92.07%), while Math-500 peaks at round 9 (87.14%).HumanEval performance slightly degrades with additional rounds, whereas Math-500 continues improving longer; the optimal communication budget is task-dependent.Source: §5.2 · p. 7, Figure 3 · p. 7

5.3. Topology evolution and interpretability

  • A representative code-generation trace shifts from broad exploratory routing to selective verification and feedback, then prunes to a dependency-minimal graph for assembling the formatted solution.The evolving graphs expose which agent pairs are structurally critical at each stage and offer a debugging handle.Source: §5.3 · pp. 7–8, Figure 4 · p. 8

5.4. Ablation on Q-K similarity threshold

  • The similarity threshold has a dataset-dependent optimum: APPS-Competition performs best at τ = 0.3 (49.81%), while Omni-Math performs best at τ = 0.4 (52.86%).Low thresholds create overly dense routing and irrelevant traffic; high thresholds can prevent useful information flow, making sparsity a practical performance-control knob.Source: §5.4 · p. 8, Table 3 · p. 8

6. Conclusion

DyTopo dynamically rewires a sparse directed communication graph each round by semantically matching agents’ natural-language query and key descriptors. Across code-generation and mathematical-reasoning benchmarks and multiple backbones, it consistently outperforms fixed- and random-topology baselines, with task-sensitive communication budget and sparsity.

6. Conclusion

  • DyTopo dynamically rewires a sparse directed communication graph each round through semantic matching between agents’ natural-language query (need) and key (offer) descriptors.The framework aligns information flow with stage-dependent goals and provides an interpretable coordination trace through evolving graphs.Source: §6 · p. 8

Impact Statement

DyTopo aims to support reliable, interpretable multi-round reasoning through dynamic message routing. The paper notes deployment risks from misleading descriptors and sensitive coordination logs.

Impact Statement

  • Misleading descriptors can cause misrouting and error propagation.The impact statement also flags misuse risks and privacy concerns when messages or coordination traces are logged in sensitive settings.Source: Impact Statement · p. 9
  • The intended impact is more reliable and interpretable multi-round reasoning, including code generation and mathematical problem solving.Source: Impact Statement · p. 9
  • The authors recommend safety filters, secure logging, and application-specific guardrails for deployment.Source: Impact Statement · p. 9

A. Complexity Analysis

DyTopo retains quadratic graph-construction cost but sparsifies the messages processed by agents. Its semantic-matching overhead is described as negligible beside LLM inference.

A.1. Computational Complexity

  • DyTopo computes N^2 pairwise similarities, while routing about ρN^2 active edges, with ρ ≪ 1, reduces subsequent context processing.The reduced relevant-neighbor contexts avoid context-window overflow and irrelevant distraction.Source: §A.1 · p. 11
  • Fully connected systems have O(N^2) message-passing complexity per round because every agent attends to every other agent’s output.Source: §A.1 · p. 11
  • Semantic-matching overhead is described as negligible: embedding latency is milliseconds, compared with seconds for LLM generation.The paper states that this adds no significant latency bottleneck.Source: §A.1 · p. 11

B. Implementation Details

The implementation specifies JSON-formatted manager and worker prompts, domain-specific agent roles, and semantic descriptors for routing. It also defines embedding and topology baselines for experiments.

B.1. System Prompts and Templates

  • System prompts enforce strict JSON output formats to extract key and query descriptors.Source: §B.1 · p. 11

B.1.1. CODE GENERATION AGENTS

  • Code-generation experiments use Developer, Researcher, Tester, and Designer workers, with the manager stopping only when code exists and tests pass.Workers share a role-specific prompt template that includes public and private content plus query and key fields.Source: §B.1.1 · pp. 11–12

B.1.2. MATHEMATICAL REASONING AGENTS

  • Math reasoning uses ProblemParser, Solver, Verifier, and Manager agents, with domain-specific query and key descriptors embedded for routing.Table 5 outlines math-agent responsibilities; Table 6 gives representative descriptors.Source: §B.1.2 · pp. 12–13, Table 5 · p. 13, Table 6 · p. 14

B.2. Model Configurations

  • The semantic encoder is all-MiniLM-L6-v2, and baselines include random sparse links, a reused static graph, and AgentScope’s fixed sequential and hub pattern.The random-topology baseline matches DyTopo’s sparsity to isolate semantic routing from graph sparsity.Source: §B.2 · p. 14

D.1. Token Usage and Latency Analysis

On HumanEval, DyTopo combines the highest reported accuracy with lower token use and latency than the fixed-horizon AgentScope baseline. Its manager-controlled stopping and sparse routing accompany convergence in an average of 2.6 rounds.

D.1. Token Usage and Latency Analysis

  • The HumanEval efficiency comparison uses the mimo-v2-flash backbone and contrasts single-turn, random-topology, and AgentScope configurations with DyTopo.The listed multi-round baselines use four workers and five rounds; the single-turn ensemble uses four workers and one round.Source: §D.1 · pp. 14–15
  • AgentScope uses 19,520 tokens, while Random Topology uses 15,783 and scores 88.17%, below the single-turn ensemble’s 88.41%.The authors attribute the fixed-horizon systems’ resource use to five-round execution; AgentScope also generates substantial intermediate reasoning tokens.Source: §D.1 · p. 15
  • 22.3s latency for DyTopo versus 39.8s for AgentScope; the paper attributes the reduction to fewer rounds and sparse routing that shortens inference contexts.Source: §D.1 · p. 16
  • 92.07% accuracy with 9,453 tokens—48% of AgentScope’s 19,520—and 2.6 average rounds: DyTopo has the highest reported accuracy on HumanEval.The table summarizes token use and latency for the HumanEval comparison.Source: §D.1 · pp. 15–16, Table 8 · p. 16

E.1. Topology Evolution Trace: A Case Study

The case study traces communication shifting from algorithm selection to targeted verification and finalization as task needs change. Real examples from the palindrome task also show how key-query descriptors induce edges.

E.1. Topology Evolution Trace: A Case Study

  • The four-worker case involves a Researcher, Developer, Tester, and Designer, with the manager requesting final formatting and docstring compliance after tests passed.The trace concerns the HumanEval palindrome task.Source: §E.1 · pp. 16–17
  • In Round 1, the Researcher proposed KMP/Manacher while the Developer drafted code, and their matching descriptors formed a Researcher-to-Developer edge scored 0.52.The Developer sought an efficient algorithm and complexity guidance, matching the Researcher’s offer of candidate algorithms and complexity considerations.Source: §E.1 · p. 16
  • In Round 2, focus shifted to correctness as the Tester generated a comprehensive test suite to verify the code against specific cases.A Developer-to-Tester edge scored 0.77 when the Tester’s request for implementation matched the Developer’s offer, routing code directly for validation.Source: §E.1 · p. 16
  • The trace shifts from broad algorithmic discussion to targeted verification, aligning the communication structure with stage-dependent task needs.The final graph becomes sparse as the manager aggregates outputs and the system converges.Source: §E.1 · p. 17

E.2. Examples of Semantic Key-Query Matching

  • Table 9 presents real key and query descriptors from the palindrome task alongside the resulting edge formation.The examples illustrate how natural-language descriptors are used to induce connectivity.Source: Table 9 · p. 17, §E.2 · p. 17
Loading 2602.06039v1…