构建真实多轮工具调用对话,提升大模型自主执行能力
ToolWeave: Structured Synthesis of Complex Multi-Turn Tool-Calling Dialogues

- 通过工具依赖与任务对齐生成多步工作流
- 多步工具调用占比达45%,参数幻觉显著减少
- 适合训练具备复杂任务规划能力的智能体
多轮工具调用是大模型作为自主智能体的关键能力,但其训练数据的合成仍面临根本挑战。现有方法生成的对话不真实:工具链仅表面兼容而非任务对齐,且一次性生成导致参数和工具名出现用户未提供、前序调用也未产生的内容。这导致多步工具交互严重不足。本文提出ToolWeave,一种结构化合成框架,通过内置依赖关系的工具设计与任务目标对齐筛选工作流,结合细粒度规划阶段追踪参数来源,有效减少参数幻觉。生成对话中多步工具调用占比达45%,参数与工具名幻觉大幅降低。基于ToolWeave训练的大模型在三个公开基准上均优于此前数据集,其中Llama-3.1-70B在BFCL-V3多轮任务上达到39.75%准确率,相较SOTA ToolFlow数据微调的23.50%有显著提升。
原文摘要 · Abstract (English)
Multi-turn tool calling is essential for LLMs to function as autonomous agents, yet synthesizing the training data required for these capabilities remains a fundamental challenge. Existing synthetic data generation pipelines often produce unrealistic dialogues for two reasons: they chain tools that are only superficially compatible rather than aligned with meaningful user tasks, and they generate dialogues in one shot, which often introduces arguments that were neither provided by the user nor produced by prior tool calls. These issues also lead to a severe underrepresentation of multi-step tool interactions. We introduce ToolWeave, a structured framework for synthesizing realistic multi-turn tool-calling dialogues. ToolWeave support realistic multi-step workflows (or tool sequences) by constructing tools with built-in dependencies and filters the workflows based on alignment with user goals. It reduces parameter hallucination by using a fine-grained planning stage that explicitly tracks parameter provenance. As a result, ToolWeave-generated synthetic dialogues contain more multi-step tool interactions (45%) and fewer hallucinations in parameters and tool names. Consequently, LLMs fine-tuned on ToolWeave consistently outperform those fine-tuned on prior datasets across three public benchmarks. Notably, Llama-3.1-70B fine-tuned on ToolWeave achieves 39.75% on BFCL-V3 multi-turn, compared to 23.50% when fine-tuned on SOTA ToolFlow data.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。