Tool Decoding: A Plug-and-Play Approach to Enhancing Language Models for Tool Usage

Chenheng Zhang, Mingqing Xiao, Yifei Wang, Lizhe Fang, Haihan Zhang, Zhouchen LinOpenReview 2025 · Submission to ICLR 2025 · Withdrawn

Its authors withdrew this paper, so there is no full text to read or summarize.

Abstract

Despite the significant advancements in large language models (LLMs), their tool-use capabilities remain limited. This limitation stems from the fact that existing approaches often merely adapt strategies designed for basic natural language tasks, overlooking the specific challenges inherent in tool usage, such as precise tool selection, strict predefined formats, and accurate parameter assignment. To bridge this gap, we conduct a fine-grained analysis of the tool usage process, breaking it down into three critical stages: tool awareness, tool selection, and tool call. Our analysis reveals that most failures stem from selection errors, format violations, and parameter mis-assignments. Building on these insights, we propose \textbf{Tool Decoding}, a novel, training-free approach that directly incorporates tool-specific information into the decoding process. Tool Decoding employs constrained decoding to ensure format correctness and eliminate hallucinations, while leveraging order consistency to improve parameter accuracy through structured sampling and a majority-voting mechanism. This approach effectively addresses many common tool-use errors in a plug-and-play manner, allowing for seamless generalization to new tools as long as they are accompanied by well-structured documentation to guide the decoding process. Experimental evaluations on benchmarks like API-Bank and BFCL V2 • Live show that Tool Decoding leads to significant improvements across a diverse set of more than 10 models, including both generalist and tool-finetuned models. Almost all models demonstrate performance gains exceeding 70\% on both benchmarks. Among the 7B-level models, five outperform GPT-3.5 on key tasks, with two even surpassing GPT-4.
BibTeX
@misc{zhang2025tool,
  author = {Chenheng Zhang and Mingqing Xiao and Yifei Wang and Lizhe Fang and Haihan Zhang and Zhouchen Lin},
  title = {{Tool Decoding: A Plug-and-Play Approach to Enhancing Language Models for Tool Usage}},
  year = {2025},
  url = {https://openreview.net/forum?id=5bUy4F59mk},
  howpublished = {OpenReview},
  note = {Submitted to ICLR 2025},
}
Figure