Table of Contents
Fetching ...

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/

Divide-Then-Aggregate: An Efficient Tool Learning Method via Parallel Tool Invocation

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/
Paper Structure (40 sections, 1 equation, 10 figures, 6 tables)

This paper contains 40 sections, 1 equation, 10 figures, 6 tables.

Figures (10)

  • Figure 1: The top block depicts the comparison between CoT/ReAct, DFSDT and our proposed method. The bottom block provides the performance in four aspects of our method and baselines on benchmarks.
  • Figure 2: The figure illustrates the overall DTA-Llama pipeline. (a) depicts the construction of the DTA-Tool dataset and model training; (b) shows the tool invocation inference framework based on Process/Threads.
  • Figure 3: A comparison of all methods in terms of token consumption. The figure has two horizontal axes, representing Prompt and Completion, both measured in thousand tokens ($\mathit{K}$ tokens)).
  • Figure 4: A comparison of different LLMs after fine-tuning with our method and the baseline method.
  • Figure 5: The prompt used for data transformation: in this context, {query} represents the instruction from the user, while {conversations} refers to the original conversation content in the ToolBench data.
  • ...and 5 more figures