arXiv:2501.12432cs.LGcs.AI2025-01ACL被引 17

让大模型并行调用工具,提速降耗还更准。

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

  • 将工具调用路径转为有向无环图,支持并行执行。
  • 在Llama2-7B上性能接近GPT-3.5官方并行调用方法。
  • 适合需要高效执行复杂任务的系统开发场景。

尽管大型语言模型具备强大能力,但在完成复杂现实任务时仍需工具学习。主流方法如CoT/ReAct依赖逐步调用外部工具,存在感知范围窄、任务规划能力不足的问题。现有研究引入基于搜索的决策树(DFSDT),但计算成本过高。本文提出一种新的并行工具调用范式DTA-Llama,将传统树状调用路径转化为有向无环图(DAG)结构,构建高质量并行工具调用数据集。在此基础上训练的DTA-Llama可迭代地将任务拆分为多个并行子任务,并聚合结果决定下一步动作。此外,设计了一种受进程/线程机制启发的高效推理框架。实验表明,该方法显著提升任务性能,同时降低令牌消耗与推理时间。使用本方法的Llama2-7B在性能上媲美GPT-3.5官方并行函数调用方案。相关代码、数据集及模型权重已公开于https://corn0205.github.io/

原文摘要 · Abstract (English)

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/

工具调用并行推理大模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。