ToolWeaver: Weaving Collaborative Semantics for Scalable Tool Use in Large Language Models

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Fang, Bowen, Ye, Wen, Su, Yunyue, Zhang, Jinghao, Liu, Qiang, Liu, Yesheng, Sun, Xin, Wu, Shu, Yang, Jiabing, Wei, Baole, Wang, Liang
Format: Preprint
Veröffentlicht: 2026
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866912859820130304
author Fang, Bowen
Ye, Wen
Su, Yunyue
Zhang, Jinghao
Liu, Qiang
Liu, Yesheng
Sun, Xin
Wu, Shu
Yang, Jiabing
Wei, Baole
Wang, Liang
author_facet Fang, Bowen
Ye, Wen
Su, Yunyue
Zhang, Jinghao
Liu, Qiang
Liu, Yesheng
Sun, Xin
Wu, Shu
Yang, Jiabing
Wei, Baole
Wang, Liang
contents Prevalent retrieval-based tool-use pipelines struggle with a dual semantic challenge: their retrievers often employ encoders that fail to capture complex semantics, while the Large Language Model (LLM) itself lacks intrinsic tool knowledge from its natural language pretraining. Generative methods offer a powerful alternative by unifying selection and execution, tasking the LLM to directly learn and generate tool identifiers. However, the common practice of mapping each tool to a unique new token introduces substantial limitations: it creates a scalability and generalization crisis, as the vocabulary size explodes and each tool is assigned a semantically isolated token. This approach also creates a semantic bottleneck that hinders the learning of collaborative tool relationships, as the model must infer them from sparse co-occurrences of monolithic tool IDs within a vast library. To address these limitations, we propose ToolWeaver, a novel generative tool learning framework that encodes tools into hierarchical sequences. This approach makes vocabulary expansion logarithmic to the number of tools. Crucially, it enables the model to learn collaborative patterns from the dense co-occurrence of shared codes, rather than the sparse co-occurrence of monolithic tool IDs. We generate these structured codes through a novel tokenization process designed to weave together a tool's intrinsic semantics with its extrinsic co-usage patterns. These structured codes are then integrated into the LLM through a generative alignment stage, where the model is fine-tuned to produce the hierarchical code sequences. Evaluation results with nearly 47,000 tools show that ToolWeaver significantly outperforms state-of-the-art methods, establishing a more scalable, generalizable, and semantically-aware foundation for advanced tool-augmented agents.
format Preprint
id arxiv_https___arxiv_org_abs_2601_21947
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle ToolWeaver: Weaving Collaborative Semantics for Scalable Tool Use in Large Language Models
Fang, Bowen
Ye, Wen
Su, Yunyue
Zhang, Jinghao
Liu, Qiang
Liu, Yesheng
Sun, Xin
Wu, Shu
Yang, Jiabing
Wei, Baole
Wang, Liang
Artificial Intelligence
I.2.7
Prevalent retrieval-based tool-use pipelines struggle with a dual semantic challenge: their retrievers often employ encoders that fail to capture complex semantics, while the Large Language Model (LLM) itself lacks intrinsic tool knowledge from its natural language pretraining. Generative methods offer a powerful alternative by unifying selection and execution, tasking the LLM to directly learn and generate tool identifiers. However, the common practice of mapping each tool to a unique new token introduces substantial limitations: it creates a scalability and generalization crisis, as the vocabulary size explodes and each tool is assigned a semantically isolated token. This approach also creates a semantic bottleneck that hinders the learning of collaborative tool relationships, as the model must infer them from sparse co-occurrences of monolithic tool IDs within a vast library. To address these limitations, we propose ToolWeaver, a novel generative tool learning framework that encodes tools into hierarchical sequences. This approach makes vocabulary expansion logarithmic to the number of tools. Crucially, it enables the model to learn collaborative patterns from the dense co-occurrence of shared codes, rather than the sparse co-occurrence of monolithic tool IDs. We generate these structured codes through a novel tokenization process designed to weave together a tool's intrinsic semantics with its extrinsic co-usage patterns. These structured codes are then integrated into the LLM through a generative alignment stage, where the model is fine-tuned to produce the hierarchical code sequences. Evaluation results with nearly 47,000 tools show that ToolWeaver significantly outperforms state-of-the-art methods, establishing a more scalable, generalizable, and semantically-aware foundation for advanced tool-augmented agents.
title ToolWeaver: Weaving Collaborative Semantics for Scalable Tool Use in Large Language Models
topic Artificial Intelligence
I.2.7
url https://arxiv.org/abs/2601.21947