HieraMAS: Optimizing Intra-Node LLM Mixtures and Inter-Node Topology for Multi-Agent Systems
Organizations: Mohamed bin Zayed University of Artificial Intelligence, Abu Dhabi, UAE.
Abstract
Multi-agent systems (MAS) built on large language models (LLMs) have shown strong performance across many tasks. Most existing approaches improve only one aspect at a time, such as the communication topology, role assignment, or LLM routing, while treating each agent as a single, indivisible unit. This misses the opportunity to use mixtures of LLMs within an agent to strengthen role-specific abilities. We propose HieraMAS, a hierarchical collaboration framework that combines intra-node LLM mixtures with an inter-node communication topology. HieraMAS introduces supernodes, where each functional role is implemented by multiple heterogeneous LLMs using a propose-synthesis structure. Optimizing HieraMAS creates unique credit-assignment challenges: final task performance depends heavily on the underlying LLMs' capabilities, which can lead reinforcement methods to incorrectly reward suboptimal configurations. To address this, we use a two-stage algorithm: (1) multi-level reward attribution, which provides fine-grained feedback at both the node level and the overall system level; (2) graph classification for topology selection, which treats choosing the communication structure as a holistic decision rather than optimizing edges one by one. Experiments on reasoning and coding benchmarks show that HieraMAS substantially outperforms existing methods while also delivering better cost-performance trade-offs.
Figures & tables
| HumanEval++ | MATH | MMLU-Redux | |||||||||
| Method | Multi | Topo | Role | Node | GPT-5-Mini | Qwen3-80B | GPT-5-Mini | Qwen3-80B | GPT-5-Mini | Qwen3-80B | Avg. |
| Base | ✗ | ✗ | ✗ | ✗ | 89.06 | 84.14 | 77.78 | 74.44 | 92.00 | 82.40 | 83.14 |
| CoT | ✗ | ✗ | ✗ | ✗ | 87.50 | 85.94 | 92.22 | 90.00 | 93.60 | 89.60 | 89.81 |
| Self-Consistency | ✓ | ✗ | ✗ | ✗ | 89.06 | 87.50 | 93.33 | 91.11 | 94.40 | 83.20 | 89.77 |
| Self-Consistency+CoT | ✓ | ✗ | ✗ | ✗ | 90.62 | 85.94 | 94.44 | 92.22 | 93.60 | 92.80 | 91.60 |
| LLM-Debate | ✓ | ✗ | ✗ | ✗ | 87.50 | 87.50 | 94.44 | 94.44 | 92.80 | 92.00 | 91.45 |
| MATH | MMLU-Redux | |||
| Variant | Acc | Cost | Acc | Cost |
| w/o Graph | 93.33 | 1.57 | 92.00 | 1.36 |
| w/o LLM Selection | 97.78 | 2.56 | 94.40 | 3.92 |
| Ours | 96.67 | 1.52 | 95.20 | 1.29 |
| Method | GPT-5-Mini | Qwen3-80B |
|---|---|---|
| SC+CoT | 68.00 | 64.00 |
| AFlow | 72.00 | 68.00 |
| GDesigner | 72.00 | 68.00 |
| MASRouter | 56.00 | 68.00 |
| Ours | 68.00 | 72.00 |
| Method | HumanEval++ | MATH | MMLU |
|---|---|---|---|
| GDesigner | 1.33 | 2.16 | 3.66 |
| MASRouter | 0.12 | 0.32 | 0.15 |
| Ours | 0.53 | 1.52 | 1.29 |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Symbol | Description | Symbol | Description |
| Search Space & Supernode Structure | |||
| Search space | Supernode with role | ||
| Pool of LLM backbones | Role for supernode , | ||
| Set of predefined agent roles | Number of proposers per supernode | ||
| Space of graph topologies | LLM for -th proposer in supernode | ||
| Pool of candidate DAGs | LLM for synthesizer in supernode | ||
| Method | Acc (%) | Cost ($) |
|---|---|---|
| w/ 8 proposers | 88.80 | 2.32 |
| w/ 6 proposers | 91.20 | 1.97 |
| Ours (2 proposers) | 95.20 | 1.29 |
| Method | Acc (%) |
|---|---|
| w/ | 93.60 |
| w/ | 94.40 |
| Ours ( ) | 95.60 |
| MMLU-Redux Case Studies | |
|---|---|
| Case 1: Nutrition Question | Case 2: Communication Theory |
| Query: Which of the following appears to lower bad cholesterol? A. Vitamin D B. Niacin C. Thiamine D. Riboflavin | Query: According to “measurement,” what is the step that occurs between an individual gaining information and changing behavior? A. coorientation B. opinion change C. reaction formation D. semantic encoding |
| HumanEval Case Studies | |
|---|---|
| Case 1: Sum and Product | Case 2: Filter by Substring |
| Query: def sum_product(numbers: List[int]) -> Tuple[int, int]: """ For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list...""" | Query: def filter_by_substring(strings: List[str], substring: str) -> List[str]: """ Filter an input list of strings only for ones that contain given substring...""" |
| MATH Case Studies | |
|---|---|
| Case 1: Geometry Reflection | Case 2: Cone Volume |
| Query: Triangle with vertices , and is reflected over the -axis to form triangle . What is the length of a segment drawn from to ? | Query: The diameter of a cone is 30 decimeters. If the height is two times the radius, what is the volume of the cone in cubic decimeters? |
| Dataset | GDesigner | AFlow | MASRouter | Ours |
|---|---|---|---|---|
| MATH | $1.22 | $18.62 | $1.97 | $2.03 |
| HumanEval++ | $1.95 | $28.64 | $0.54 | $1.55 |
| MMLU-Redux | $3.51 | $13.94 | $0.46 | $1.85 |
| Model | Profile Description |
|---|---|
| qwen3-8b | Fast and efficient 8B parameter model from Alibaba. Very fast inference, low latency, cost-effective. Good for basic text generation and simple Q&A. Very low cost. |
| qwen3-80b | Powerful 80B mixture-of-experts model from Alibaba. Strong reasoning, excellent at complex tasks, good at math and coding. Good for complex reasoning and mathematical problem-solving. Medium-high cost. |
| deepseek-r1-14b | Math-focused 14B model optimized for reasoning. Excellent mathematical reasoning and step-by-step problem solving. Good for math problems and logical reasoning. Low-medium cost. |
| llama-8b | General-purpose 8B model from Meta. Well-balanced capabilities with good instruction following. Good for general tasks, conversation, and basic reasoning. Very low cost. |
| deepseek-v3 | State-of-the-art reasoning model with excellent performance. Top-tier reasoning, excellent at complex problems, strong coding ability. Good for complex reasoning and advanced math. Medium cost. |
| gemma-3-27b | Balanced 27B model from Google. Good balance of speed and capability with strong instruction following. Good for medium complexity tasks. Medium cost. |
| Role | Profile Description |
| Mathematical Reasoning Roles (MATH benchmark) | |
| Mathematical Analyst | Specialized in breaking down complex math problems. Identifies mathematical structure, defines variables, and sets up equations. Best for initial problem understanding and mathematical modeling. |
| Math Solver | Specialized in executing mathematical computations. Solves equations, performs calculations, and verifies numerical results. Best for carrying out calculations and deriving numerical answers. |
| Inspector | Specialized in reviewing and validating solutions. Checks solution correctness, identifies errors, and verifies final answers. Best for final verification and error catching. |
| Programming Roles (HumanEval benchmark) | |
| Project Manager | Specialized in design patterns and code structure. Coordinates solution strategy and organizes workflow. Best for complex problems requiring structured multi-step approaches. |