Saved in:
Bibliographic Details
Main Authors: Zhang, Kexun, Chen, Hongqiao, Li, Lei, Wang, William
Format: Preprint
Published: 2023
Subjects:
Online Access:https://arxiv.org/abs/2310.07075
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909216208322560
author Zhang, Kexun
Chen, Hongqiao
Li, Lei
Wang, William
author_facet Zhang, Kexun
Chen, Hongqiao
Li, Lei
Wang, William
contents Instruction-tuned large language models (LLMs) excel at many tasks but often fail to use external tools due to complicated and unfamiliar syntax constraints. While extensive fine-tuning and prompting can mitigate the issue, these approaches are expensive and hard to generalize. Furthermore, because syntax constraints are only learned implicitly during fine-tuning, models still make frequent syntax errors. Motivated by the fact that these constraints can be better satisfied explicitly with constrained decoding, we propose TOOLDEC, a decoding algorithm using finite state machines to force LLMs to follow tool syntax. Our experiments show that TOOLDEC eliminates all syntax errors, achieving significantly better performance on various base models and benchmarks. More surprisingly, when applied to generalist out-of-the-box LLMs such as Mistral-Instruct, TOOLDEC improves its accuracy in tool use from the initial 0% to an impressive 52%, matching the performance of specialized fine-tuned models such as ToolLLM.
format Preprint
id arxiv_https___arxiv_org_abs_2310_07075
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Don't Fine-Tune, Decode: Syntax Error-Free Tool Use via Constrained Decoding
Zhang, Kexun
Chen, Hongqiao
Li, Lei
Wang, William
Computation and Language
Artificial Intelligence
Instruction-tuned large language models (LLMs) excel at many tasks but often fail to use external tools due to complicated and unfamiliar syntax constraints. While extensive fine-tuning and prompting can mitigate the issue, these approaches are expensive and hard to generalize. Furthermore, because syntax constraints are only learned implicitly during fine-tuning, models still make frequent syntax errors. Motivated by the fact that these constraints can be better satisfied explicitly with constrained decoding, we propose TOOLDEC, a decoding algorithm using finite state machines to force LLMs to follow tool syntax. Our experiments show that TOOLDEC eliminates all syntax errors, achieving significantly better performance on various base models and benchmarks. More surprisingly, when applied to generalist out-of-the-box LLMs such as Mistral-Instruct, TOOLDEC improves its accuracy in tool use from the initial 0% to an impressive 52%, matching the performance of specialized fine-tuned models such as ToolLLM.
title Don't Fine-Tune, Decode: Syntax Error-Free Tool Use via Constrained Decoding
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2310.07075