atlas

Research map / Large language models / Agents, code and math

ToolGen: Unified Tool Retrieval and Calling via Generation

ICLR 2025 · Large language models › Agents, code and math · approach: Long-horizon LLM agents · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes ToolGen, which represents each of ~47k tools as a unique virtual token in an LLM's vocabulary so the model retrieves and calls tools via next-token generation, trained in three stages (memorization, retrieval, end-to-end agent tuning).

Problem

Tool learning with tens of thousands of tools cannot put all tools in context, and separate retrieval pipelines are inefficient and misaligned with execution; LLMs also lack intrinsic knowledge of tools.

Approach

Atomic indexing maps each tool/API to one new vocabulary token initialized from its name embedding; the LLM is fully fine-tuned to memorize tool docs, generate tool tokens from queries, and run multi-turn agent trajectories without an external retriever, using constrained beam search to restrict outputs to valid tools.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
use ToolGen instead of ToolRetriever for multi-domain retrievalToolGen · Multi-Domain Retrieval I1/I2/I3NDCG1: 72.31 -> 87.67; 64.54 -> 83.46; 52.00 -> 79.00Helped
replace atomic indexing with semantic indexing (ablation)ToolGen · Multi-Domain Retrieval I1NDCG1: 87.67 -> 89.17Helped
replace atomic indexing with numeric indexing (ablation)ToolGen · Multi-Domain Retrieval I1NDCG1: 87.67 -> 83.17Hurt
replace atomic indexing with hierarchical indexing (ablation)ToolGen · Multi-Domain Retrieval I1NDCG1: 87.67 -> 85.67Hurt
remove tool memorization (ablation)ToolGen · Multi-Domain Retrieval I1NDCG1: 87.67 -> 84.00Hurt
remove retrieval training (ablation)ToolGen · Multi-Domain Retrieval I1NDCG1: 87.67 -> 10.17Hurt
remove constrained beam search (ablation)ToolGen · Multi-Domain Retrieval I1NDCG1: 87.67 -> 87.67No clear effect
add OpenHermes-2.5 instruction-following data during training (ablation)ToolGen · 3-shot GSM8Kaccuracy: 1.74 -> 62.02Helped
add OpenHermes-2.5 instruction-following data during training (ablation)ToolGen · StableToolBench unseen instructions, retrieverSoPR Avg.: 53.28 -> 58.84Helped
add OpenHermes-2.5 instruction-following data during training (ablation)ToolGen · StableToolBench unseen instructions, retrieverSoWR Avg.: 51.54 -> 54.24Helped
remove retrieval training (ablation)ToolGen Agent · StableToolBench unseen instructionsSoPR Avg.: 51.82 -> 52.42Mixed
remove tool memorization (ablation)ToolGen Agent · StableToolBench unseen instructionsSoPR Avg.: 51.82 -> 53.69Helped

Surprising findings

Limitations

Experimental setup

Datasets: ToolBench OpenHermes-2.5

Benchmarks: ToolBench StableToolBench ARC-C ARC-E CSQA Hellaswag Winogrande GSM8K

Metrics: NDCG@1 NDCG@3 NDCG@5 SoPR SoWR hallucination rate 3-shot accuracy

Baselines: BM25 EmbSim Re-Invoke IterFeedback ToolRetriever GPT-3.5 ToolLlama ToolLlama-2

Builds on: ToolBench Toolformer ToolkenGPT Agent-Flan StableToolBench

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy