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

Yuxing Lu, Yucheng Hu, Xukai Zhao, Jiuxin Cao

TL;DR

Most multi-agent LLM frameworks rely on rigid, fixed communication structures that cause information overload or missed connections. DyTopo solves this by dynamically rewiring the agent communication graph every round, matching what agents need with what others can offer via natural language descriptors. This targeted, stage-dependent routing improves reasoning accuracy by an average of over 6 percentage points while cutting token costs by more than half.

What Problem Does This Paper Address?

Multi-agent LLM frameworks excel at breaking down complex tasks like coding or mathematical problem-solving. However, existing pipelines typically suffer from a major architectural flaw: they rely on static communication topologies. Whether agents broadcast to everyone or follow a rigid, pre-scripted turn-taking routine, the network structure remains identical from start to finish.

Iterative problem-solving is inherently stage-dependent. Early stages benefit from broad exploration and brainstorming, while later stages require precise, targeted verification to diagnose and fix specific errors. Forcing a dense, fixed communication structure throughout the entire process leads to "context overload"—flooding agents with irrelevant information—and introduces noise that can degrade performance over long reasoning horizons.

Methods

DyTopo models multi-agent interaction as a Dynamic Computation Graph (DCG) that is reconstructed at each reasoning round using a hierarchical, manager-guided approach:

  1. Manager Guidance: A Manager meta-agent sets a round-level goal and determines whether the system has converged or should terminate.
  2. Descriptor Generation (Query/Key): In each round, every worker agent performs a single forward pass. Along with their actual task messages, they output two short natural-language descriptors: a Query (what information they currently need) and a Key (what information they can provide).
  3. Semantic Matching Engine: DyTopo embeds these textual descriptors into a shared vector space using a lightweight embedding model (all-MiniLM-L6-v2). It then computes the cosine similarity between all queries and keys.
  4. Sparse Graph Construction: By applying a hard threshold ($\tau_{edge}$), DyTopo activates directed edges only between agents with high semantic alignment (Provider $\rightarrow$ Consumer). Private messages are routed only along these activated links.
  5. Deterministic Sequencing: To maintain prompt layout consistency and reproducibility, DyTopo uses topological sorting (or a greedy cycle-breaking heuristic if there are loops) to order incoming messages before updating an agent's memory.
Figure 2. DyTopo round-by-round routing via semantic matching. At each round t, each worker agent outputs a query and a key descriptor. A semantic matching module embeds these descriptors, computes pairwise similarity, and induces a directed graph G(t). Private messages produced at round t are routed according to G(t) after a synchronization barrier and are appended to recipients’ memories for round t+1. The Manager provides round goals and updates the next-round context, yielding a closed-loop adaptation across rounds.

Datasets

The authors evaluated DyTopo across four difficulty-graded benchmarks spanning two primary domains:

  • Code Generation: HumanEval (basic Python function correctness) and APPS-Competition (advanced, competitive programming problems testing edge cases and complex algorithmic design).
  • Mathematical Reasoning: MATH-500 (multi-step derivation across 7 domains) and Omni-MATH (expert, Olympiad-level math problems requiring long-horizon reasoning).

To prove model agnosticism, the framework was evaluated using four distinct LLM backbones: MiMo-V2-Flash, GPT-oss-120B, Llama3-8B-Instruct, and Qwen3-8B.

Key Insights and Ideas

  • Communication Needs Evolve: The optimal communication structure shifts dramatically over time. Visualizations show that early rounds feature dense, exploratory graphs where multiple roles exchange partial constraints, while later rounds prune down to sparse, highly targeted verification pathways.
  • More Communication Isn't Always Better: The paper reveals a non-monotonic relationship between the number of communication rounds and performance. For instance, HumanEval performance peaks at 5 rounds and then degrades as extra talk introduces unnecessary edits, whereas the harder Math-500 benchmark continues to benefit up to 9 rounds.
Figure 3. Performance change on communication rounds for Hu- manEval and Math-500. HumanEval achieves optimal perfor- mance (92.07%) at the 5th round, while Math-500 peaks (87.14%) at the 9th round, suggesting task-specific performances.
  • Sparsity is a Budget Control: The similarity threshold ($\tau_{edge}$) acts as a critical knob. Setting it too low floods agents with noise; setting it too high starves them of collaboration. The optimal threshold is task-sensitive (e.g., 0.3 for APPS vs. 0.4 for Omni-MATH).

Key Results

  • Consistent Performance Gains: DyTopo achieved the highest accuracy across all 16 backbone $\times$ dataset configurations, outperforming the strongest non-dynamic baseline by up to 17.14 points (on MATH-500 with Llama3-8B) with an overall mean improvement of +6.09 points.
  • High Token Efficiency: On HumanEval, DyTopo achieved a top accuracy of 92.07% while consuming only 48% of the tokens required by the standard AgentScope baseline (9,453 vs. 19,520 tokens). This efficiency is driven by the Manager's early-stopping capability and sparse routing.
  • Reduced Latency: Wall-clock time dropped significantly (e.g., 22.3s for DyTopo vs. 39.8s for AgentScope) because shorter context lengths mean faster LLM inference.

Limitations and Future Work

  • Descriptor Dependency: DyTopo relies heavily on the agents' ability to accurately self-describe their needs and offers. If an agent generates misleading or vague descriptors, it can cause misrouting and error propagation.
  • Hyperparameter Sensitivity: The similarity threshold ($\tau_{edge}$) must be manually tuned per dataset type to find the "sweet spot" between context starvation and noise overload.
  • Future Directions: Promising future work includes automating threshold selection dynamically and extending the framework to handle heterogeneous teams where agents use entirely different underlying LLM backbones.

Summary updated

Abstract

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.
BibTeX
@misc{lu2026dytopo,
  author = {Yuxing Lu and Yucheng Hu and Xukai Zhao and Jiuxin Cao},
  title = {{DyTopo: Dynamic Topology Routing for Multi-Agent Reasoning via Semantic Matching}},
  year = {2026},
  eprint = {2602.06039},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.06039},
}
Figure