StateForge: Synthesizing Verifiable Long-Horizon Data for Tool-Using Agents via State-Change Supervision

Wenlong Fei, Gangtao Xin, Chengyu Shen, Jiawei Li, Yedi Hu, Jingren Zhang, Hao Jiang, Chong Chen, Yang GaoarXiv 2026

TL;DR

Training AI agents to execute long sequences of tool calls usually means either forcing them to memorize rigid action scripts or grading them with blind spots that miss collateral damage. StateForge solves this by supervising agents based on net changes to the environment’s state—measuring whether the database actually looks the way it should at the end, regardless of the path taken. Using this principle to synthesize complex training worlds and reward reinforcement learning, a compact 4B-parameter model outperforms specialized agent models up to eight times its size.

What Problem Does This Paper Address?

Imagine asking an AI assistant to update Alice’s shipping address. Over a long chain of API calls, how do we verify the agent actually succeeded so we can train on that data?

Current verification methods fall into three traps:

  1. Execution checks only verify that API calls didn't throw syntax errors—meaning an agent can cleanly and "successfully" update Bob’s address by mistake.
  2. Reference matching grades the agent against a single "golden" sequence of tool calls, unfairly penalizing clever, valid alternative routes to the same answer.
  3. LLM rubrics check if Alice's address changed, but often forget to check if the agent accidentally mangled Bob’s record along the way.
Figure 1. Verification challenges in tool use. For a task that requires updating Alice’s address, (a) all tool calls succeed, but the agent updates Bob instead; (b) different tool-call sequences produce the same correct state change, yet reference-call matching may reject a valid alternative; and (c) a rubric covering only Alice’s update can pass despite an unintended change to Bob’s address.

As tasks stretch into dozens of dependent steps, synthesizing tasks that are guaranteed to be solvable—and verifying them without stifling valid exploration or missing unintended side effects—becomes a major bottleneck.

Methods

StateForge unifies environment synthesis, Supervised Fine-Tuning (SFT), and Reinforcement Learning (RL) around a single anchor: the target state change ($\Delta$), defined as the exact difference between an environment's initial state ($S_0$) and its desired final state ($S_g$).

Figure 2. Overview of StateForge. Reference execution produces a reachable target state change ∆= Diff(S0, Sg), where Sg is the terminal state. A task–target audit verifies consistency between the task description and ∆. Direct, Progressive, and Recovery synthesis vary the interaction conditions while preserving the same target. Exact state-change matching filters SFT demonstrations, while matching provides outcome rewards for RL under the complete goal specification.
  1. Bottom-Up Task Construction: Instead of dreaming up a prompt and hoping it's solvable, StateForge builds executable database environments and maps their tools into a dependency graph (tracking which tool outputs feed into other tool inputs). It executes a valid workflow first to observe the exact state difference $\Delta$, and then writes a natural-language task description audited to match $\Delta$.
  2. Three-Mode Trajectory Synthesis: Holding $\Delta$ constant, StateForge generates SFT demonstrations under three distinct interaction conditions:
  3. Direct: The full goal is given upfront in a stable environment.
  4. Progressive: Requirements are revealed in stages, forcing the agent to adapt without overwriting earlier work.
  5. Recovery: A controller actively perturbs the environment mid-task (e.g., invalidating a prerequisite), training the agent to notice and repair disrupted states.
  6. Unified State-Change Supervision: For SFT, trajectories are kept only if their net state change exactly matches $\Delta$—zero missing targets, zero unintended side effects. For RL (using standard Group Relative Policy Optimization, or GRPO), StateForge introduces a graded reward that credits matched state paths and penalizes unexpected modifications proportional to their size, requiring no reference trajectory or LLM judge.

Datasets

  • Synthesized Training Corpus: StateForge introduces a synthetic dataset of 544 executable environments and 1,697 tasks yielding 34,782 SFT examples. Compared to prior synthetic suites like EnvFactory (~12 tool calls/task) and EnvScaler (~15–17 calls/task), StateForge environments are substantially denser (averaging 50.87 tools per environment) and much longer-horizon, averaging 69 tool calls per task.
  • Evaluation Benchmarks: Models are evaluated on three established tool-use benchmarks: $\tau^2$-Bench (Airline, Retail, and Telecom conversational service), DeepPlanning Shopping (multi-constraint cart building), and BFCL-v3 Multi-Turn (function calling with missing parameters/functions and long contexts).

Key Insights and Ideas

  • More synthetic data isn't automatically better: When fine-tuning the exact same Qwen3.5-4B backbone, training on existing synthetic datasets (EnvFactory and EnvScaler) actually degraded performance compared to the base model by 10 to 24 percentage points. StateForge was the only corpus to improve the strong base model, highlighting the necessity of strict state-change verification and rich environments.
  • Data diversity beats raw parameter scaling: Fine-tuning a 4B model on StateForge's interaction modes yielded larger accuracy gains on DeepPlanning Shopping (+6.67 percentage points) than more than doubling the base model's size from 4B to 9B (+5.00 percentage points).
  • "Happy path" demonstrations aren't enough: Training on Direct trajectories alone actually hurt conversational performance on $\tau^2$-Bench (dropping from 84.40% to 80.20%). Mixing in Progressive and Recovery trajectories pushed performance up to 85.33%, proving agents need practice handling shifting goals and mid-flight disruptions.

Key Results

Initialized from Qwen3.5-4B and Qwen3.5-9B backbones, StateForge achieves state-of-the-art results among specialized agent models:

  • Punching above its weight: StateForge-4B-RL achieves 91.17% macro-average success on $\tau^2$-Bench, 43.33% accuracy on DeepPlanning Shopping, and 27.25% on BFCL-v3 Multi-Turn—beating specialized agent baselines up to 32B parameters (such as TOUCAN-32B and ScaleEnv-32B).
  • Scaling further with RL: StateForge-9B-RL reaches 91.74% on $\tau^2$-Bench (the highest score in the entire comparison, surpassing GPT-5.2 High at 78.16% and Claude Opus 4.5 at 85.30%) and 46.67% on Shopping.
  • RL adds clear value: Adding state-change RL on top of SFT boosted $\tau^2$-Bench Macro scores by +5.83 percentage points for the 4B model and +1.17 percentage points for the 9B model.

Limitations and Future Work

  • Single target outcomes: StateForge assumes a single fixed target state change $\Delta$ per task. It does not yet accommodate open-ended tasks where multiple distinct final database states are equally acceptable.
  • Blindness to intermediate steps: Because verification only compares the initial state $S_0$ to the terminal state $S_\tau$, it cannot enforce constraints on intermediate behavior (for instance, forbidding an agent from temporarily violating a rule even if it cleans up its mess before finishing). Future work aims to expand verification to cover multi-outcome tasks and intermediate trajectory constraints.
  • Synthetic safety: While synthetic sandboxes protect live user data, generated workflows can omit real-world authorization safeguards, requiring proper permission controls before real-world deployment.

Summary updated

BibTeX
@misc{fei2026stateforge,
  author = {Wenlong Fei and Gangtao Xin and Chengyu Shen and Jiawei Li and Yedi Hu and Jingren Zhang and Hao Jiang and Chong Chen and Yang Gao},
  title = {{StateForge: Synthesizing Verifiable Long-Horizon Data for Tool-Using Agents via State-Change Supervision}},
  year = {2026},
  eprint = {2611.38108},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.38108},
}
Figure