arXiv:2510.07768cs.CLcs.AI2025-10被引 3

自动构建结构化工具库,让大模型推理更高效

ToolLibGen: Scalable Automatic Tool Creation and Aggregation for LLM Reasoning

  • 将零散工具按语义聚类,再用多智能体整合共享逻辑
  • 在物理问答等任务上,工具检索准确率显著提升
  • 适合需要大量领域工具的复杂推理场景

配备外部工具的大语言模型在复杂推理任务中表现优异,但受限于领域专用工具稀缺。现有自动化工具生成方法虽能从思维链中提取可复用函数,却面临可扩展性瓶颈:工具数量增多后,无结构存储导致检索困难,搜索空间膨胀且功能混淆。为此,我们提出系统性方法,将非结构化工具集重构为结构化工具库。首先生成特定任务工具并按语义聚类;在每类中,引入多智能体框架:代码智能体重构代码以提取共享逻辑,创建通用聚合工具;评审智能体确保聚合后工具保留原始全部功能。该过程将大量问题专用工具转化为少数强大聚合工具,不损失功能。实验表明,该方法显著提升工具检索准确率与整体推理性能,且在问题数量增加时展现出更强可扩展性。

原文摘要 · Abstract (English)

Large Language Models (LLMs) equipped with external tools have demonstrated enhanced performance on complex reasoning tasks. The widespread adoption of this tool-augmented reasoning is hindered by the scarcity of domain-specific tools. For instance, in domains such as physics question answering, suitable and specialized tools are often missing. Recent work has explored automating tool creation by extracting reusable functions from Chain-of-Thought (CoT) reasoning traces; however, these approaches face a critical scalability bottleneck. As the number of generated tools grows, storing them in an unstructured collection leads to significant retrieval challenges, including an expanding search space and ambiguity between function-related tools. To address this, we propose a systematic approach to automatically refactor an unstructured collection of tools into a structured tool library. Our system first generates discrete, task-specific tools and clusters them into semantically coherent topics. Within each cluster, we introduce a multi-agent framework to consolidate scattered functionalities: a code agent refactors code to extract shared logic and creates versatile, aggregated tools, while a reviewing agent ensures that these aggregated tools maintain the complete functional capabilities of the original set. This process transforms numerous question-specific tools into a smaller set of powerful, aggregated tools without loss of functionality. Experimental results demonstrate that our approach significantly improves tool retrieval accuracy and overall reasoning performance across multiple reasoning tasks. Furthermore, our method shows enhanced scalability compared with baselines as the number of question-specific increases.

大模型推理工具生成自动化知识整合

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。