Divide-Then-Aggregate: An Efficient Tool Learning Method via Parallel Tool Invocation
Dongsheng Zhu, Weixian Shi, Zhengliang Shi, Zhaochun Ren, Shuaiqiang Wang, Lingyong Yan, Dawei Yin
TL;DR
This work tackles the inefficiencies of real-world tool usage by LLMs, which are most often addressed with sequential or backtracking approaches. It introduces DTA-Llama, a DAG-based parallel tool invocation framework that divides tasks into parallel sub-tasks and aggregates their results, coupled with a Process/Threads inference architecture to execute these plans efficiently. The model is trained on a DAG-transformed dataset (DTA-Tool) derived from serial tool trajectories and evaluated on StableToolBench, where it achieves superior solvable rates and reduced token and inference costs, even matching GPT-3.5 function calling under certain conditions. The results demonstrate improved scalability and generalization across multiple LLM sizes, underscoring the practical impact of parallel tool invocation for real-world task solving.Overall, DTA-Llama advances tool learning by enabling richer per-round perception and faster execution, with broad implications for deploying capable, cost-efficient LLM agents in interactive environments.
Abstract
Although current Large Language Models (LLMs) exhibit impressive capabilities, performing complex real-world tasks still requires tool learning. Mainstream methods, such as CoT/ReAct, rely on step-by-step tool invocation to interact with external environments, but they are limited in perceptual scope and lack adequate task-planning capability. To address these limitations, other studies introduce the first Search-based Decision Tree (DFSDT), which still suffers from the high computational cost. In this paper, we introduce a novel parallel tool invocation paradigm, DTA-Llama (Divide-Then-Aggregate Llama). First, we transform traditional tree-based tool search paths into Directed Acyclic Graph (DAG) structure, generating a high-quality parallel tool invocation dataset. The DTA-Llama is then trained on the dataset to learn to iteratively divide the current task into several parallel tool invocation sub-tasks and aggregate the invocation results to decide the next actions. Furthermore, we introduce an efficient inference framework inspired by the Process/Threads mechanism when applying the DTA-Llama to practical tasks. Experimental results show that our approach substantially enhances task performance while reducing token consumption and inference time. Llama2-7B, using our method, is comparable to the official parallel function calling method of GPT-3.5. The relevant code, dataset, and model weights are available at https://corn0205.github.io/
