ToolFlow: Boosting LLM Tool-Calling Through Natural and Coherent Dialogue Synthesis

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Wang, Zezhong, Zeng, Xingshan, Liu, Weiwen, Li, Liangyou, Wang, Yasheng, Shang, Lifeng, Jiang, Xin, Liu, Qun, Wong, Kam-Fai
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915199274975232
author Wang, Zezhong
Zeng, Xingshan
Liu, Weiwen
Li, Liangyou
Wang, Yasheng
Shang, Lifeng
Jiang, Xin
Liu, Qun
Wong, Kam-Fai
author_facet Wang, Zezhong
Zeng, Xingshan
Liu, Weiwen
Li, Liangyou
Wang, Yasheng
Shang, Lifeng
Jiang, Xin
Liu, Qun
Wong, Kam-Fai
contents Supervised fine-tuning (SFT) is a common method to enhance the tool calling capabilities of Large Language Models (LLMs), with the training data often being synthesized. The current data synthesis process generally involves sampling a set of tools, formulating a requirement based on these tools, and generating the call statements. However, tools sampled randomly lack relevance, making them difficult to combine and thus reducing the diversity of the data. Additionally, current work overlooks the coherence between turns of dialogues, leading to a gap between the synthesized data and real-world scenarios. To address these issues, we propose a Graph-based Sampling strategy to sample more relevant tool combinations, and a Planned-generation strategy to create plans that guide the synthesis of coherent dialogues. We integrate these two strategies and enable multiple agents to synthesize the dialogue data interactively, resulting in our tool-calling data synthesis pipeline ToolFlow. Data quality assessments demonstrate improvements in the naturalness and coherence of our synthesized dialogues. Finally, we apply SFT on LLaMA-3.1-8B using 8,000 synthetic dialogues generated with ToolFlow. Results show that the model achieves tool-calling performance comparable to or even surpassing GPT-4, while maintaining strong general capabilities.
format Preprint
id arxiv_https___arxiv_org_abs_2410_18447
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle ToolFlow: Boosting LLM Tool-Calling Through Natural and Coherent Dialogue Synthesis
Wang, Zezhong
Zeng, Xingshan
Liu, Weiwen
Li, Liangyou
Wang, Yasheng
Shang, Lifeng
Jiang, Xin
Liu, Qun
Wong, Kam-Fai
Computation and Language
Supervised fine-tuning (SFT) is a common method to enhance the tool calling capabilities of Large Language Models (LLMs), with the training data often being synthesized. The current data synthesis process generally involves sampling a set of tools, formulating a requirement based on these tools, and generating the call statements. However, tools sampled randomly lack relevance, making them difficult to combine and thus reducing the diversity of the data. Additionally, current work overlooks the coherence between turns of dialogues, leading to a gap between the synthesized data and real-world scenarios. To address these issues, we propose a Graph-based Sampling strategy to sample more relevant tool combinations, and a Planned-generation strategy to create plans that guide the synthesis of coherent dialogues. We integrate these two strategies and enable multiple agents to synthesize the dialogue data interactively, resulting in our tool-calling data synthesis pipeline ToolFlow. Data quality assessments demonstrate improvements in the naturalness and coherence of our synthesized dialogues. Finally, we apply SFT on LLaMA-3.1-8B using 8,000 synthetic dialogues generated with ToolFlow. Results show that the model achieves tool-calling performance comparable to or even surpassing GPT-4, while maintaining strong general capabilities.
title ToolFlow: Boosting LLM Tool-Calling Through Natural and Coherent Dialogue Synthesis
topic Computation and Language
url https://arxiv.org/abs/2410.18447