TL;DR
To overcome the fragility and cost of real-world APIs and manual environment design, AgentScaler introduces a pipeline that automatically constructs over 1,000 executable, database-grounded simulation environments from raw API specifications. By training on verifiable human–agent interaction trajectories using a two-stage learning scheme, compact models (from 4B to 30B-A3B parameters) achieve state-of-the-art function-calling performance, rivaling closed-source and trillion-parameter baselines.
What Problem Does This Paper Address?
Language agents need extensive multi-turn experience to master function calling. However, gathering high-quality agent interaction data faces severe roadblocks:
- Real-world APIs are noisy, rate-limited, expensive, and subject to transient failures, making them unsuitable for large-scale, deterministic training.
- LLM-simulated environments frequently suffer from hallucinations and inconsistent state tracking.
- Handcrafted mock environments (such as $\tau$-bench) provide high fidelity but require massive manual engineering, making it difficult to scale across thousands of diverse domains.
The authors tackle two foundational questions: how to automatically build and scale verifiable tool-use environments, and how to train agents from the synthetic interaction experience collected within them.
Methods
The authors frame any API interaction as a deterministic read–write operation over an underlying database ($\mathcal{D}$). Their approach unfolds in two main phases:
1. Automated Environment & Task Construction
- Graph-Based Domain Partitioning: Starting from >30,000 raw APIs, parameter similarity is calculated to build a tool dependency graph. The Louvain community detection algorithm clusters related tools into coherent domains (>1,000 domains identified), which are further refined using an LLM.
- Programmatic Materialization: For each domain, a underlying database schema ($\mathcal{S}_k$) is generated, and tools are materialized into executable Python functions performing stateful read/write operations on this database.
- Task Synthesis via Directed Walks: Logically coherent tool call chains are sampled via directed walks on the domain graph. Each chain establishes an initial database state, intermediate parameter bindings, and an overarching user intent, yielding dual-granularity verifiability: database-level state consistency and exact tool sequence matching.
2. Experience Collection & Two-Stage Learning
- Human–Agent Interplay Simulation: An agent interacting with a simulated user is executed end-to-end using
Qwen3-235B-A22B-Thinking. Trajectories pass through a 3-stage funnel filter: (1) validity and repetition control, (2) final environment state alignment (for write operations), and (3) exact tool sequence match (for read-only tasks). - Two-Stage Experience Learning:
- Stage 1 (General Foundation): Broad multi-domain training to teach fundamental tool invocation and context-grounded conversation.
- Stage 2 (Domain Specialization): Targeted fine-tuning within specific vertical domains (e.g., airline, retail). Supervision loss masks out user inputs and environment outputs, focusing gradients solely on assistant tool calls and responses.
Datasets
- Construction Corpora: Sourced from ToolBench, API-Gen, and public repositories (>30,000 APIs, mapped to >1,000 domains).
- Evaluation Benchmarks:
- $\tau$-bench (retail, airline domains).
- $\tau^2$-Bench (dual-control evaluation spanning retail, airline, and telecom).
- ACEBench-en (evaluating Normal, Special, and Agent tool-calling categories).
- ACEBench-zh (used as an out-of-distribution cross-lingual test).
Key Insights and Ideas
- State Transitions Provide Ground-Truth Supervision: Abstracting tools as database operators allows trajectory verification without human labeling. If the post-interaction database state matches the expected state, the agent's write operations succeeded—even if intermediate retries or errors occurred.
- Retaining Error Trajectories Boosts Robustness: Rather than discarding interactions with intermediate API failures, trajectories that recover and reach the correct final state are retained, teaching the model self-correction.
- The "Pass$^k$" and Long-Horizon Wall: Evaluating with $\text{pass}^k$ (requiring consistent success across all $k$ independent runs) reveals significant performance degradation across all LLMs. Similarly, agent success rates drop precipitously as the number of tool invocations increases, highlighting long-horizon tool execution as an ongoing challenge.
Key Results
The authors trained three models—AgentScaler-4B, AgentScaler-8B, and AgentScaler-30B-A3B (3B active parameters)—built on the Qwen-3 architecture:
- SOTA Among Sub-Trillion Models: On $\tau^2$-Bench, AgentScaler-30B-A3B achieves 70.2% (Retail), 60.0% (Airline), and 55.3% (Telecom), matching or outperforming models orders of magnitude larger, such as GPT-OSS-120B-A5B and DeepSeek-V3.1-671B-A37B.
- Small Model Capabilities: AgentScaler-4B performs comparably to baseline 30B models. On ACEBench-zh (cross-lingual OOD), training propelled its Agent score from 6.7 to 38.4, lifting its overall score by 21.7 points.
- Format & Schema Generalization: Despite being trained with the Qwen-Hermes tool format, AgentScaler generalized directly to ACEBench's custom parsing format and unseen tool schemas without explicit format tuning.
Limitations and Future Work
- Supervised Learning Only: The current pipeline uses two-stage supervised fine-tuning. The authors note that the deterministic, low-latency simulated environment is ideally suited for online Reinforcement Learning (e.g., policy gradients), which remains future work.
- Model Scale Ceiling: Validation was limited to models up to 30B total parameters; scaling to 200B+ or trillion-parameter foundations was not explored.
- Long-Horizon Degradation: Performance still deteriorates substantially on tasks requiring extended sequences of tool calls (>10 calls).
Summary updated