ToolCoder: A Systematic Code-Empowered Tool Learning Framework for Large Language Models
Hanxing Ding, Shuchang Tao, Liang Pang, Zihao Wei, Jinyang Gao, Bolin Ding, Huawei Shen, Xueqi Cheng

TL;DR
ToolCoder introduces a code-centric framework for large language models to improve tool learning by transforming natural language queries into structured code, enabling better reasoning, planning, and debugging.
Contribution
It reformulates tool learning as a code generation task, integrating software engineering principles to enhance reasoning, debugging, and code reuse in LLMs.
Findings
Achieves higher task accuracy than existing methods.
Improves robustness through systematic debugging.
Enhances efficiency with code reuse strategies.
Abstract
Tool learning has emerged as a crucial capability for large language models (LLMs) to solve complex real-world tasks through interaction with external tools. Existing approaches face significant challenges, including reliance on hand-crafted prompts, difficulty in multi-step planning, and lack of precise error diagnosis and reflection mechanisms. We propose ToolCoder, a novel framework that reformulates tool learning as a code generation task. Inspired by software engineering principles, ToolCoder transforms natural language queries into structured Python function scaffold and systematically breaks down tasks with descriptive comments, enabling LLMs to leverage coding paradigms for complex reasoning and planning. It then generates and executes function implementations to obtain final responses. Additionally, ToolCoder stores successfully executed functions in a repository to promote…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
Taxonomy
TopicsNatural Language Processing Techniques · Topic Modeling · Semantic Web and Ontologies
