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 · 2026

Read MetaToolAgent: Towards Generalizable Tool Usage in LLMs through Meta-Learning by Zheng Fang, Wolfgang Mayer, Zeyu Zhang, Jian Wang, Hong-Yu Zhang, Wanli Li, Zaiwen Feng (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2601-12680.txt.

Introduction

Zheng Fang and six co authors work on teaching language models to use tools well. Tool learning lets a model pick and combine external tools for complex real world tasks. With tools, a model goes beyond pure language and can act in specialized ways. The challenge is to make that skill generalize to new tools and tasks.

Their system is called MetaToolAgent, built on meta learning. Meta learning trains a model to adapt fast to fresh problems. Applied to tools, it should let a model learn new tools from few examples. Generalizable tool use is a key step toward agents that work in open settings. The work speaks to the fast growing agent research community.

Catalog record

CREATORZheng Fang, Wolfgang Mayer, Zeyu Zhang, Jian Wang, Hong-Yu Zhang, Wanli Li, Zaiwen Feng
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE19 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2601-12680

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

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 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. † † address: 1 College of Informatics, Huazhong Agricultural University, Wuhan, Hubei, China, 430070 2 Industrial AI Research Centre, University of South Australia, Adelaide, Australia, 5000 3 School of Computer Science, Wuhan University, Wuhan, Hubei, China, 430072 1 Introduction The rapid emergence of large language model (LLM) agents has placed them at the forefront of research in the LLM domain, driving extensive investigation into their capabilities and applications. These agents go beyond conventional linguistic tasks by interacting with external tools [ 8 ] [ 2 ] , accessing APIs, and executing complex functions. Tooleyes [ 21 ] suggest that the tool learning process in LLMs encompasses five dimensions: format alignment, intent comprehension, behavior planning, tool selection, and answer organization. Among these, tool selection is particularly crucial, as it requires the model to effectively retrieve and apply the optimal tool to satisfy the user’s request. Although current LLMs leveraging prompt engineering can handle most tool-related tasks successfully, real-world scenarios still occasionally result in incorrect tool choices. To reconcile LLM with tool ecosystems, researchers have developed two distinct methodological paradigms: Supervised Fine-Tuning (SFT) uses annotated tool interaction datasets to train models for structured tool selection via direct parameter updates [ 10 , 12 ] . While effective, it requires large amounts of high-quality labeled data, leading to high resource demands and often achieving limited performance in low-resource settings [ 23 ] . Toolformer [ 12 ] addresses the lack of data by generating labels automatically but remains limited in tool diversity and computationally expensive. In-Context Learning (ICL) avoids parameter updates by instead using few-shot examples and instructional prompts to implicitly guide models in tool invocation [ 21 , 13 , 9 ] . However, ICL’s non-parametric nature limits task-specific knowledge incorporation [ 6 ] , and makes prompt optimization costly due to functional similarity among tools [ 10 , 23 ] . Moreover, despite recent progress in tool-learning datasets, existing resources remain limited. In real-world vertical applications, we more often encounter two types of tool-invocation scenarios: (1) tools that need to be called across a wide range of scenarios for general-purpose LLMs, and (2) tools with subtle differences within the same domain, invoked by industry-specific LLMs. Most existing datasets do not categorize tools by usage scenario. For example, ToolAlpaca [ 21 ] covers over 400 tools but focuses on usage processes rather than tool selection. To address this gap, we compared several open-source datasets and constructed a dataset categorizing tools by usage scenario. Motivated by these challenges—low-resource scenarios, fine-grained tool differentiation, and limited datasets—we propose MetaToolAgent (MTA) , a bi-level meta-learning framework [ 3 ] that decomposes tool optimization into hierarchical objectives. Unlike traditional single-level optimization approaches based on fine-tuning or in-context learning, MTA solves an optimistic bi-level optimization (BLO) problem [ 7 ] where the outer-level generalization objective minimizes expected loss over unseen tasks: \min_{\phi}\mathbb{E}_{T_{\text{test}}\sim\mathcal{T}}\left[\mathcal{L}_{T_{\text{test}}}(\theta^{*}(\phi),x,y)\right] (1) with meta-parameters \phi capturing cross-tool patterns across task distribution \mathcal{T} . The inner-level tool-specific objective refines policies for known tools: \theta^{*}(\phi)=\arg\min_{\theta}\mathcal{L}_{T}(\theta,x,y) (2) The inner-level solutions \theta^{*}(\phi) bound the outer generalization space while meta-gradients \nabla_{\phi} refine \phi through alternating updates ( \phi_{k+1}=\phi_{k}-\alpha\nabla_{\phi}\mathcal{L}_{T_{\text{test}}} ). By simulating dynamic tool ecosystems via this recursive BLO structure, MTA enhances semantic inference [ 5 ] and alignment capabilities, enabling robust orchestration without static prompts or task-specific fine-tuning through transfer optimization principles [ 15 ] . The main contributions of our work are summarized as follows: • We construct a dataset comprising 155 tools across 7 scenarios and 9,377 user requests to evaluate LLMs’ performance in tool selection. • We propose MTA, a meta-learning framework that enhances LLMs’ ability to select appropriate tools when encountering previously unseen tools. • We evaluate multiple open-source LLMs of different scales and compare MTA with prompt engineering and fine-tuning approaches. 2 Method 2.1 Dataset Construction We construct our dataset via a systematic five-stage workflow, designed to ensure interpretability and effective training of tool-augmented LLMs: Scenario Definition: We define seven real-world scenarios—office (Office), operating systems (OS), software development (SD), education (Edu), daily life (DL), Internet of Things (IoT), and mobile applications (App)—to guide tool creation and simulate diverse human-tool interactions. Tool Development: We manually design 155 scenario-specific tools spanning the above domains, as summarized in Table 1 . Tool Documentation: Each tool is documented with its name, functionality, and input parameters, closely mirroring real-world API specifications. Query Generation: Natural language queries that require tool calls are first generated by GPT-4 and then manually reviewed and refined to ensure clarity, correctness, and alignment with tool functionalities. Data Synthesis: We synthesize structured data by parsing tool parameters from natural language queries, identifying candidate tools, and conducting tool selection analysis to determine the most appropriate tool for each query. Table 1: Statistics of Tool Quantity and Data Quantity Office OS SD Edu DL IoT App Total Tool 20 21 24 26 20 22 22 155 Data 1178 1288 1456 1548 1262 1276 1369 9377 2.2 MetaToolAgent Algorithm Our algorithm addresses the tool selection problem defined as follows: given a dataset D=(Q,T) , where Q is a set of user queries reflecting various task requirements and T is a collection of tools with their descriptions, the goal is to first sample a subset of tools S\subseteq T , and then select the correct tool t\in S that matches a given query q\in Q . To tackle this problem, our method fine-tunes the LLM using gradient descent. Unlike conventional gradient descent, which optimizes for a single objective per update, our approach structures each training iteration around a meta-task M , composed of multiple zero-shot tasks \tau_{i} . Each task \tau_{i} is constructed using a fixed prompt template, together with the user query q_{i} and descriptions of tools from S , the descriptions include definitions and usage information, and the task concludes with a fixed-format response that specifies the correct tool t_{i} . Model parameters are updated only after optimal performance is achieved on query q_{i} within the meta-task framework, which distinguishes our approach from conventional fine-tuning methods.This design enables the model to learn generalizable features and strategies across varied tasks and tools. Algorithm 1 Fine-tuning LLM Based on Meta-Learning 0: Query dataset \mathcal{Q} , tool dataset \mathcal{T} , LLM parameters \Theta 0: Updated model parameters \Theta^{*} 1: for iteration = 1, 2, … do 2: Randomly sample

Read the complete text