用失败案例生成复杂工具调用样本,提升大模型训练效果
From Failure to Mastery: Generating Hard Samples for Tool-use Agents
- 基于失败案例构建动态API图,生成难样本
- 40亿参数模型在新数据上超越GPT-5.2等主流模型
- 适合研究智能体训练与复杂推理的开发者
具备工具使用能力的大语言模型智能体的发展,依赖于多样且复杂的训练数据。现有数据生成方法多采用随机采样和浅层生成,常产生简单同质的轨迹,难以捕捉复杂的隐式逻辑依赖。为此,我们提出HardGen,一种自动化的智能体流水线,用于生成具有可验证推理过程的难样本。首先,HardGen基于智能体失败案例构建动态API图,并从中采样合成难轨迹;其次,这些轨迹作为条件先验,引导模块化抽象高级工具的实例化,进而生成复杂查询;最后,借助高级工具与难查询,生成可验证的复杂思维链(CoT),并通过闭环评估反馈持续优化流程。大量实验表明,使用我们构建的数据集训练的40亿参数模型,在性能上优于多个领先开源与闭源模型(如GPT-5.2、Gemini-3-Pro和Claude-Opus-4.5)。代码、模型与数据集将开源,以促进后续研究。
原文摘要 · Abstract (English)
The advancement of LLM agents with tool-use capabilities requires diverse and complex training corpora. Existing data generation methods, which predominantly follow a paradigm of random sampling and shallow generation, often yield simple and homogeneous trajectories that fail to capture complex, implicit logical dependencies. To bridge this gap, we introduce HardGen, an automatic agentic pipeline designed to generate hard tool-use training samples with verifiable reasoning. Firstly, HardGen establishes a dynamic API Graph built upon agent failure cases, from which it samples to synthesize hard traces. Secondly, these traces serve as conditional priors to guide the instantiation of modular, abstract advanced tools, which are subsequently leveraged to formulate hard queries. Finally, the advanced tools and hard queries enable the generation of verifiable complex Chain-of-Thought (CoT), with a closed-loop evaluation feedback steering the continuous refinement of the process. Extensive evaluations demonstrate that a 4B parameter model trained with our curated dataset achieves superior performance compared to several leading open-source and closed-source competitors (e.g., GPT-5.2, Gemini-3-Pro and Claude-Opus-4.5). Our code, models, and dataset will be open-sourced to facilitate future research.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。