MetaToolAgent: Towards Generalizable Tool Usage in LLMs through Meta-Learning
Zheng Fang, Wolfgang Mayer, Zeyu Zhang, Jian Wang, Hong-Yu Zhang, Wanli Li, Zaiwen Feng
TL;DR
This work tackles the problem of enabling LLMs to select and orchestrate external tools across diverse domains, including unseen tools. It introduces MetaToolAgent (MTA), a bi-level meta-learning framework that learns cross-tool patterns via outer-level meta-optimization on unseen tasks and inner-level tool-specific optimization: $\theta^*(\phi) = \arg\min_{\theta} \mathcal{L}_{T}(\theta, x, y)$ and $\min_{\phi} \mathbb{E}_{T_{test} \sim \mathcal{T}} [ \mathcal{L}_{T_{test}}(\theta^*(\phi), x, y) ]$. The authors also present a 7-domain, 155-tool dataset with 9,377 queries to systematically evaluate tool selection. Empirical results show MTA outperforms prompt-based and fine-tuning baselines on unseen tools, with improved generalization and more robust cross-tool coordination across varied scenarios. These findings suggest meta-learning is a promising route to scalable, adaptable tool-enabled LLM systems in real-world deployments.
Abstract
Tool learning is increasingly important for large language models (LLMs) to effectively coordinate and utilize a diverse set of tools in order to solve complex real-world tasks. By selecting and integrating appropriate tools, LLMs extend their capabilities beyond pure language understanding to perform specialized functions. However, existing methods for tool selection often focus on limited tool sets and struggle to generalize to novel tools encountered in practical deployments. To address these challenges, we introduce a comprehensive dataset spanning 7 domains, containing 155 tools and 9,377 question-answer pairs, which simulates realistic integration scenarios. Additionally, we propose MetaToolAgent (MTA), a meta-learning approach designed to improve cross-tool generalization. Experimental results show that MTA significantly outperforms baseline methods on unseen tools, demonstrating its promise for building flexible and scalable systems that require dynamic tool coordination.
