Large language models (LLMs) have demonstrated exceptional reasoning capabilities, enabling them to solve various complex problems. Recently, this ability has been applied to the paradigm of tool learning. Tool learning involves providing examples of tool usage and their corresponding functions, allowing LLMs to formulate plans and demonstrate the process of invoking and executing each tool. LLMs can address tasks that they cannot complete independently, thereby enhancing their potential across different tasks. However, this approach faces two key challenges. First, redundant error correction leads to unstable planning and long execution time. Additionally, designing a correct plan among multiple tools is also a challenge in tool learning. To address these issues, we propose Tool-Planner, a task-processing framework based on toolkits. Tool-Planner groups tools based on the API functions with the same function into a toolkit and allows LLMs to implement planning across the various toolkits. When a tool error occurs, the language model can reselect and adjust tools based on the toolkit. Experiments show that our approach demonstrates a high pass and win rate across different datasets and optimizes the planning scheme for tool learning in models such as GPT-4 and Claude 3, showcasing the potential of our method. Our code is public at \url{https://github.com/OceannTwT/Tool-Planner}
翻译:大语言模型(LLMs)已展现出卓越的推理能力,使其能够解决各类复杂问题。近期,这种能力被应用于工具学习范式。工具学习通过提供工具使用示例及其对应功能,使大语言模型能够制定规划并展示调用执行各工具的过程。大语言模型可借此处理其无法独立完成的任务,从而提升其在不同任务中的潜力。然而,该方法面临两个关键挑战:首先,冗余的错误修正会导致规划不稳定和执行时间延长;其次,在多个工具间设计正确的规划方案亦是工具学习中的难点。为解决这些问题,我们提出了Tool-Planner——一个基于工具包的任务处理框架。Tool-Planner将具有相同功能的API函数对应的工具分组为工具包,并允许大语言模型跨不同工具包实施规划。当工具出现错误时,语言模型可基于工具包重新选择并调整工具。实验表明,我们的方法在不同数据集上均表现出较高的通过率和胜率,并优化了GPT-4、Claude 3等模型中工具学习的规划方案,展现了本方法的潜力。代码已公开于\url{https://github.com/OceannTwT/Tool-Planner}。