arXiv:2610.31483cs.LGOct 2026

Manuscript Offprint

arXiv:2610.31483

Training Small Language Models for Transferable Tool Selection

Zhaoyi Zhou, Akshayaa Magesh, Jeongyeol Kwon, Artem Kuriksha, Daniel Jiang, Andrea Zanette, Ayush Jain

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Zhaoyi Zhou1,2,∗^{1,2,*}, Akshayaa Magesh1^{1}, Jeongyeol Kwon1^{1}, Artem Kuriksha1^{1}, Daniel Jiang1^{1}, Andrea Zanette2^{2}, Ayush Jain1^{1}

1^{1}Meta, 2^{2}Carnegie Mellon University

*Work done at Meta

As LLM agents operate over corpora of more than ten thousand tools, selecting the right tool for a complex multi-step user instruction becomes a central bottleneck. Tool descriptions cannot all fit in context, and relevance-based retrievers only rank tools without knowing which are actually needed. Recent work instead leverages proprietary commercial LLMs like Claude or ChatGPT to drive a retriever, decomposing the instruction and selecting over retrieved candidates. We show that a small, open model can be trained via reinforcement learning to perform the same functionality. On ToolBench, a Qwen3-8B model post-trained with our recipe outperforms Llama-4-Maverick (402B). In addition, the trained model transfers directly to different retrievers and generalizes to new tool corpora in different domains.

Date: October 22, 2026

Correspondence: Zhaoyi Zhou at zhaoyiz@andrew.cmu.edu

Meta

1 Introduction

Large language model (LLM) agents increasingly solve user tasks by invoking external tools (or APIs) 1^{1} e.g., sending an email, booking a flight, or fetching data from the web, rather than producing an answer from the model's learned knowledge alone. As agents are applied to real software ecosystems, the number of callable tools has grown to well over ten thousand in some public tool corpora (Qin et al., 2024; Shi et al., 2025), and enterprises add proprietary tools for internal use. At this scale, the model's context overflows if every tool description is placed in it, so selecting the right tool becomes a bottleneck that precedes the actual execution.

The classical solution is a retriever, which scores each tool by its similarity to the user instruction and returns a small set of high-scoring candidates for the agent to choose from. Retrievers come in two broad families. Lexical retrievers such as BM25 (Best Matching 25) (Robertson and Zaragoza, 2009) score a tool by how many query terms appear in its documentation, weighting rarer terms more heavily, and apply to any corpus without training. Dense retrievers such as COLT (Qu et al., 2024) instead embed the instruction and each tool description into a shared vector space with an encoder trained on the target corpus, and rank tools by embedding similarity. LLMs have also been introduced to assist a fixed retriever by rewriting queries (Chen et al., 2024; Kachuee et al., 2025), expanding documents (Lu et al., 2026; Senthil et al., 2026; Wu et al., 2025), or re-ranking candidates (Zheng et al., 2024b). However, a retriever can only assign a relevance-based ranking over tools; it does not know which of them the task actually requires. This is especially problematic when the user instruction contains multiple substeps and requires multiple tools.

To address this, recent work places the LLM at the center of the selection workflow and uses the retriever as a meta-tool invoked on demand. Instead of consuming a single ranked list produced in one pass, the LLM drives retrieval across turns in a ReAct-style loop (Braunschweiler et al., 2025; Lumer et al., 2025a, 2026): a PLAN stage decomposes the user instruction into substeps, a RETRIEVE stage fetches a set of relevant candidates, and a SELECT stage chooses the tools it judges necessary, repeating until the instruction is covered. Because the model, not the ranking function, decides which retrieved tools are required, this design directly handles the multi-substep, multi-tool instructions that a relevance ranking alone cannot address. Existing work performs

1^{1}ToolBench (Qin et al., 2024) uses “tool” for a RapidAPI service that groups several APIs. In this paper the unit being selected is always an individual API, which we call a tool.

USER TASK Book a hotel in NYC and a flight from SF to NYC.

1 PLAN

Trained model

2 RETRIEVE

External retriever

Tool corpus

3 SELECT

Same trained model

  1. Book a hotel in NYC

query

1 hotel_reviews

Read hotel reviews

2 book_hotel

Reserve a hotel room

3 hotel_details

Get property information

book_hotel

Reserves a hotel room

  1. Book a flight from SF to NYC

query

1 flight_status

Track a flight

2 book_flight

Reserve a flight ticket

3 airport_info

Get airport information

book_flight

Reserves a flight ticket

Final tool set {book_hotel, book_flight}

Figure 1 Illustration of the PLAN–RETRIEVE–SELECT tool selection workflow. The same trained model decomposes the request and selects a tool for each substep. Each substep issues one query to an external retriever, which filters candidates by score and retains at most K for the SELECT stage.

tool selection with proprietary commercial models such as Claude or ChatGPT under careful prompt tuning. Since tool selection is a recurring sub-routine of the agentic tool-calling pipeline, we ask whether a small model can perform the task.

While an off-the-shelf small model performs poorly on its own, fine-tuning specifically for tool selection is a viable solution. However, this raises the key technical challenge of transferability:

  • Transferability across tool domains. A tool-selection model trained on one domain of tools should be usable directly on another, so that a separate model need not be trained for every tool corpus.

  • Transferability across retrievers. Some tools carry specific tool names and thus favor exact string matching, whereas other tools are better found by semantic matching, so the preferred retriever depends on the underlying tool corpus. We want the model to work under a new retriever without retraining.

These challenges are tractable under the studied framework because tool selection is built on the generalizable skills of the underlying LLM: decomposing the user instruction and matching a tool description to it. The LLM needs no domain-specific knowledge, and the workflow stays invariant to different retrievers. We therefore fine-tune Qwen3 models (Yang et al., 2025) with reinforcement learning to acquire these skills, and transfer them to new domains and retrievers (Figure 2).

Our main contributions are as follows:

  • Training a small LLM for tool selection. We fine-tune off-the-shelf Qwen3 models (1.7B, 4B, and 8B) with RL. On ToolBench, their performance exceeds that of Llama-4-Maverick (402B) (Meta AI, 2025) with prompt tuning.

  • Domain transferability. The trained LLM transfers zero-shot across tool corpora: trained on ToolBench G3, it selects tools on G2, Gorilla, CRAFT, and TaskBench with no additional training.

  • Retriever transferability. A model trained over BM25 drives a domain-specialized dense retriever (COLT) at inference without retraining, retaining its learned selection behavior.

References (47)