Manuscript Offprint

arXiv:2609.06124

SAP: State-Guided Data Synthesis with Argument Provenance for Multi-Turn Tool Use

Zichen Tian, Jinpeng Chen, Cheng Gong, Suiyun Zhang, Rui Liu

Abstract

High-quality multi-turn tool-use data is essential for training agentic models, yet existing data synthesis methods often underrepresent the argument-level dependencies that are critical to long-horizon tool use. As a result, even when a model selects the correct tool, task execution may still fail because the model fills tool arguments with fabricated, stale, or weakly grounded values. To address this problem, we propose State-Guided Data Synthesis with Argument Provenance (SAP). SAP combines state guidance, tool-argument provenance constraints, and turn-level validation to efficiently construct tool-use trajectories with long-range dependencies and high accuracy. Using data generated by SAP, we build SAP-4B, which is highly competitive even when compared with much larger models across multiple benchmarks. Source code, synthesized data, and trained weights are available at https://github.com/Zichen1024/SAP.

1 Introduction

Tool use is the primary interface through which large language models (LLMs) interact with the real world (Patil et al., 2025; Yao et al., 2024; Barres et al., 2025). As LLMs are deployed in long-horizon agentic systems, multi-turn tool use becomes a key axis of agent capability; yet the complexity of state evolution, tool feedback, and cross-turn dependencies makes high-quality multi-turn trajectories scarce, a major bottleneck for training agentic models (Rabinovich and Anaby-Tavor, 2025; Zhang et al., 2025; Prabhakar et al., 2025).

In practice, many multi-turn failures arise not from choosing the wrong tool, but from incorrectly specified tool arguments (Rabinovich and Anaby-Tavor, 2025). Yet existing data-synthesis work mostly focuses on tool-selection dependen-

Figure

Figure 1: Argument-dependency statistics on representative open-source multi-turn tool-use training sets and ours. Mean Chain Len. and Max Chain Len. denote the mean and maximum lengths of argument-value propagation chains across turns; Dep. Arg(s %) denotes the proportion of arguments involved in cross-turn dependencies.

cies: MAGNET (Yin et al., 2025) and FunReason-MT (Xu et al., 2025a), for example, use pre-built tool dependency graphs to ensure tool-sequence validity, while cross-turn dependencies among tool arguments are largely overlooked. Such dependencies are ubiquitous; arguments typically come from the initial environment state, prior tool-call returns, or earlier user messages, and when underrepresented in training data, the resulting models fabricate upstream references, reuse stale user inputs, or hallucinate substitutes when an upstream call fails. To quantify this gap, we measure the length of cross-turn argument-value propagation chains and the proportion of arguments involved in such dependencies, and find that existing open-source training datasets (Liu et al., 2024; Prabhakar et al., 2025) are consistently shallow on both,¹ leaving models prone to errors in complex multi-turn tasks (Rabinovich and Anaby-Tavor, 2025).

Beyond provenance, existing methods also face a hard trade-off between trajectory accuracy and generation cost. Two paradigms currently dominate. Intent-First methods (Qin et al., 2024; Prabhakar et al., 2025; Xu et al., 2025b; Zeng et al.,

*Project lead †Corresponding author.

¹Sample sizes for the statistics in Figure 1: ToolACE 11k, APIGen-MT 5k, SAP (Ours) 9k.

2026; Chen et al., 2026; Xu et al., 2026b) draft user intents first and expand dialogues and tool calls post hoc; their validation typically combines rule-based blueprint checks (schema, types, executability) with LLM committee review. Owing to the limited reliability of the underlying LLMs, this validation cannot fully guarantee accuracy, and a single failed check often discards the entire trajectory even when it contains locally correct subsequences. Trace-First methods (Yin et al., 2025; Xu et al., 2025a; Hao et al., 2026) sample executable trajectories over a tool-dependency graph and derive user-side queries from those traces; this gives strong executability guarantees but couples the graph to the source tool ecosystem, making migration to new domains costly.

To address these issues, we propose State-Guided Data Synthesis with Argument Provenance (SAP). Given a toolset and its documentation, SAP dynamically constructs a Finite State Machine (FSM) whose edges already carry per-argument provenance tags; it then samples state-transition trajectories from the FSM and fills tool arguments turn by turn. Arguments that depend on prior context are validated against the executed history, and each tool call is executed immediately after generation. If a call fails, only the offending call is retried rather than discarding the trajectory. Once the call sequence is fixed and verified, the framework generates the corresponding natural-language user and assistant messages. By combining state-transition guidance, parameter-provenance awareness, and immediate tool-call validation, SAP jointly supports executability, causal consistency of arguments, and cross-domain scalability, achieving both high quality and efficiency.

Using data synthesized by SAP, we train SAP-4B, which achieves competitive results on both BFCL v4 multi-turn (Patil et al., 2025) and τ2\tau^2-bench Retail/Airline (Barres et al., 2025). To support future research, the synthesis code, synthesized data, and trained weights are publicly available at https://github.com/Zichen1024/SAP. Our main contributions are as follows:

  • We introduce argument-provenance diagnostics for multi-turn tool-use data, showing that existing open-source data contain shallow dependency chains and few arguments that depend on previous turns, limiting their support for learning long-range argument tracking.

  • We propose SAP, a state-guided synthesis framework that dynamically builds an FSM from tool documentation, treats argument provenance as an explicit constraint, and validates tool calls turn by turn, enabling the efficient construction of multi-turn tool-use data with strong causal dependencies and high correctness.

  • We show that SAP-4B achieves competitive results on both BFCL v4 multi-turn and τ2\tau^2-bench; ablation studies further confirm the importance of each component.

References (16)