AutoTool: Dynamic Tool Selection and Integration for Agentic Reasoning
AutoTool employs a dual-phase optimization with PL ranking to enable dynamic tool selection, improving reasoning accuracy by 6.4% across ten benchmarks.
Key Findings
Methodology
AutoTool adopts a two-stage training pipeline: first, supervised fine-tuning (SFT) and reinforcement learning (RL) stabilize long chain-of-thought trajectories; second, a KL-regularized Plackett–Luce (PL) ranking refines multi-step tool selection. The model is trained on a 200k dataset with explicit tool rationales across 1000+ tools and 100+ tasks spanning math, science, coding, and multimodal reasoning. The approach involves embedding tools into a shared space, sampling tools based on embedding similarity, and optimizing tool preferences via PL ranking. This ensures robustness and generalization in evolving tool environments.
Key Results
- Across ten benchmarks, AutoTool improves reasoning accuracy by an average of 6.4%, with 7.7% gains in code generation and 6.9% in multimodal tasks. It outperforms models with more parameters, especially in unseen tool scenarios, demonstrating strong adaptability.
- The PL ranking and KL regularization effectively guide the model to prefer high-quality tool sequences, reducing errors and improving trajectory coherence.
- Experimental results confirm that AutoTool's dynamic tool selection significantly enhances task performance and generalization, especially in environments with evolving or unseen tools.
Significance
This work addresses a critical gap in LLM tool integration by enabling dynamic, context-aware tool selection. It advances AI systems towards greater autonomy and flexibility, essential for real-world applications where tools and tasks continuously evolve. The framework's ability to generalize to unseen tools and environments marks a significant step toward autonomous reasoning agents capable of operating in open-ended, multi-tool settings, impacting both academia and industry.
Technical Contribution
The paper introduces a novel PL ranking-based optimization framework integrated with a dual-phase training pipeline, combining embedding-based tool selection with preference learning. Theoretical guarantees link the PL ranking distribution with the optimal policy, providing a principled approach to preference alignment. The construction of a large, annotated dataset with explicit rationales further enhances supervision, enabling scalable training of dynamic tool selection strategies.
Novelty
This is the first work to formalize tool selection as a PL ranking problem within LLM training, allowing models to learn preferences over an evolving set of tools. Unlike prior static or fixed-tool approaches, AutoTool supports unseen tools and environment changes, representing a fundamental innovation in adaptive AI systems.
Limitations
- The approach relies heavily on high-quality annotated rationales, which can be costly to produce at scale. Its performance may degrade in extremely complex or noisy environments where tool representations are insufficient.
- Inference efficiency may be impacted by frequent tool calls, especially in resource-constrained settings. Further optimization is needed for real-time deployment.
- Handling highly ambiguous or conflicting tools remains challenging, requiring more sophisticated disambiguation mechanisms.
Future Work
Future research will explore integrating self-supervised learning to reduce annotation costs, extending the framework to multi-modal and multi-agent systems, and improving inference efficiency. Additionally, developing methods for automatic tool representation learning and better handling of conflicting tools will be key directions.
AI Executive Summary
AutoTool introduces a pioneering framework for dynamic tool selection in large language models, addressing the limitations of static toolsets that hinder adaptability in real-world scenarios. Traditional models often rely on fixed tools learned during training, which restricts their ability to handle evolving environments or unseen tools. To overcome this, AutoTool employs a dual-phase training pipeline: the first phase stabilizes reasoning trajectories through supervised fine-tuning and reinforcement learning, ensuring coherent long-chain reasoning; the second phase refines multi-step tool selection using a KL-regularized Plackett–Luce ranking approach, which explicitly models preferences over tools based on their utility and correctness.
The core innovation lies in framing tool selection as a ranking problem, where the model learns to prefer high-quality tools by optimizing a distribution over possible tool sequences. This is achieved through a combination of embedding tools into a shared vector space, sampling tools based on embedding similarity, and applying a preference-aware ranking loss. The approach is supported by a large, curated dataset of 200k trajectories with explicit rationales for tool choices, covering over 1000 tools and 100 diverse tasks.
Experimental results across ten benchmarks demonstrate that AutoTool consistently outperforms existing fixed-tool and static integration methods, with an average improvement of 6.4% in reasoning accuracy. Notably, the model shows strong generalization capabilities, effectively leveraging unseen tools during inference, which is critical for real-world deployment where tools are continuously evolving.
This work significantly advances the field of autonomous reasoning systems, enabling AI agents to adaptively and intelligently select tools in complex, dynamic environments. Its implications extend to applications such as intelligent assistants, scientific research, and multimodal AI, paving the way for more flexible and capable autonomous agents. Despite its success, challenges remain in scaling annotation efforts, optimizing inference speed, and handling highly ambiguous tools, guiding future research directions.
Deep Analysis
Background
Recent progress in large language models (LLMs) has demonstrated impressive capabilities in reasoning, code generation, and multimodal understanding. Prior works like Toolformer, ReTool, and ToolGen have integrated static toolsets to enhance model performance, but these approaches assume fixed tools, limiting adaptability. As real-world applications demand models to operate in open-ended, evolving environments, the inability to dynamically select and incorporate unseen tools becomes a bottleneck. The challenge lies in enabling models to learn preferences over a large, diverse set of tools, including those not seen during training, while maintaining reasoning coherence and efficiency. This background underscores the necessity for a flexible, preference-driven tool selection mechanism that can generalize across tasks and environments.
Core Problem
The core problem is the static nature of existing tool integration methods, which restrict models to predefined toolsets. This leads to poor generalization when new tools emerge or environments change, severely limiting practical deployment. The difficulty is compounded by the need for models to not only select appropriate tools but also justify their choices, ensuring transparency and robustness. Addressing this requires a framework that supports dynamic, context-aware tool selection, capable of learning preferences over an evolving set of tools, and maintaining high reasoning accuracy across diverse tasks. The challenge is to design such a system that balances flexibility, interpretability, and computational efficiency.
Innovation
This paper introduces AutoTool, a novel framework that models tool selection as a ranking problem, leveraging PL ranking and KL regularization to learn preferences over tools dynamically. Key innovations include:
1) Embedding-based tool representation, enabling generalization to unseen tools.
2) Dual-phase training: first stabilizing reasoning trajectories via supervised fine-tuning and RL, then refining tool preferences with PL ranking.
3) Explicit rationales for tool choices, improving interpretability.
4) Construction of a large, diverse dataset with annotated rationales, supporting preference learning.
These innovations collectively enable models to adaptively and accurately select tools in dynamic environments, surpassing prior static or fixed-tool methods.
Methodology
- �� Assemble a large, diverse toolset (1000+ tools) and task set (100+ tasks) to create a comprehensive dataset.
- �� Map each tool into a shared embedding space using tool features, ensuring generalization.
- �� During trajectory generation, model generates a rationale and predicts an anchor embedding for tool selection.
- �� Sample tools based on embedding similarity, using a softmax over distances.
- �� Train in two phases: first, stabilize reasoning with supervised fine-tuning and RL; second, refine tool preferences via KL-regularized PL ranking.
- �� Formulate tool selection as a ranking problem, optimizing a distribution over candidate trajectories based on reward signals.
- �� Use a reward model evaluating both reasoning quality and final correctness to guide preference learning.
- �� Implement a loss function aligning the model’s policy distribution with the PL ranking distribution, ensuring preference consistency.
Experiments
Experiments involve ten benchmarks across mathematics, science, search, and multimodal tasks, comparing AutoTool with models like GPT-4, Qwen, and ReTool. Metrics include accuracy and task success rate. The models are trained on datasets with explicit rationales, using different sizes (Qwen3-8B, Qwen2.5-VL-7B). Ablation studies assess the impact of PL ranking and data quality. The environment simulates evolving toolsets, testing the model’s ability to select unseen tools during inference. Results show consistent improvements, especially in zero-shot and unseen-tool scenarios, validating the effectiveness of the ranking-based preference learning approach.
Results
AutoTool achieves an average of 6.4% higher accuracy across ten benchmarks, with notable gains in code generation (7.7%) and multimodal understanding (6.9%). The model demonstrates superior generalization, effectively leveraging unseen tools during inference. Ablation studies confirm that PL ranking and high-quality rationales are crucial for performance. The results highlight the importance of explicit preference modeling, enabling the model to prioritize high-quality tool sequences, thus reducing errors and improving reasoning coherence in complex, dynamic environments.
Applications
AutoTool can be applied in intelligent assistants, scientific research tools, and multimodal AI systems, where environments are constantly changing and new tools emerge. Its ability to dynamically select and justify tools enhances robustness and user trust. Long-term, this framework supports autonomous agents capable of continuous learning and adaptation, transforming AI from static systems into flexible, self-improving entities capable of operating in real-world, open-ended scenarios.
Limitations & Outlook
Despite promising results, the approach depends heavily on high-quality annotated rationales, which are costly to produce at scale. Its performance may decline in highly ambiguous or conflicting tool environments. Frequent tool invocation can impact inference speed, limiting real-time deployment. Additionally, the current framework may struggle with highly noisy or poorly represented tools, requiring further robustness improvements and efficiency optimizations.
Plain Language Accessible to non-experts
想象你在一家厨房做饭,厨房里有很多不同的厨具,比如锅、刀、搅拌器等。以前你只用固定的几样厨具,遇到新菜谱就不知道用哪个。AutoTool就像一个聪明的厨师助手,它可以根据每次做菜的不同需求,动态选择最合适的厨具,还能学习新厨具的用法。比如遇到一种新型的搅拌器,它会自己学会怎么用,然后帮你做出美味的菜肴。这样一来,不管菜谱多复杂,助手都能帮你找到最合适的工具,让你轻松搞定所有菜肴。这就像你在玩拼图游戏,遇到新拼图时,助手会告诉你用哪个拼块最合适,帮你拼出完整的图像!
ELI14 Explained like you're 14
想象你在学校的科学实验室里做实验,实验需要用到各种工具,比如显微镜、烧杯、温度计等等。以前,你只用固定的几样工具,遇到新实验就不太会用。AutoTool就像一个聪明的助手,它可以根据每个实验的需要,动态选择最合适的工具,还能学习新的工具怎么用。比如说,遇到一个新的显微镜,它会自己学会怎么操作,然后帮你完成实验。这样一来,不管实验多复杂,助手都能帮你找到最好的工具,让你轻松搞定所有任务。这就像你在玩游戏,遇到新关卡时,助手会告诉你用哪个装备最合适,帮你赢得比赛!
Glossary
Tool Embedding (工具嵌入)
将工具的特征信息映射到模型的隐藏空间中,确保工具表示的通用性和可扩展性。
用于实现工具的动态选择和表示学习。
PL排序 (Plackett–Luce Ranking)
一种将偏好转化为排序分布的算法,用于优化工具选择偏好。
核心机制之一,用于工具偏好学习。
KL正则化 (Kullback-Leibler Regularization)
一种正则化技术,用于在训练中保持模型偏好与目标分布的一致性。
提升工具选择的稳定性和泛化能力。
轨迹 (Trajectory)
模型在推理过程中生成的连续决策和推理步骤的序列。
描述模型的推理和工具调用流程。
轨迹增强 (Trajectory Augmentation)
通过生成和筛选高质量的推理轨迹,丰富训练数据。
提升模型的推理连贯性和工具选择能力。
Open Questions Unanswered questions from this research
- 1 如何进一步提升模型在极端复杂环境中的工具选择准确性?
- 2 模型在多模态、多任务环境中泛化能力的极限在哪里?
- 3 未来能否实现完全自主的工具学习和调用?
Applications
Immediate Applications
智能问答系统
支持复杂、多工具环境下的自动问答,提升准确率和交互体验。
科学研究助手
辅助科研人员在多模态数据和工具中快速找到最佳方案,提升效率。
Long-term Vision
自主智能体
实现完全自主的工具选择和任务执行,推动AI自主化发展。
多模态协作平台
构建跨领域、多模态的智能协作系统,支持复杂场景中的决策和操作。
Abstract
Agentic reinforcement learning has advanced large language models (LLMs) to reason through long chain-of-thought trajectories while interleaving external tool use. Existing approaches assume a fixed inventory of tools, which limits the adaptability of LLM agents to new or evolving toolsets. We present AutoTool, a training framework that equips LLM agents with dynamic tool-selection capabilities throughout their reasoning trajectories. AutoTool employs a dual-phase optimization pipeline: (i) SFT and RL-based trajectory stabilization for coherent reasoning, and (ii) KL-regularized Plackett-Luce Ranking to refine consistent multi-step tool selection. We further build a 200k dataset with explicit tool-selection rationales across 1,000+ tools and 100+ tasks spanning mathematics, science, code generation, and multimodal reasoning. Across ten diverse benchmarks, we train two base models, Qwen3-8B and Qwen2.5-VL-7B, with AutoTool. With fewer parameters, AutoTool consistently outperforms advanced LLM agents and tool-integration methods, yielding average gains of 6.4% in math & science reasoning, 4.5% in search-based QA, 7.7% in code generation, and 6.9% in multimodal understanding. In addition, AutoTool exhibits stronger generalization by dynamically leveraging unseen tools from evolving toolsets during inference.