Retrieval Models Aren't Tool-Savvy: Benchmarking Tool Retrieval for Large Language Models

Zhengliang Shi, Yuhan Wang, Lingyong Yan, Pengjie Ren, Shuaiqiang Wang, Dawei Yin, Zhaochun Ren

Abstract

Tool learning aims to augment large language models (LLMs) with diverse tools, enabling them to act as agents for solving practical tasks. Due to the limited context length of tool-using LLMs, adopting information retrieval (IR) models to select useful tools from large toolsets is a critical initial step. However, the performance of IR models in tool retrieval tasks remains underexplored. We introduce TOOLRET, a heterogeneous tool retrieval benchmark comprising 7.6k tasks and a corpus of 43k tools. Our evaluation reveals that even state-of-the-art IR models perform poorly on tool retrieval, significantly degrading the task pass rate of LLM agents. To address this, we contribute a large-scale training dataset of 200k instances, substantially optimizing tool retrieval capabilities.

Introduction: The Retrieval Bottleneck

Large Language Models (LLMs) are increasingly deployed as agents capable of invoking external tools—such as Web APIs, code functions, or specialized applications—to solve complex problems. However, the "context window" constraint prevents feeding documentation for thousands of tools directly into the model. Consequently, a retrieval stage is necessary to select a relevant subset of tools.

Most existing benchmarks bypass this challenge by providing agents with a pre-annotated, small set of relevant tools. This "oracle" approach masks a significant real-world bottleneck: current retrieval models, even those topping general text-retrieval leaderboards like MTEB, struggle to understand the functional requirements of tools. When the retriever fails to identify the correct tool, the agent is doomed to failure regardless of its reasoning capabilities.

The TOOLRET Benchmark

To systematically study this problem, we developed TOOLRET, a comprehensive benchmark aggregating tools from over 30 existing datasets. TOOLRET standardizes tools into three primary formats:

  1. Web APIs: Structured JSON/OpenAPI specifications.
  2. Code Functions: Executable Python snippets.
  3. Customized Apps: Natural language descriptions of tool functionality.

The benchmark includes 7,615 retrieval tasks and a corpus of 43,215 unique tools. To simulate realistic user behavior, we utilized GPT-4o to generate "target-aware instructions" for each query, moving beyond simple keyword searches to more descriptive functional requirements.

Key Insights: Why Tools are Hard to Find

Our analysis highlights two primary reasons for the failure of standard IR models in this domain:

1. The Performance Gap and Pass Rate Impact

There is a stark disconnect between a model's ability to retrieve general documents (e.g., Wikipedia) and its ability to retrieve functional tools. As shown in Figure 1, the retrieval quality (measured by Recall@10) directly dictates the end-to-end success of the agent. Replacing a perfect "oracle" toolset with one selected by a standard retriever leads to a significant drop in the task pass rate—often exceeding 10%.

Impact of IR model recall on LLM agent pass rate.

2. Low Lexical Overlap

Standard search often relies on shared keywords between the query and the document. In tool retrieval, the "lexical overlap" is remarkably low. As illustrated in Figure 3, the ROUGE-L scores between input queries and target tool documentation are concentrated at very low values. This indicates that models cannot rely on simple keyword matching; they must perform deep semantic reasoning to bridge the gap between a user's intent and a tool's technical documentation.

Distribution of Rouge-L scores between queries and tool documentation.

Optimization via TOOLRET-train

To bridge this gap, we created TOOLRET-train, a massive training dataset containing over 200,000 instances derived from major tool-use datasets like ToolACE and ToolBench. By fine-tuning standard embedding models (such as BGE and E5) using contrastive learning with "hard negatives," we significantly improved their ability to distinguish relevant tools from superficially similar ones.

Fine-tuning on TOOLRET-train resulted in substantial gains. For example, the nDCG@10 of general-purpose models improved dramatically, and when integrated into agents like GPT-3.5-turbo, the end-to-end task pass rates increased by 10% to 20%. This proves that better retrieval directly translates to smarter, more capable AI agents.

Conclusion and Future Work

Retrieval is a critical but often overlooked component of the LLM agent pipeline. Our findings demonstrate that current IR models are not "tool-savvy," creating a bottleneck for agentic performance. While TOOLRET-train offers a significant step forward, future work must address multilingual tool retrieval, prompt sensitivity, and interleaved retrieval-reasoning cycles to create truly robust AI agents.

Summary updated

BibTeX
@inproceedings{shi2025retrieval,
  author = {Zhengliang Shi and Yuhan Wang and Lingyong Yan and Pengjie Ren and Shuaiqiang Wang and Dawei Yin and Zhaochun Ren},
  title = {{Retrieval Models Aren't Tool-Savvy: Benchmarking Tool Retrieval for Large Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure