ToolGen: Unified Tool Retrieval and Calling via Generation

Renxi Wang, Xudong Han, Lei Ji, Shu Wang, Timothy Baldwin +1 more
2/12/2026

No official code found. Best implementation: Reason-Wang/ToolGen (184 stars, last commit 2025-03-26). 1 more below.

Abstract

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.

View on arXivView PDF

Code Implementations(2)

Reason-Wang/ToolGenCommunity100%

[ICLR 2025] The official implementation of paper "ToolGen: Unified Tool Retrieval and Calling via Generation"

18416Shell, PythonOct 4, 20241 years ago
agentllmnlpretrievaltool+3 more
jmanhype/ToolGenCommunity63%

Training Code Implementation of paper "ToolGen: Unified Tool Retrieval and Calling via Generation"

20PythonOct 9, 20246 months agoNOASSERTION

Similar Papers

Cite this paper

@article{wang2026toolgen,
  title  = {ToolGen: Unified Tool Retrieval and Calling via Generation},
  author = {Renxi Wang and Xudong Han and Lei Ji and Shu Wang and Timothy Baldwin and Haonan Li},
  year   = {2026},
  eprint = {2410.03439},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2410.03439},
  journal = {ICLR 2024 2024}
}

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/2410.03439.svg)](https://codeofpaper.com/paper/2410.03439)

Discussion