ToolWeave: Structured Synthesis of Complex Multi-Turn Tool-Calling Dialogues
Organizations: IBM Research · IIIT Hyderabad
Abstract
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
| 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 |
| 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 |
| 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% |
| Dataset | Nat | Coh | Hel | Acc |
| ToolWeave | 4.38 | 4.12 | 3.89 | 4.38 |
| ToolFlow | 3.95 | 2.94 | 3.21 | 3.27 |
| ToolDial | 3.38 | 3.42 | 3.00 | 3.82 |
| Model | Avg. Acc. | Base | Miss Func. | Miss Param. | Long Ctx. |
| Llama-3.1-8B | 9.25 | 11.00 | 8.00 | 8.50 | 9.50 |
| + ToolDial | 1.75 | 0.50 | 3.50 | 2.50 | 0.50 |
| + ToolFlow | 7.50 | 9.50 | 5.50 | 5.50 | 9.50 |
| + ToolWeave-R (G) | 18.38 | 24.00 | 18.00 | 14.50 | 17.00 |
| + ToolWeave (O) | 19.88 | 23.00 | 21.50 | 15.50 | 19.50 |
| + ToolWeave (G) | 21.12 | 28.00 | 18.00 | 18.50 | 20.00 |
| Multi-step Accuracy | Single-step Accuracy | Average Accuracy | |
| Base | 10.80 | 17.12 | 12.50 |
| ToolFlow | 19.75 | 26.32 | 23.50 |
| ToolWeave | 38.73 | 44.08 | 39.75 |
| 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 |
| 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 |
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. ) | ✗ | ✓ | ✓ , ✗ | ✗ | ✗ |
| 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 |
| 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 |
| 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 |
| 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 |