Abstract
Large Language Models (LLMs) increasingly rely on external tools to overcome limitations in real-time data access and specialized computation. However, as the number of available tools grows, retrieving the complete set of necessary tools for a complex query becomes a significant challenge. Current retrieval systems often focus on semantic similarity, which can lead to redundant results while missing critical components of a multi-step task. This paper introduces COLT (COllaborative Learning-based Tool Retrieval), a framework that utilizes graph-based collaborative learning to capture tool synergies. COLT significantly improves retrieval completeness, enabling even small models to outperform much larger counterparts.
Introduction
The paradigm of "tool learning" allows LLMs to interact with external APIs to solve multifaceted problems. However, with thousands of tools available, they cannot all fit within an LLM's context window, making efficient retrieval essential.
The primary limitation of existing retrievers is their reliance on semantic similarity. For instance, a query asking for the value of gold and stocks in a specific currency might return multiple gold-related tools but fail to provide a currency converter. This lack of "completeness" prevents the LLM from generating a final answer.
The COLT Framework
To address the completeness gap, the authors propose COLT, a model-agnostic approach that operates in two main stages:
1. Semantic Learning Stage
COLT first employs a standard bi-encoder architecture to align the vector representations of user queries and tool descriptions. This ensures that the model understands the basic functional relevance of individual tools.
2. Collaborative Learning Stage
The core innovation of COLT is the introduction of "Scenes"—groups of tools frequently used together to solve specific problem types (e.g., travel planning or financial analysis). By constructing bipartite graphs between Queries (Q), Tools (T), and Scenes (S), the model can propagate information using a Graph Neural Network (LightGCN). This allows the system to learn that certain tools are "collaborative" even if they lack direct semantic overlap with the query.
The framework is optimized using a list-wise multi-label loss function, encouraging the model to retrieve the entire required "toolbox" for a given scene simultaneously.
Evaluation and Datasets
The researchers evaluated COLT using two primary benchmarks:
- ToolBench: A standard benchmark for multi-tool scenarios.
- ToolLens: A new, more challenging dataset introduced by the authors. Unlike ToolBench, which often contains verbose queries with exact tool names, ToolLens features natural, concise, and multifaceted queries that better reflect real-world user behavior.
To measure success, the authors proposed a new metric: COMP@K. Unlike traditional metrics like Recall, COMP@K only awards a point if every tool required for a query is present in the top-K results, directly measuring retrieval completeness.
Results and Insights
COLT demonstrates substantial improvements over baseline dense retrievers. On the ToolLens dataset, the COMP@3 score of the Contriever backbone jumped from 7.46% to 84.55% when integrated with COLT.
Key findings include:
- Efficiency of Scale: A BERT-mini model (11M parameters) using COLT outperformed a BERT-large model (340M parameters) using standard retrieval. This suggests that structural awareness of tool relationships is more valuable than raw model size for this task.
- Downstream Impact: LLMs (evaluated via GPT-4) produced significantly more coherent and accurate responses when provided with the complete toolsets retrieved by COLT.
- Ablation Studies: Removing the collaborative learning component led to a sharp decline in performance, confirming that graph-based scene matching is essential for achieving completeness.
Conclusion and Future Work
COLT shifts the focus of tool retrieval from simple similarity to functional completeness. By treating tool retrieval as a collaborative filtering problem, it ensures that LLMs receive all the necessary components to solve complex, multi-step queries. Future research will focus on automated "scene mining" to handle dynamic tool environments and managing "tool competition" where multiple tools offer overlapping functionality.
Summary updated