SAP: State-Guided Data Synthesis with Argument Provenance for Multi-Turn Tool Use
Organizations: Independent Researcher · Huawei Research
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.
Figures & tables
| Sym. | Type | Semantics |
|---|---|---|
| initial_state | A field of ; since the assistant cannot read directly, the value enters turn either from the user message or from a same-turn read-only call. | |
| prev_output | Field of the -th call at a prior executed turn (all of are bound at runtime by ; only declares the tag). | |
| self_create | New user-side value introduced at this turn; later surfaced in . | |
| prev_user_msg | Value semantically introduced in for some ; dialogue generated retroactively. | |
| fallback | Runtime fallback when a declared source cannot be used: no matching field of , no matching prior return, or no usable anchor value. The planner recovers the argument from another available value or from a new value when permitted; the resulting call is executor-validated after binding, and the original source is kept in fallback_from . |
| BFCL v4 Multi-Turn | -bench (pass 1 ) | ||||||||
| Model | Size | Avg | Base | MFn | MPm | LCtx | Retail | Airline | Avg |
| Closed-source / large-scale reference (BFCL v4) | |||||||||
| GPT-5.2-High | – | 48.5 | – | – | – | – | 81.6 | 62.5 | 72.1 |
| Claude Sonnet 4.5 | – | 61.4 | 69.0 | 65.0 | 52.5 | 59.0 | 86.2 | 70.1 | 78.2 |
| Gemini-3 Pro | – | 60.8 | 64.5 | 60.0 | 54.5 | 64.0 | 85.3 | 72.7 | 79.0 |
| DeepSeek-V3.2-Exp | 685B | 37.4 | 41.5 | 39.5 | 33.5 | 35.0 | – | – | – |
| Variant | Avg | Base | MFn | MPm | LCtx |
|---|---|---|---|---|---|
| SAP -4B (Full) | 30.4 | 38.0 | 23.0 | 24.5 | 36.0 |
| A1: w/o Prov. Tag | 24.0 | 29.5 | 19.5 | 21.5 | 25.5 |
| A2: w/o | 28.8 | 37.0 | 21.0 | 22.5 | 34.5 |
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
| Marker | Trigger (when processing turn ) | Expression constraint in |
|---|---|---|
| [NEW] | , or (anchor for downstream ) | Explicit literal value: first occurrence in the dialogue. |
| [FROM_HISTORY] | (upstream at turn ) | Vague reference (“that file”, “the ID you found earlier”); literal must NOT be repeated. |
| [FROM_CONFIG] | , value must be passed verbatim to a tool argument | Explicit literal value (the assistant cannot read ): IDs, credentials, token-like fields. |
| [FALLBACK_from_ ] | (original source in metadata) | Treated as [NEW] : explicit literal value. |
| Backbone | Traj | Args | Fb.% | % | % | % |
|---|---|---|---|---|---|---|
| Gemini-3.1 Pro | 500 | 3,962 | 2.02 | 42.7 | 25.5 | 29.8 |
| Gemini-3 Pro | 500 | 4,348 | 2.76 | 36.4 | 24.0 | 36.9 |
| DeepSeek-V4-Flash | 500 | 3,253 | 3.08 | 28.3 | 0 9.2 | 59.4 |
| Qwen3.5-Plus | 500 | 4,365 | 4.82 | 27.3 | 34.4 | 33.5 |
| Variant | Succ | % | % | % | % |
|---|---|---|---|---|---|
| Full SAP | 89% | 2.06 | 29.5 | 40.9 | 27.5 |
| FSM+noTag | 92% | 0.00 | 0.0 | 53.8 | 46.2 |
| noFSM+Tag | 50% | 15.75 | 16.2 | 43.9 | 24.2 |
| noFSM+noTag | 66% | 0.00 | 0.0 | 54.2 | 45.8 |
| noRetry | 54% | 3.45 | 24.8 | 42.3 | 29.4 |
| Split | Backbone | SAP-4B | |
|---|---|---|---|
| Non-live | 84.36 | 84.88 | +0.52 |
| Live | 75.41 | 75.95 | +0.54 |
| Overall avg | 79.89 | 80.42 | +0.53 |
| Turns | / | Span | |||
|---|---|---|---|---|---|
| Trajectory A (local) | 2 | 0 | 0 | 3 | 0 |
| Trajectory B (cross-turn) | 3 | 0 | 2 | 1 | 2 |
Synthetic Data Generation for Language Models
Synthetic data generation for language models creates artificial text, tasks, and interaction traces to train or evaluate models.
See all 293 papers