让大模型直接生成工具调用,无需额外检索。
ToolGen: Unified Tool Retrieval and Calling via Generation
- 将工具编码为特殊标记,融入模型参数中。
- 在47000+工具测试中表现更优,任务完成率更高。
- 适合构建自主智能体,提升大模型实用性。
随着大语言模型(LLMs)的发展,其无法自主通过直接调用外部工具执行任务仍是关键瓶颈。传统方法依赖将工具描述作为上下文输入,受限于上下文长度且需额外检索机制。我们提出ToolGen,一种范式转变:将每个工具表示为唯一标记并直接嵌入模型参数,使模型在生成下一个词时即可自动生成工具调用及参数,实现工具调用与语言生成的无缝融合。该框架使模型无需额外检索步骤即可访问和使用海量工具,显著提升性能与可扩展性。实验结果表明,在超过47,000个工具上,ToolGen不仅在工具检索和自主任务完成方面表现更优,更为跨领域工具适应的AI智能体开启新可能。通过将工具检索转变为生成过程,ToolGen推动更灵活、高效、自主的AI系统发展。该方法支持端到端工具学习,可与思维链、强化学习等技术结合,拓展大模型实际应用能力。
原文摘要 · Abstract (English)
As large language models (LLMs) advance, their inability to autonomously execute tasks by directly interacting with external tools remains a critical limitation. Traditional methods rely on inputting tool descriptions as context, which is constrained by context length and requires separate, often inefficient, retrieval mechanisms. We introduce ToolGen, a paradigm shift that integrates tool knowledge directly into the LLM's parameters by representing each tool as a unique token. This enables the LLM to generate tool calls and arguments as part of its next token prediction capabilities, seamlessly blending tool invocation with language generation. Our framework allows the LLM to access and utilize a vast amount of tools with no additional retrieval step, significantly enhancing both performance and scalability. Experimental results with over 47,000 tools show that ToolGen not only achieves superior results in both tool retrieval and autonomous task completion but also sets the stage for a new era of AI agents that can adapt to tools across diverse domains. By fundamentally transforming tool retrieval into a generative process, ToolGen paves the way for more versatile, efficient, and autonomous AI systems. ToolGen enables end-to-end tool learning and opens opportunities for integration with other advanced techniques such as chain-of-thought and reinforcement learning, thereby expanding the practical capabilities of LLMs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。