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.
Figures & tables
Figure 1: The modular architecture of ToolWeave. Starting with a domain name, the Tool Graph Synthesizer creates synthetic APIs and organizes them into an interconnected graph; the Structured Tool Graph Sampler extracts coherent subgraphs as goals; the Structured Plan Generator expands these goals into detailed dialogue plans; and the Multi-Agent Dialogue Synthesizer instantiates the plans into natural multi-turn dialogues.
Figure 2: Input schema comparison for generate_maintenance_schedule() . One-shot generation yields a flat parameter list, while ToolWeave produces a richer schema with nested objects.
Metric
GPT-OSS (O)
Mistral (M)
GPT-5-mini (G)
Avg. APIs / Domain
25.25
20.85
28.35
Avg. Params / API
3.60
2.92
5.01
Complex API Use (CAU)
23.6%
19.8%
36.6%
Required Param Ratio (RPR)
65.6%
68.4%
48.9%
Interconnectivity (IC)
1.08
1.85
1.03
Longest Chain (avg.)
5.5
5.9
6.15
Table 1: Avg. API stats per domain across synthesis seeds.
Dataset
Min/Max/Avg.
Min/Max/Avg.
% Total / % True
Turns
Tool Calls
Multi-step Turns
ToolWeave
1/8/2.71
1/5/3.22
44.87 / 40.67
ToolFlow
1/10/6.28
0/15/2.20
6.77 / 0.0
ToolDial
2/6/4.48
0/2/1.51
4.47 / 0.0
Table 2: Statistics of synthetic dialogues grouped by synthesis pipeline.
Hallucination Type
ToolWeave
ToolDial
ToolFlow
Tool name hallucination
0.0%
30.5%
5.0%
Parameter name hallucination
0.0%
3.5%
0.0%
Parameter value hallucination
20.0%
4.5%
46.5%
Assistant text output hallucination
0.0%
24.5%
75.5%
No hallucination (clean)
80.0%
46.5%
16.5%
Table 3: Hallucination analysis across ToolWeave, ToolDial, and ToolFlow.
Table 6: BFCL-V3 multi-turn performance of Llama-3.1-70B across two splits: multi-step and single-step dialogues.
Model
API-L1
API-L2
CONFETTI
Average
Llama-3.1-8B
62.91
59.46
20.55
47.64
+ ToolDial
59.15
52.70
23.12
44.99
+ ToolFlow
67.92
54.05
17.39
46.45
+ ToolWeave-R (G)
68.17
51.35
19.37
46.30
+ ToolWeave (O)
68.92
60.81
36.76
55.50
+ ToolWeave (G)
75.44
63.51
28.85
55.93
Table 7: Generalization across API-L1, API-L2, and CONFETTI.
Setting
Average Acc.
Full ToolWeave Pipeline
19.88
w/o Post-Processing
13.62
w/o Structured Sampler (Random Walk)
12.25
w/o Fine-Grained Planner (ToolFlow-style)
7.50
Table 8: Component ablation on Llama-3.1-8B-Instruct (BFCL-V3).
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
Framework
Synthesize APIs
Code d
Data Released, License Friendly
License Friendly Synthesis Model
Fine-Grained Plan
Tooldial ( Shim et al. )
✗
✓
✓ , ✗
✗
✗
ToolAce ( Liu et al. )
✓
✗
✓ , ✗
✗
✗
APIgen-MT ( Prabhakar et al. )
✗
✗
✓ , ✗
✗
✗
ToolFlow ( Wang et al. )
✗
✗
✗ , ✗
✗
✗
Button ( Chen et al. )
✓
✗
✓ , ✗
✗
✗
ToolLLM ( Qin et al. )
✗
✓
✓ , ✗
✗
✗
Appendix
Table 9: Comparison of multi-turn synthetic data pipelines across different dimensions.
Figure 3: E-commerce tool graph demonstrating linear, fan-in-fan-out (dashed), and conditional (green) dependency patterns. Red nodes indicate auxiliary tools providing specific configuration parameters, such as foreign exchange rates or zone policies, to the primary workflow.
Hyperparameter
Llama-3.1-8B-Instruct
Llama-3.1-70B-Instruct
Phi-4
Model Details
quantization_bit
4
4
4
flash_attn
fa2
fa2
fa2
LoRA Configuration
lora_rank
32
8
16
lora_alpha
64
32
32
Appendix
Table 10: Key fine-tuning hyperparameters for all models.
Synthesis Model
Acc
Base
MissFunc
MissParam
LongCtx
ToolWeave (Mistral-Small-24B) [Open]
28.00
29.00
32.50
26.50
24.00
ToolWeave (Mistral-Medium) [Commercial]
28.88
27.50
39.00
30.00
19.00
ToolWeave (GPT-OSS-120B) [Open]
33.25
37.50
35.00
32.00
28.50
ToolWeave (GPT-5-mini) [Frontier]
39.75
42.50
43.00
37.00
36.50
Appendix
Table 11: Full performance breakdown of Llama-3.1-70B fine-tuned on data generated by different synthesis models.
Setting
Acc
Base
MissFunc
MissParam
LongCtx
ToolWeave (GPT-OSS seed) w/o postproc
13.62
14.50
14.50
13.50
12.00
ToolWeave (GPT-OSS seed) w/ postproc
19.88
23.00
21.50
15.50
19.50
Absolute Gain
+6.26
+8.50
+7.00
+2.00
+7.50
Appendix
Table 12: Performance impact of the post-processing (postproc) stage on Llama-3.1-8B-Instruct.
Setting
Acc
Base
MissFunc
MissParam
LongCtx
ToolWeave (no postproc)
13.62
14.50
14.50
13.50
12.00
Random sampling + ToolWeave
12.25
13.00
14.00
13.50
8.50
Structured sampling + ToolFlow
7.50
9.50
7.50
5.00
8.00
ToolFlow baseline (GPT-OSS seed)
7.62
11.00
4.50
5.50
9.50
Appendix
Table 13: Performance comparison across pipeline settings (excluding post-processing). Validates the Structured Sampler and Fine-Grained Planner.