Back to articles
AI Agents

Training API Agents Without a Real Environment

3 min read

Introduction

Training API-calling LLM agents is a data problem as much as a modeling problem. To learn how to search, update, create, or submit through APIs, agents need many high-quality trajectories. In practice, collecting those trajectories usually requires a fully implemented environment, executable endpoints, and realistic backend state. That setup is slow, costly, and hard to scale across different API ecosystems.

This paper argues that we can remove that bottleneck by using LLMs as on-the-fly digital world models.

What the method does

The method is designed to work from API specifications only. Instead of waiting for a complete environment, the pipeline synthesizes trajectories that look like real agent-environment interaction:

  • Task generation: an LLM creates diverse tasks that are solvable with the given APIs.
  • Teacher execution: a teacher agent attempts to solve each task step by step.
  • Environment simulation: an LLM simulator produces coherent API responses conditioned on the task context and the full interaction history.
  • Quality filtering: an LLM judge removes weak, inconsistent, or low-fidelity trajectories.

The important idea is statefulness. Many API workflows are not simple retrieval. They involve changing system state, so the simulator must stay internally consistent across turns. That makes the data much closer to a real interaction trace than a static instruction-response pair.

Why it matters

This approach changes the economics of training API agents:

  • You no longer need to build the full environment before collecting data.
  • You can bootstrap training data for new APIs faster.
  • The same recipe can be adapted across different domains and tools.
  • It supports both information-retrieval tasks and state-changing tasks.

The authors evaluate the approach on AppWorld and OfficeBench, two challenging benchmarks that cover these two task types. Fine-tuning models on the synthetic trajectories leads to clear gains, showing that useful supervision does not have to come from an executable backend.

Broader impact

The paper’s main contribution is practical: it reframes environment construction as environment simulation. For enterprise tools, office workflows, and other API-heavy systems, this could greatly reduce the friction of building training data.

At the same time, the method raises familiar concerns. How accurate is the simulator? Can the judge reliably detect subtle inconsistencies? Will the synthetic trajectories bias agents toward the simulator’s habits rather than the real world? Those are the next questions the field will need to answer.

Even with those caveats, the result is compelling: LLM-based API simulation may be a scalable way to train agents without first deploying a complete world.

Source: Hugging Face Daily Papers

Comments

Checking sign-in status...

Loading comments...

Related articles