ToolNet: Connecting Large Language Models with Massive Tools via Tool Graph

ToolNet: Connecting Large Language Models with Massive Tools via Tool Graph

29 Feb 2024 | Xukun Liu, Zhiyuan Peng, Xiaoyuan Yi, Xing Xie, Lirong Xiang, Yuchen Liu, Dongkuan Xu
**ToolNet: Connecting Large Language Models with Massive Tools via Tool Graph** **Authors:** Xukun Liu, Zhiyuan Peng, Xiaoyuan Yi, Xing Xie, Lirong Xiang, Yuchen Liu, Dongkuan Xu **Institutional Affiliations:** Northwestern University, North Carolina State University, Microsoft Research Asia **Abstract:** Large language models (LLMs) struggle with effectively using a vast array of external tools, often limited to a few specially designed tools. This paper introduces *ToolNet*, a framework that scales up the number of tools to thousands while maintaining moderate token consumption. *ToolNet* organizes tools into a directed graph, where each node represents a tool and weighted edges denote tool transitions. LLMs navigate this graph by iteratively selecting the next tool from its successors until the task is resolved. Extensive experiments on challenging multi-hop tool learning datasets demonstrate *ToolNet*'s effectiveness and resilience to tool failures. **Introduction:** The integration of LLMs with massive tools is a growing area of research, aiming to enhance real-world applications. However, existing methods struggle with token efficiency and the selection of appropriate tools from a large library. *ToolNet* addresses these challenges by organizing tools into a sparse directed graph, enabling efficient tool selection and dynamic updates based on tool performance. **Problem Formulation:** The interaction process involves LLMs taking environmental observations, generating verbal thoughts, and interacting with the environment using actions. The challenge lies in managing the long input context required for tool selection, which can lead to high token consumption. **ToolNet:** *ToolNet* provides a subset of tools to LLMs based on a policy and the previous action. The subset is derived from a weighted directed graph where nodes represent tools and edges denote transition weights. This approach ensures token efficiency and adaptability to new tools. **Graph Construction:** *ToolNet* constructs the graph through static or dynamic methods. Static construction uses tool-use trajectories to build the graph, while dynamic construction updates the graph based on tool performance, allowing for real-time adaptation. **Experiments:** *ToolNet* is evaluated on five datasets: SciQA, TabMWP, MATH, APIBank, and ToolBench. Results show that *ToolNet* outperforms existing methods in terms of answer quality and token efficiency, demonstrating resilience to noisy and task-irrelevant tools. **Conclusion:** *ToolNet* effectively connects LLMs with massive tools, enhancing performance and token efficiency. Future work will explore more powerful LLMs and further optimize the tool selection process.**ToolNet: Connecting Large Language Models with Massive Tools via Tool Graph** **Authors:** Xukun Liu, Zhiyuan Peng, Xiaoyuan Yi, Xing Xie, Lirong Xiang, Yuchen Liu, Dongkuan Xu **Institutional Affiliations:** Northwestern University, North Carolina State University, Microsoft Research Asia **Abstract:** Large language models (LLMs) struggle with effectively using a vast array of external tools, often limited to a few specially designed tools. This paper introduces *ToolNet*, a framework that scales up the number of tools to thousands while maintaining moderate token consumption. *ToolNet* organizes tools into a directed graph, where each node represents a tool and weighted edges denote tool transitions. LLMs navigate this graph by iteratively selecting the next tool from its successors until the task is resolved. Extensive experiments on challenging multi-hop tool learning datasets demonstrate *ToolNet*'s effectiveness and resilience to tool failures. **Introduction:** The integration of LLMs with massive tools is a growing area of research, aiming to enhance real-world applications. However, existing methods struggle with token efficiency and the selection of appropriate tools from a large library. *ToolNet* addresses these challenges by organizing tools into a sparse directed graph, enabling efficient tool selection and dynamic updates based on tool performance. **Problem Formulation:** The interaction process involves LLMs taking environmental observations, generating verbal thoughts, and interacting with the environment using actions. The challenge lies in managing the long input context required for tool selection, which can lead to high token consumption. **ToolNet:** *ToolNet* provides a subset of tools to LLMs based on a policy and the previous action. The subset is derived from a weighted directed graph where nodes represent tools and edges denote transition weights. This approach ensures token efficiency and adaptability to new tools. **Graph Construction:** *ToolNet* constructs the graph through static or dynamic methods. Static construction uses tool-use trajectories to build the graph, while dynamic construction updates the graph based on tool performance, allowing for real-time adaptation. **Experiments:** *ToolNet* is evaluated on five datasets: SciQA, TabMWP, MATH, APIBank, and ToolBench. Results show that *ToolNet* outperforms existing methods in terms of answer quality and token efficiency, demonstrating resilience to noisy and task-irrelevant tools. **Conclusion:** *ToolNet* effectively connects LLMs with massive tools, enhancing performance and token efficiency. Future work will explore more powerful LLMs and further optimize the tool selection process.
Reach us at info@study.space
[slides and audio] ToolNet%3A Connecting Large Language Models with Massive Tools via Tool Graph