arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.18447cs.CL
收藏

ToolFlow:通过自然且连贯的对话合成提升 LLM 工具调用能力

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

The Chinese University of Hong Kong(香港中文大学);Huawei Noah’s Ark Lab(华为诺亚方舟实验室)

Zezhong Wang, Xingshan Zeng, Weiwen Liu, Liangyou Li, Yasheng Wang, Lifeng Shang, Xin Jiang, Qun Liu, Kam-Fai Wong

AI总结:

针对工具调用合成数据中工具相关性弱、对话连贯性不足的问题,本文提出 ToolFlow 流程,结合基于图的采样、计划生成与多智能体交互合成,显著提升数据质量及 LLaMA-3.1-8B 的工具调用表现。

摘要:

监督微调(SFT)是增强大型语言模型(LLM)工具调用能力的常用方法,其训练数据通常是合成的。当前的数据合成流程通常包括采样一组工具、基于这些工具提出需求,以及生成调用语句。然而,随机采样的工具缺乏相关性,难以组合,从而降低了数据的多样性。此外,现有工作忽视了对话轮次之间的连贯性,导致合成数据与真实场景之间存在差距。为解决这些问题,我们提出了一种基于图的采样策略,用于采样更相关的工具组合;以及一种计划生成策略,用于创建引导连贯对话合成的计划。我们将这两种策略结合起来,并使多个智能体能够交互式地合成对话数据,由此形成了我们的工具调用数据合成流程 ToolFlow。数据质量评估表明,我们合成的对话在自然性和连贯性方面均有提升。最后,我们使用 ToolFlow 生成的 8,000 段合成对话,在 LLaMA-3.1-8B 上进行 SFT。结果表明,该模型取得了与 GPT-4 相当甚至超越 GPT-4 的工具调用性能,同时保持了较强的通用能力。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑