arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.21947cs.AI
收藏

ToolWeaver: 为大语言模型中的可扩展工具使用编织协作语义

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

New Laboratory of Pattern Recognition (NLPR), Institute of Automation, Chinese Academy of Sciences (CASIA)(模式识别新实验室(NLPR),自动化研究所,中国科学院(CASIA));School of Artificial Intelligence, University of Chinese Academy of Sciences(人工智能学院,中国科学院大学);Zhongguancun Academy(中关村学院);Zhongguancun Institute of Artificial Intelligence(中关村人工智能研究所)

Bowen Fang, Wen Ye, Yunyue Su, Jinghao Zhang, Qiang Liu, Yesheng Liu, Xin Sun, Shu Wu, Jiabing Yang, Baole Wei, Liang Wang

AI总结:

ToolWeaver通过编码工具为层次序列,解决大语言模型中工具使用中的语义和可扩展性问题,提升工具协作学习的效率与效果。

摘要:

现有的基于检索的工具使用管道面临双重语义挑战:其检索器通常使用无法捕捉复杂语义的编码器,而大语言模型(LLM)本身缺乏其自然语言预训练中固有的工具知识。生成方法提供了一种强大的替代方案,通过统一选择和执行,让LLM直接学习并生成工具标识符。然而,将每个工具映射到一个唯一新令牌的常见做法带来了显著限制:它导致了可扩展性和泛化危机,因为词汇量爆炸,每个工具被分配一个语义孤立的令牌。这种方法还创建了一个语义瓶颈,阻碍了协作工具关系的学习,因为模型必须从大量库中稀疏的单体工具ID共现中推断这些关系。为了解决这些限制,我们提出了ToolWeaver,一种新的生成式工具学习框架,将工具编码为层次序列。这种方法使词汇量扩展与工具数量呈对数关系。至关重要的是,它使模型能够从共享代码的密集共现中学习协作模式,而不是从单体工具ID的稀疏共现中推断。我们通过一种新的分词过程生成这些结构化代码,将工具的内在语义与其外在共用模式编织在一起。这些结构化代码随后通过生成对齐阶段整合到LLM中,其中模型经过微调以生成层次代码序列。评估结果表明,使用接近47,000个工具的测试显示,ToolWeaver显著优于最先进的方法,建立了一个更可扩展、可泛化和语义感知的基础,为高级工具增强代理提供了支持。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑