Tree of Agents: Hierarchical Multi-Agent Design
- Tree of Agents is a design pattern that structures multi-agent systems via a hierarchical tree for controlled task decomposition and coordination.
- It enables dynamic delegation, prevents command cycles common in flat or linear arrangements, and adapts its structure to task complexity.
- Empirical results across domains like firmware analysis and long-context reasoning show enhanced reasoning depth, efficiency, and robust performance.
Searching arXiv for papers on "Tree of Agents" to ground the article and confirm relevant sources. Tree of Agents (TOA) is a family of hierarchical multi-agent organizations in which agents coordinate through a tree-structured topology or a tree-structured reasoning process rather than through a flat graph, a fixed linear chain, or a single monolithic controller. Across the recent literature, the term denotes several related but distinct constructions: a runtime-grown delegation hierarchy for firmware security analysis in FIRMHIVE (Zhang et al., 23 Nov 2025); a self-organizing leadership–executor structure for open-ended embodied tasks in S-Agents (Chen et al., 2024); a tree-search orchestration mechanism for adaptive multi-model sampling (Ye et al., 2024); and a long-context reasoning framework in which chunk-specialized agents exchange local cognitions along tree-structured paths (Yu et al., 8 Sep 2025). In each case, the tree is introduced to manage branching task decomposition, bounded coordination, and controlled information flow. This suggests that TOA is best understood not as a single algorithm, but as a design pattern for structuring multi-agent computation under depth, scale, or heterogeneity constraints.
1. Conceptual scope and recurrent design rationale
The recent TOA literature converges on a common diagnosis: fixed workflows and flat communication structures become brittle when tasks are open-ended, context-heavy, or require dynamic decomposition. In S-Agents, the contrast is made explicit through three organizational patterns: Graph of agents (GoA), defined by fully connected command edges; Chain of agents (CoA), defined by a fixed linear pipeline; and Tree of agents (ToA), defined as a directed hierarchy with one leader/root and multiple executors/leaves (Chen et al., 2024). GoA promotes rich communication but can create command cycles and chaotic behavior, whereas CoA avoids cycles but is rigid and cannot flexibly adapt workflow to changing circumstances. TOA is proposed there to preserve coordination while preventing command cycles and enabling flexible task decomposition.
A similar motivation appears in FIRMHIVE, but with different operational pressures. Firmware analysis is described as fundamentally different from ordinary coding tasks because a single firmware image may contain thousands of binaries, scripts, configs, and web assets arranged in nested directories, with long and implicit dependency chains (Zhang et al., 23 Nov 2025). The paper identifies three recurring demands—deep-chain reasoning, large-scale exploration, and cross-component correlation—and argues that a monolithic agent loses earlier evidence over long traces, while a static multi-agent pipeline is too rigid and cannot adapt its agent count, depth, or branching to the actual firmware structure. TOA is therefore introduced as a runtime-grown hierarchy that expands only as much as the observed firmware/task complexity requires.
The same anti-rigidity argument appears in adaptive inference orchestration. Tree Search-based Orchestrated Agents (TOA) treats model coordination as a multi-step decision-making process, optimizing generation structures dynamically for each input question rather than using fixed workflows such as parallel ensemble, sequential refinement, or layered mixture schemes (Ye et al., 2024). In long-context reasoning, TOA is framed as an answer to position bias / “lost in the middle”, noise accumulation in long inputs, and high computational cost: instead of forcing a single model pass over a long document, the method splits the document into chunks handled by separate agents, then lets those agents revisit chunks in different orders along a tree of reasoning paths (Yu et al., 8 Sep 2025).
These uses differ in control architecture, task domain, and formalism, but they share a structural premise: a tree can mediate decomposition and recomposition without the uncontrolled coupling of a dense graph and without the inflexibility of a fixed chain. A plausible implication is that TOA serves as a unifying abstraction for multi-agent systems that must balance locality of reasoning with system-level coordination.
2. Formal structures and organizational topologies
The most explicit graph-theoretic definition appears in S-Agents. The organization is represented as a graph
with vertices including agents and the environment. For TOA specifically,
where is the root agent, are leaf agents, and is the physical environment (Chen et al., 2024). The root-to-leaf communication edges are
while leaf-agent command edges are
The paper further emphasizes that the in-degree of each agent must be less than 1, preventing simultaneous conflicting directives. The resulting intuition is a directed arborescence-like hierarchy: one centralized decision-maker, several decentralized executors, and no command cycles.
FIRMHIVE defines TOA through a recursive runtime construction:
where the root receives firmware image and user prompt , 0 is the recursive procedure, and the two core modules are the Recursive Delegation Engine (RDE) and the Persistent Knowledge Hub (PKH) (Zhang et al., 23 Nov 2025). The tree is not fixed in advance; it grows as each agent observes its local object and decides whether to delegate further. Task decomposition is written in an object-target form as 1, where 2 is the current object and 3 is the analysis target. The paper states that the agent observes its local environment, extracts observable objects 4, and produces subtasks 5. The agent initialization is standardized as
6
This uniform configuration is central to the recursive spawning mechanism.
In adaptive sampling, TOA is formalized instead as an MDP over orchestration decisions:
7
At step 8, the state is
9
where 0 is the input and 1 is the set of prior responses. The action is
2
which selects a model 3 and a prior response 4 to condition on (Ye et al., 2024). Here the “tree” is not an organizational chart of persistent agents but a search structure over alternating model nodes and response nodes.
In long-context TOA, the document is represented as
5
split into 6 chunks 7, with each chunk assigned to one agent 8 (Yu et al., 8 Sep 2025). The tree emerges from branching chunk orders: if an agent has already read chunks 9, it may branch to chunk 0 or chunk 1, yielding paths such as 2 and 3. In this case, the tree is a structure over reasoning paths rather than a command hierarchy.
These formalizations differ substantially. Some TOA systems are rooted command trees; some are recursive delegation trees; some are search trees over inference actions; some are trees of reasoning traces. The shared invariant is not a single topology but a constraint: coordination is organized through branching parent–child structure with bounded, non-arbitrary connectivity.
3. Delegation, control, and information flow
A major line of variation in TOA systems concerns where delegation authority resides and how information is permitted to flow. FIRMHIVE makes the strongest departure from classical orchestrator-based multi-agent systems by treating delegation as a per-agent capability rather than an orchestrator-owned workflow (Zhang et al., 23 Nov 2025). Delegation is described as a “black box” with a simple interface from the parent’s perspective: construct a structured subtask, call delegate(subtask), wait, and receive a result. Internally, the system hides sub-agent instantiation, assignment, execution, and return. This is exposed through a reusable DelegationTool and Parallel DelegationTool, and the paper explicitly frames the mechanism as “delegation as an ability.”
FIRMHIVE’s coordination is decentralized in control but structured in communication. Each agent reasons locally, decides whether to spawn children, and passes down a task-object pair 4, where 5 is the current object in the firmware and 6 is the analysis target (Zhang et al., 23 Nov 2025). Communication is intentionally restricted to three channels: parent-to-child delegation, child-to-parent result return, and file-agent interaction with PKH. The parent does not share mutable state with children; each child starts in a fresh LLM instance with isolated context. The paper emphasizes that this isolation prevents context bleeding and reasoning drift. Cross-branch synthesis happens through PKH rather than direct messaging.
S-Agents adopts nearly the opposite control stance. The root agent 7 is the central command authority, responsible for observing the state of the environment and group, decomposing the global objective, assigning subtasks to leaves, monitoring execution progress, and dynamically reassigning work based on feedback (Chen et al., 2024). Leaf agents receive instructions, execute tasks in the environment, report progress or failure back to the root, and generally do not orchestrate other agents. Leaves can communicate but not command each other. The distinction between leadership and execution is presented as more human-like: leaders manage, workers execute.
Long-context TOA uses neither a strict root-leaf command structure nor recursive autonomous delegation. Each agent first generates a local cognition from its own chunk,
8
and stores its cognitive state in buffer 9 (Yu et al., 8 Sep 2025). During multi-perspective understanding, agents inspect the local cognitive states of other agents from shared memory and decide which additional chunks to read next. Information sharing occurs through these local cognitions rather than through imperative commands. This suggests a collaboration model based on selective evidence exchange rather than explicit task assignment.
Tree Search-based Orchestrated Agents introduces yet another pattern. The orchestration policy selects model-and-response actions using an MCTS-style selection rule, expands nodes, scores responses with a reward model, and backpropagates reward estimates through the search tree (Ye et al., 2024). The “agents” are distinct LLMs participating in a sequential sampling process, and coordination is mediated by the search policy rather than by a message-passing protocol.
Taken together, these systems show that TOA does not imply a single control doctrine. It may support centralized coordination, decentralized execution (Chen et al., 2024), or fully recursive local spawning without a global orchestrator (Zhang et al., 23 Nov 2025), or collaboration through shared intermediate reasoning artifacts (Yu et al., 8 Sep 2025), or search-controlled composition of heterogeneous models (Ye et al., 2024). The commonality lies in tree-bounded composition, not in identical delegation semantics.
4. Runtime growth, traversal patterns, and bounded search
A central property of many TOA systems is that the tree is not merely descriptive; it is constructed during execution. FIRMHIVE is the clearest instance of a runtime-grown TOA (Zhang et al., 23 Nov 2025). The tree begins from a single root agent and evolves with no fixed construction algorithm or predetermined shape. Its growth follows a firmware-aligned blueprint with three layers: directory agents, file agents, and function agents. Directory agents can spawn directory children for subdirectories, written as <dir → subdir>, and file agents for files, written as <dir → file>. File agents can spawn file-level parallel subtasks <file → file> and function agents for binaries <file → function>. Function agents perform call-chain analysis and may spawn tracer agents using <function → function> to follow paths toward sinks like system, strcpy, or sprintf.
The recursive delegation mechanism has two canonical patterns: parallel delegation 1 \rightarrow n, used when many objects must be inspected at once, and chained delegation 1 \rightarrow 1, used for sequential reasoning such as taint tracing across a call chain (Zhang et al., 23 Nov 2025). The paper gives an intuitive capacity estimate: if a parent performs about 3 reasoning steps and each child performs 4, recursive delegation can extend that to roughly 3 × 4 × 4 = 48 sequential steps, plus integration overhead. This is presented as an illustration of how a tree amplifies reasoning depth without relying on a single long context.
To keep runtime growth bounded and reproducible, FIRMHIVE imposes structural constraints: each agent operates within its task/context scope; delegation is only to immediate children; the structure must follow the firmware’s inherent hierarchy; and there are explicit termination conditions such as task completion, budget exhaustion, or unrecoverable failure (Zhang et al., 23 Nov 2025). The paper names depth limits such as D_max and per-agent step budget S_max, and in the evaluation setup fixes S_max = 30 and maximum delegation depth 4. Determinism is encouraged with temperature zero and fixed random seeds.
Long-context TOA also grows branching structures dynamically, though the branching object is a reasoning path rather than a task hierarchy (Yu et al., 8 Sep 2025). After chunk perception, each agent decides which other chunks are promising, stores these in 0, and incrementally refines its state when reading a new chunk:
1
The combinatorial growth in chunk-order paths is controlled by prefix-hash caching and adaptive pruning. Prefix-hash caching stores intermediate cognitions keyed by chunk sequences, reusing common prefixes such as 2 for both 3 and 4. Adaptive pruning halts expansion of branches whose current extension is judged useless, with the usefulness state stored in 5 (Yu et al., 8 Sep 2025).
Tree Search-based Orchestrated Agents likewise treats workflow evolution as iterative rather than fixed. The selection–expansion–simulation–backpropagation cycle repeats until 6 responses are collected, and early responses influence which responses are preserved and which models are tried next (Ye et al., 2024). The paper notes that model nodes are pruned more aggressively, while response nodes are expanded more broadly, reducing wasted search while preserving diverse future model choices.
Across these variants, runtime growth is paired with explicit bounding mechanisms: budget limits in FIRMHIVE, pruning and caching in long-context reasoning, and reward-guided search control in multi-agent sampling. This suggests that tree structure alone is not sufficient; practical TOA systems require branch-selection policies and termination rules to remain computationally viable.
5. Memory, evidence aggregation, and consensus
TOA systems differ not only in topology but also in the memory substrate through which branches are reconciled. FIRMHIVE introduces the Persistent Knowledge Hub (PKH) as persistent global memory rather than per-task memory (Zhang et al., 23 Nov 2025). Only file agents can interact with PKH, and PKH provides three tools: Store, Query, and Explore. The system supports a proactive loop—explore → query → enrich → store—which the paper presents as more active than ordinary RAG because it reasons over newly produced findings and uses file-level locking (fcntl.flock) to serialize writes. Parent-to-child communication passes only the structured tuple 7, while child-to-parent returns structured evidence. Function agents return vulnerability class, source-sink path, snippets, and machine-parsable trace metadata such as addresses and symbolic references; file agents aggregate file-level findings; directory agents aggregate child findings (Zhang et al., 23 Nov 2025). In this formulation, tree branches are reconciled through persistent evidence storage rather than through shared mutable dialogue context.
Long-context TOA instead relies on per-agent caches 8 plus a final two-tier consensus mechanism (Yu et al., 8 Sep 2025). Within each agent, the longest cached chunk sequence is selected as the best integrated context,
9
and a final local answer is produced from that path. Across agents, the final output is determined by majority vote:
0
If there is a tie, the implementation uses an additional independent agent as a tiebreaker. The paper explicitly links this structure to hallucination reduction: agents may return none if they cannot answer confidently, and majority voting reduces the chance that a single mistaken local inference dominates.
S-Agents uses a lighter-weight coordination memory. Agents perceive both the physical environment 1 and the agent group communication context 2, and the root relies on an LLM-based progress monitor that judges task completion from perceptual information, previous plan, recent dialogue, and sometimes chest information (Chen et al., 2024). The progress monitor outputs one of "success", "fail", or "unknown". This mechanism is essential because delegated leaf tasks must be monitored for dynamic reassignment. Memory here is operational rather than archival: it supports runtime progress tracking more than long-horizon evidential synthesis.
In Tree Search-based Orchestrated Agents, the search tree itself is the working memory. Newly generated responses are immediately scored by a reward model, and the reward is backpropagated along the selected path through updates of node value and visit count (Ye et al., 2024). The tree therefore stores not just candidate outputs but their estimated utility for future selection decisions.
A broader inference is that TOA architectures typically externalize some aspect of memory that would otherwise remain trapped in a single long prompt: structured evidence in PKH, cached reasoning prefixes in 3, progress states in dialogue-plus-monitor systems, or node values in a search tree. The memory substrate is thus a defining dimension of TOA design.
6. Empirical performance and domain-specific outcomes
The strongest quantitative TOA results in the supplied literature come from FIRMHIVE. Across five firmware security tasks 4–5, FIRMHIVE reportedly performs about 16× more reasoning steps than LLM-agent baselines and inspects about 2.3× more files, yielding about 5.6× more alerts per firmware (Zhang et al., 23 Nov 2025). The reported task-by-task values for FIRMHIVE are: reasoning steps 692.5 (T1), 1718.2 (T2), 1521.8 (T3), 443.2 (T4), and 5007.1 (T5); files accessed 57.2, 96.5, 64.6, 22.2, and 79.9; and alerts 10.3, 28.5, 12.1, 8.2, and 36.8. Against static-agent baselines in the T5 ablation, MAS+pipeline has only 0.40 ± 0.20 verified alerts and a Jaccard overlap of 0.11, MAS+orchestrator reaches 3.30 ± 1.10 alerts and 0.16 Jaccard, while FIRMHIVE reaches 36.8 ± 4.90 alerts and 0.78 Jaccard (Zhang et al., 23 Nov 2025). The stability study reports Jaccard similarity across repeated runs ranging from 0.84 on T1 to 0.76 on T5. End to end, FIRMHIVE finds 1,802 total alerts, compared with 1,109 for Mango and 644 for SaTC, and a manual evaluation of a random sample of 300 alerts from T5 finds that among alerts classified as TP by FIRMHIVE, 142/200 were confirmed as real vulnerabilities, corresponding to 71% precision (Zhang et al., 23 Nov 2025).
S-Agents evaluates TOA in Minecraft. For the “mine 50 logs” task with three agents, ToA outperformed both CoA and GoA, requiring only 7.5 minutes and 3.8 mean prompt times (mPT) (Chen et al., 2024). In collective collection tasks such as 50 or 100 logs, the paper reports time reductions of 5.1 and 7.2 minutes respectively for multi-agent TOA relative to solo execution. For harder tasks, solo agents often failed entirely. The behavioral analysis attributes these gains to conflict avoidance, division of labor, dynamic reassignment, and redundancy in open-world hazards (Chen et al., 2024).
Long-context TOA reports strong results on retrieval and question answering. On Needle-in-a-Haystack, TOA achieves 9.38 average score on single-needle and 7.77 average score on multi-needle, and the paper claims up to >50% improvement over baselines on single-needle and up to >100% improvement on multi-needle when haystack length varies from 1K to 128K (Yu et al., 8 Sep 2025). With LLaMA3.1-8B, the reported performance is 0.543 accuracy and 0.017 none-rate on DetectiveQA, and 0.450 accuracy and 0.043 none-rate on NovelQA. With DeepSeek-V3, TOA reports 0.573 accuracy and 0.140 none-rate on DetectiveQA, and 0.473 accuracy and 0.120 none-rate on NovelQA (Yu et al., 8 Sep 2025). The paper states that TOA with LLaMA3.1-8B is comparable to or even exceeds larger commercial models like Gemini 1.5-pro on some tasks. On efficiency, NovelQA with DeepSeek-V3 requires 2103 API calls for Phase 2 without caching/pruning, 1830 with caching only, and 1034 with caching + pruning, a 50.8% reduction relative to the no-cache/no-prune Phase-2 setting (Yu et al., 8 Sep 2025).
Tree Search-based Orchestrated Agents reports that TOA is the most compute-efficient approach across alignment, machine translation, and mathematical reasoning (Ye et al., 2024). On AlpacaEval 2.0 with 5 large models and 160 outputs per prompt, TOA achieves 71.8% LC win rate and 68.7% win rate. The abstract also reports a 72.2\% LC win rate on AlpacaEval, and the paper states that TOA achieves state-of-the-art performance on WMT (Ye et al., 2024).
These results should not be collapsed into a single benchmark narrative, since the term TOA spans distinct methods and problem classes. Still, the empirical record consistently associates tree-structured coordination with gains in either depth, breadth, efficiency, or robustness relative to monolithic, fixed-pipeline, or fully connected alternatives.
7. Relation to adjacent traditions, misconceptions, and limitations
A recurring misconception is that “Tree of Agents” names a single standardized framework. The literature instead uses the term for several distinct architectures. In S-Agents, TOA is a hierarchical command-and-execution structure with a root leader and non-commanding leaves (Chen et al., 2024). In FIRMHIVE, the defining feature is not central leadership but the elimination of a global orchestrator in favor of recursive per-agent delegation and a runtime-grown hierarchy (Zhang et al., 23 Nov 2025). In adaptive multi-agent sampling, TOA refers to a tree-search-based orchestration policy over distinct LLMs (Ye et al., 2024). In long-context reasoning, TOA denotes a chunk-based, training-free, plug-and-play framework in which agents exchange local cognitions along tree-structured reasoning paths (Yu et al., 8 Sep 2025). Treating these as equivalent would obscure substantive differences in control, memory, and semantics.
A second misconception is that TOA always means stronger centralization. The S-Agents paper indeed emphasizes centralized coordination and decentralized execution (Chen et al., 2024), but FIRMHIVE explicitly positions itself against orchestrator-based MAS, arguing that a central controller becomes a bottleneck and inherits the same context-window limits as a monolithic agent (Zhang et al., 23 Nov 2025). Thus tree structure can support either stronger hierarchy or stronger decentralization, depending on where delegation authority is installed.
The literature also records limitations and caveats. Tree Search-based Orchestrated Agents notes that reward-guided search can suffer from reward hacking, with scores improving under the learned reward model while later declining under external evaluation; it also finds that model diversity alone is insufficient and that successful collaboration depends on compatibility and consistency among models (Ye et al., 2024). Long-context TOA acknowledges that probing multiple chunk orders increases inference cost, even though caching and pruning mitigate the overhead (Yu et al., 8 Sep 2025). FIRMHIVE imposes explicit depth and step bounds, which implies that even runtime-grown trees remain subject to hard truncation under budget constraints (Zhang et al., 23 Nov 2025). S-Agents, although motivated by open-ended environments, depends on a strong root planner and progress monitor, which may itself become a practical bottleneck in more complex settings; this is a plausible implication of the design rather than an explicit claim.
In relation to older tree-based multi-agent formalisms, the attack-defence tree scheduling literature is relevant but semantically different. Those works study how an attack-defence tree can be compiled into a multi-agent scheduling problem, with optimization objectives of minimal attack time and minimal number of agents (Arias et al., 2021, Arias et al., 2023). They inform a broader “tree-to-agent synthesis” perspective, but they do not define TOA as a generic contemporary agent architecture.
The cumulative picture is that TOA has become a broad organizational idiom for agentic systems confronting branching tasks, long horizons, or heterogeneous evidence. The specific mechanisms—root leadership, recursive delegation, tree search, shared memory, majority voting, or reward-guided backpropagation—vary by domain. What unifies them is the use of a tree as the principal scaffold for decomposition, controlled interaction, and bounded recomposition.