Abstract
Toolink is a novel framework designed to empower open-source Large Language Models (LLMs) with tool-using capabilities. By mimicking the human "create-then-use" problem-solving workflow, Toolink decomposes complex tasks into modular toolkits and employs a two-stage Chain-of-Solving (CoS) approach. This method separates natural language planning from code-based execution. Through finetuning a LLaMA-7B model on a specialized dataset (CoS-GPT), the authors demonstrate that smaller open-source models can match or exceed the performance of closed-source models like ChatGPT on sophisticated reasoning benchmarks.
Introduction: The Challenge of Tool Use in Open-Source LLMs
While state-of-the-art LLMs like GPT-4 exhibit remarkable capabilities, they often falter with precise calculations or real-time data access. Integrating external tools—such as calculators or APIs—is a proven remedy. However, current tool-use pipelines predominantly rely on expensive, closed-source models, presenting hurdles in adaptability, cost, and data privacy. Smaller open-source models typically lack the reasoning depth to autonomously plan and execute multi-step tool calls. Toolink bridges this gap by distilling tool-using logic from "teacher" models into efficient "student" models.
The Toolink Framework
The Toolink framework operates through a structured two-phase process:
- Toolkit Creation: Rather than relying on a static toolset, Toolink leverages a teacher model (e.g., ChatGPT) to generate task-specific modular Python functions. These functions are tailored to the problem domain, such as
update_location()for navigation orcalculate_remainder()for arithmetic. - Chain-of-Solving (CoS): This core reasoning strategy involves two distinct stages:
- CoS-Planning: The model identifies necessary tools and formulates a natural language plan.
- CoS-Calling: The model translates the plan into executable Python code, performing the tool calls to reach a solution.
To implement this, the authors developed CoS-GPT, a dataset of 20,000 entries covering planning, calling, and general code generation. Finetuning LLaMA-7B on this corpus resulted in LLaMA-CoS, a model capable of independent tool-based reasoning.
Key Insights: Disentanglement and Code Interfaces
A primary insight of Toolink is the importance of disentangling "thinking" from "doing." By separating planning from execution, the cognitive load on the 7B model is reduced, making the reasoning process more transparent. Furthermore, using Python code as a universal interface provides a more robust mechanism for tool invocation than natural language, allowing for complex logic like loops and conditional branching.
Results and Performance
LLaMA-CoS demonstrated exceptional performance, matching ChatGPT's accuracy across BIG-bench tasks with an average score of 94.74%. It significantly outperformed standard Chain-of-Thought (CoT) prompting; for instance, on the Navigate task, LLaMA-CoS achieved 99.56% accuracy compared to the base LLaMA-7B's 39.70%.
The model also showed superior generalization on unseen datasets like FinQA, often surpassing ChatGPT in planning accuracy. This indicates that LLaMA-CoS learns the underlying logic of tool utility rather than just memorizing specific function names.
Limitations and Future Directions
Despite its success, Toolink currently depends on a closed-source teacher model for the initial toolkit creation. Future research aims to transfer this "creative" toolkit generation capability directly into open-source models, moving toward fully autonomous agents. Additionally, while highly effective for logic and math, the framework's performance on more subjective or creative tasks remains an area for exploration.
Summary updated