Table of Contents
Fetching ...

Beyond Single-Shot: Multi-step Tool Retrieval via Query Planning

Wei Fang, James Glass

TL;DR

The paper addresses the challenge of retrieving and composing tools from massive, dynamic libraries for large language model agents by reframing tool retrieval as an iterative planning problem. ToolQP decomposes complex user requests into sub-tasks, interactively generates queries guided by a plan, and aggregates results, enabling robust and scalable tool discovery without requiring retriever changes. Trained with synthetic trajectories and reinforced with RLVR, ToolQP achieves state-of-the-art performance on ToolRet, strong zero-shot generalization, and robust transfer to unseen retrievers, with substantial gains in end-to-end tool-calling tasks. The work demonstrates that explicit planning and interactive feedback can significantly improve downstream agentic execution in complex, compositional tool environments, while remaining lightweight and modular for integration with existing systems.

Abstract

LLM agents operating over massive, dynamic tool libraries rely on effective retrieval, yet standard single-shot dense retrievers struggle with complex requests. These failures primarily stem from the disconnect between abstract user goals and technical documentation, and the limited capacity of fixed-size embeddings to model combinatorial tool compositions. To address these challenges, we propose TOOLQP, a lightweight framework that models retrieval as iterative query planning. Instead of single-shot matching, TOOLQP decomposes instructions into sub-tasks and dynamically generates queries to interact with the retriever, effectively bridging the semantic gap by targeting the specific sub-tasks required for composition. We train TOOLQP using synthetic query trajectories followed by optimization via Reinforcement Learning with Verifiable Rewards (RLVR). Experiments demonstrate that TOOLQP achieves state-of-the-art performance, exhibiting superior zero-shot generalization, robustness across diverse retrievers, and significant improvements in downstream agentic execution.

Beyond Single-Shot: Multi-step Tool Retrieval via Query Planning

TL;DR

The paper addresses the challenge of retrieving and composing tools from massive, dynamic libraries for large language model agents by reframing tool retrieval as an iterative planning problem. ToolQP decomposes complex user requests into sub-tasks, interactively generates queries guided by a plan, and aggregates results, enabling robust and scalable tool discovery without requiring retriever changes. Trained with synthetic trajectories and reinforced with RLVR, ToolQP achieves state-of-the-art performance on ToolRet, strong zero-shot generalization, and robust transfer to unseen retrievers, with substantial gains in end-to-end tool-calling tasks. The work demonstrates that explicit planning and interactive feedback can significantly improve downstream agentic execution in complex, compositional tool environments, while remaining lightweight and modular for integration with existing systems.

Abstract

LLM agents operating over massive, dynamic tool libraries rely on effective retrieval, yet standard single-shot dense retrievers struggle with complex requests. These failures primarily stem from the disconnect between abstract user goals and technical documentation, and the limited capacity of fixed-size embeddings to model combinatorial tool compositions. To address these challenges, we propose TOOLQP, a lightweight framework that models retrieval as iterative query planning. Instead of single-shot matching, TOOLQP decomposes instructions into sub-tasks and dynamically generates queries to interact with the retriever, effectively bridging the semantic gap by targeting the specific sub-tasks required for composition. We train TOOLQP using synthetic query trajectories followed by optimization via Reinforcement Learning with Verifiable Rewards (RLVR). Experiments demonstrate that TOOLQP achieves state-of-the-art performance, exhibiting superior zero-shot generalization, robustness across diverse retrievers, and significant improvements in downstream agentic execution.
Paper Structure (43 sections, 15 figures, 8 tables, 1 algorithm)

This paper contains 43 sections, 15 figures, 8 tables, 1 algorithm.

Figures (15)

  • Figure 1: Overview of the ToolQP framework. The Planner decomposes a complex user query (e.g., travel planning) into sequential sub-tasks. For each sub-task, it interactively generates queries, processes feedback from the dense retriever, and self-corrects if necessary, before aggregating the final set of relevant tools.
  • Figure 2: ToolQP discovering dependencies.
  • Figure 3: Retrieval comparison for example taken from ToolRet's test set.
  • Figure 4: Retrieval comparison for example taken from ToolRet's test set.
  • Figure 5: Retrieval comparison for example taken from ToolRet's test set.
  • ...and 10 more figures