Efficient and Scalable Estimation of Tool Representations in Vector Space
作者: Suhong Moon, Siddharth Jha, Lutfi Eren Erdogan, Sehoon Kim, Woosang Lim, Kurt Keutzer, Amir Gholami
分类: cs.LG, cs.AI, cs.CL
发布日期: 2024-09-02
🔗 代码/项目: GITHUB
💡 一句话要点
提出高效可扩展的工具表示估计方法以解决LLM工具检索问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 工具检索 大型语言模型 合成数据 小型编码器 多标签分类 工具嵌入 逐步检索
📋 核心要点
- 现有方法在处理大量工具时面临上下文窗口限制,导致检索效率低下和准确性不足。
- 本文提出了一种合成数据生成框架和小型编码器模型驱动的工具检索策略,以提高工具检索的效率和准确性。
- 在ToolBench和ToolBank数据集上,所提方法在Recall@K指标上分别提升了27.28和30.5,验证了其有效性。
📝 摘要(中文)
近年来,功能调用和工具使用的进展显著增强了大型语言模型(LLMs)的能力,使其能够与外部信息源交互并执行复杂任务。然而,LLMs的有限上下文窗口在可用工具数量较多时带来了挑战,迫切需要高效的方法来管理提示长度并保持准确性。现有方法如微调LLMs或利用其推理能力,往往需要频繁的再训练或产生显著的延迟开销。为此,本文提出了一种新颖的框架,用于生成工具检索应用的合成数据,并利用小型编码器模型实现高效的数据驱动工具检索策略。我们创建了ToolBank,一个反映真实用户使用情况的工具检索数据集,并提出了三种新方法以提升工具检索效果。
🔬 方法详解
问题定义:本文旨在解决大型语言模型在工具检索中的效率和准确性问题。现有方法如微调和推理能力利用存在频繁再训练和延迟开销等痛点。
核心思路:提出通过生成合成数据和使用小型编码器模型来高效检索相关工具,避免了频繁的模型重训练。
技术框架:整体架构包括合成数据生成、工具嵌入生成(Tool2Vec)、逐步检索方法(ToolRefiner)和多标签分类框架(MLC),各模块协同工作以提升检索效果。
关键创新:最重要的创新在于Tool2Vec工具嵌入生成和ToolRefiner逐步检索方法,这些方法通过使用用户驱动的数据和迭代优化显著提升了工具检索的质量。
关键设计:在模型设计上,采用了小型编码器模型,结合特定的损失函数和参数设置,以确保在保持高效性的同时提升检索准确性。
🖼️ 关键图片
📊 实验亮点
在ToolBench和ToolBank数据集上,所提方法在Recall@K指标上分别提升了27.28和30.5,显示出显著的性能改进。这些结果表明,新的工具检索策略在实际应用中具有较高的有效性和可行性。
🎯 应用场景
该研究的潜在应用领域包括智能助手、自动化工具管理和复杂任务执行等。通过高效的工具检索方法,用户能够更快速地获取所需工具,从而提高工作效率和决策质量。未来,该方法有望在更多领域推广应用,推动智能系统的进一步发展。
📄 摘要(原文)
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}