面向API调用智能体的无环境合成数据生成
Environment-free Synthetic Data Generation for API-Calling Agents
July 18, 2026
作者: Seanie Lee, Sanjoy Chowdhury, Chao Jiang, Cheng-Yu Hsieh, Ting-Yao Hu, Alexander T Toshev, Oncel Tuzel, Raviteja Vemulapalli
cs.AI
摘要
训练API调用型大语言模型(LLM)代理需要海量高质量轨迹数据。然而,大规模收集此类数据通常需要完全实现的环境,包括可执行的API接口和预填充真实数据的后端数据库,这成为了可扩展性的主要瓶颈。为解决这一问题,我们提出了一种无需环境支持的合成数据生成方法,该方法利用LLM作为即时数字世界模型。仅基于API规范,我们的方法即可生成模拟代理与有状态环境交互的轨迹。具体而言,LLM首先生成可通过给定API解决的多样化任务;随后教师代理迭代执行每个任务,而LLM模拟器根据任务上下文和模拟历史生成连贯的合成API响应;最后通过LLM评判器过滤轨迹,确保数据集质量。我们在具有挑战性的AppWorld和OfficeBench基准测试上评估了该方法,这些测试包含信息检索和状态变更两类任务。基于合成数据微调的模型取得了显著的性能提升,证明无需可执行环境即可为API调用代理生成有效监督信号。研究结果表明,基于LLM的API模拟是跨多样化API生态系统训练代理的实用且可扩展的方案。
English
Training API-calling large language model (LLM) agents demands massive amounts of high-quality trajectories. However, collecting such data at scale typically requires fully implemented environments with executable APIs and realistic, pre-populated backend databases, creating a major bottleneck for scalability. To overcome this, we propose an environment-free synthetic data generation approach that leverages LLMs as on-the-fly digital world models. Given only API specifications, our method generates trajectories mimicking interactions between an agent and a stateful environment. Specifically, an LLM first generates diverse tasks solvable with the provided APIs. A teacher agent then iteratively solves each task while an LLM simulator generates coherent synthetic API responses conditioned on the task context and simulation history. Finally, an LLM judge filters the trajectories to ensure the quality of the resulting dataset. We evaluate our approach on the challenging AppWorld and OfficeBench benchmarks, which include both information-retrieval and state-changing tasks. Fine-tuning models on our synthetic data yields significant performance gains, demonstrating that effective supervision for API-calling agents can be generated without any executable environment. Our results establish LLM-based API simulation as a practical, scalable solution for training agents across diverse API ecosystems.