While enabling large language models to implement function calling (known as APIs) can greatly enhance the performance of Large Language Models (LLMs), function calling is still a challenging task due to the complicated relations between different APIs, especially in a context-learning setting without fine-tuning. This paper introduces ``Reverse Chain'', a controllable, target-driven approach designed to empower LLMs with the capability to operate external APIs only via prompts. Recognizing that most LLMs have limited tool-use capabilities, Reverse Chain limits LLMs to executing simple tasks, e.g., API Selection and Argument Completion. Furthermore, to manage a controllable multi-function calling, Reverse Chain adopts a generic rule based on a backward reasoning process. This rule determines when to do API selection or Argument completion. To evaluate the multi-tool-use capability of LLMs, we have released a compositional multi-tool task dataset, available at \url{https://anonymous.4open.science/r/reverse-chain-8681}. Extensive numerical experiments validate the remarkable proficiency of Reverse Chain in managing multiple API calls.
翻译:虽然使大语言模型能够实现函数调用(即API)可以显著提升大语言模型的性能,但由于不同API之间存在复杂关联,特别是在无微调的上下文学习场景中,函数调用仍然是一项具有挑战性的任务。本文提出"反向链"——一种可控的、目标驱动的方法,旨在通过仅使用提示赋予大语言模型操作外部API的能力。针对多数大语言模型工具使用能力有限的问题,反向链将其限制于执行简单任务(如API选择和参数补全)。此外,为管理可控的多函数调用,反向链采用基于逆向推理过程的通用规则,该规则能动态决定何时执行API选择或参数补全。为评估大语言模型的多工具使用能力,我们发布了组合式多工具任务数据集(见匿名链接https://anonymous.4open.science/r/reverse-chain-8681)。大量数值实验验证了反向链在管理多API调用方面的卓越能力。