Efficient and Scalable Estimation of Tool Representations in Vector Space

Suhong Moon, Siddharth Jha, Lutfi Eren Erdogan, Sehoon Kim, Woosang Lim +2 more
9/2/2024
cs.LGcs.AIcs.CL

Official code: SqueezeAILab/Tool2Vec (32 stars, MIT, last commit 2024-09-05).

Abstract

Recent advancements in function calling and tool use have significantly enhanced the capabilities of large language models (LLMs) by enabling them to interact with external information sources and execute complex tasks. However, the limited context window of LLMs presents challenges when a large number of tools are available, necessitating efficient methods to manage prompt length and maintain accuracy. Existing approaches, such as fine-tuning LLMs or leveraging their reasoning capabilities, either require frequent retraining or incur significant latency overhead. A more efficient solution involves training smaller models to retrieve the most relevant tools for a given query, although this requires high quality, domain-specific data. To address those challenges, we present a novel framework for generating synthetic data for tool retrieval applications and an efficient data-driven tool retrieval strategy using small encoder models. Empowered by LLMs, we create ToolBank, a new tool retrieval dataset that reflects real human user usages. For tool retrieval methodologies, we propose novel approaches: (1) Tool2Vec: usage-driven tool embedding generation for tool retrieval, (2) ToolRefiner: a staged retrieval method that iteratively improves the quality of retrieved tools, and (3) MLC: framing tool retrieval as a multi-label classification problem. With these new methods, we achieve improvements of up to 27.28 in Recall@K on the ToolBench dataset and 30.5 in Recall@K on ToolBank. Additionally, we present further experimental results to rigorously validate our methods. Our code is available at \url{https://github.com/SqueezeAILab/Tool2Vec}

View on arXivView PDF

Code Implementations(1)

MIT

Efficient and Scalable Estimation of Tool Representations in Vector Space

324Shell, PythonAug 20, 20242 years agoMIT
bertdeberta-v3function-callingllmnatural-language-processing+4 more

Similar Papers

Cite this paper

@article{moon2024efficient,
  title  = {Efficient and Scalable Estimation of Tool Representations in Vector Space},
  author = {Suhong Moon and Siddharth Jha and Lutfi Eren Erdogan and Sehoon Kim and Woosang Lim and Kurt Keutzer and Amir Gholami},
  year   = {2024},
  eprint = {2409.02141},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2409.02141v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2409.02141.svg)](https://codeofpaper.com/paper/2409.02141)

Discussion