Manuscript Offprint

arXiv:2609.09072

ToolLoop: Closed-Loop Tool-Use Data Synthesis via Decomposed Generation and Dynamic Self-Feedback

Min Zeng, Yuzhou Liu, Zhenyu Cao, Hanxiu Chen, Heng Li, Caiquan Liu, Yafei Wen, Xiaoxin Chen

Abstract

High-quality tool-use data is critical for training language models to interact effectively with external tools. However, existing synthetic approaches typically follow a generate-then-filter paradigm with static post-hoc verification, often yielding inefficient data with imbalanced feature distributions. We propose ToolLoop, a closed-loop framework that decomposes synthesis into three progressive stages: (1) sampling function name combinations as ground truth; (2) backward derivation of user queries; and (3) forward derivation of tool calls. At each stage, dynamic self-feedback iteratively guides the model toward high-quality generation, realizing a transition from generate-then-filter to generate-verify-refine. On the Berkeley Function Calling Leaderboard (BFCL), a 4B parameter model trained with our 11K synthetic examples achieves 86.40% accuracy in non-reasoning mode, while an Isolate variant that removes BFCL-overlapping candidate functions still reaches 86.07%. Cross-benchmark evaluation on ACEBench further demonstrates strong generalization, with 72.1% overall accuracy using only 18.3% of baseline training data.

1 Introduction

Large language models (LLMs) have demonstrated remarkable capabilities in natural language understanding and generation (Agashe et al., 2024; Antoniades et al., 2024; Hu et al., 2025; Bahdanau et al., 2024). However, they remain fundamentally constrained by their static knowledge and limited ability to interact with the external world (Matarazzo and Torlone, 2025; Li et al., 2025). To address these limitations, recent research has adopted agent-based paradigms in which autonomous LLM-powered agents not only generate text but also interpret user intent and invoke external tools (e.g., APIs for weather queries, web search, or other services) to fulfill user requests, effectively bridging language understanding with

real-world actions (Xu et al., 2025a; Wang et al., 2025a; Ferrag et al., 2025). Despite this progress, training models to effectively leverage such tools requires high-quality tool-use datasets that accurately capture the relationship between user instruction and tool selection — a resource that remains extremely scarce in current datasets (Yang et al., 2025; Ye et al., 2025).

Existing synthetic methods for tool-use data primarily follow a “generate-then-filter” paradigm, where complete samples are generated in a single step and subsequently filtered using rule-based or model-based verification (Xu et al., 2025b; Liu et al., 2024a,b). While straightforward, this approach suffers from three fundamental limitations. First, due to the diversity and complexity of tools, selecting the correct and most efficient tool from a large candidate set in a generation is highly challenging (Kim et al., 2025). Second, static post-hoc filtering operates as a binary accept/reject mechanism that discards invalid instances without providing corrective feedback, thereby leading to biased feature distributions in the resulting dataset. Third, the absence of intermediate supervision during generation implies that the model receives no guidance on logical consistency between stages of generation (e.g., whether the generated tool call actually resolves the user query), leaving certain error modes unmitigated (Wang et al., 2025b).

To address these challenges, as illustrated in Figure 1, we propose ToolLoop, a closed-loop data synthesis framework that rethinks the generation process through decomposed generation and dynamic self-feedback. ToolLoop decomposes synthesis into three progressive stages with explicit intermediate representations. At each stage, we integrate a dynamic self-verification mechanism that detects problematic outputs and feeds identified issues back to the language model as explicit guidance for regeneration. This closed-loop feedback enables the model to learn from its mistakes

Figure

Figure 1: Comparison between existing generate-then-filter paradigm and our ToolLoop closed-loop synthesis framework with generate-verify-refine approach.

during synthesis and improves both efficiency and quality of retained samples. We conduct comprehensive evaluations on BFCL (Patil et al., 2025) and ACEBench (Chen et al., 2025), demonstrating strong improvements over existing approaches on both benchmarks.

Our contributions can be summarized as follows:

  • We introduce ToolLoop, a novel closed-loop framework that decomposes synthesis into three stages and integrates dynamic self-feedback to guide iterative optimization.

  • We demonstrate through comprehensive experiments on BFCL and ACEBench that ToolLoop achieves strong downstream task performance with substantially less training data.

  • We demonstrate the practical utility of ToolLoop by constructing an 11K-example synthetic tool-use dataset covering four representative function-calling scenarios.

References (29)