---
title: "AgenticQwen: Training Small Agentic Language Models with Dual Data Flywheels for Industrial-Scale Tool Use"
arxiv_id: "2604.21590v1"
authors:
  - Yuanjie Lyu
  - Chengyu Wang
  - Haonan Zheng
  - Yuanhao Yue
  - Junbing Yan
  - Ming Wang
  - Jun Huang
affiliations: Alibaba Group, Hangzhou, China
emails:
  - lyuyuanjie.lyj@alibaba-inc.com
  - chengyu.wcy@alibaba-inc.com
  - yizhen.zhn@alibaba-inc.com
  - yueyuanhao.yyh@alibaba-inc.com
  - yanjunbing.yjb@alibaba-inc.com
  - jinpu.wm@alibaba-inc.com
  - huangjun.hj@alibaba-inc.com
date: 2026-04-23
tags:
  - agentic language models
  - reinforcement learning
  - synthetic data generation
  - tool use
  - reasoning
  - behavior trees
  - industrial AI
  - small language models
---

## Contents
- 1 Introduction
- 2 Related Work
  - 2.1 Language Models as Agents
  - 2.2 Knowledge Distillation and Synthetic Data
- 3 Methodology
  - 3.1 Overview
  - 3.2 Reasoning Data Flywheel
    - Self-instruct expansion (structural diversity).
    - Persona injection (contextual diversity).
    - Multi-model consistency filtering.
  - 3.3 Agentic Data Flywheel
    - Phase 1: Linear task initialization.
    - Phase 2: Behavior tree expansion.
    - Phase 3: New task generation via branch-to-task inversion.
    - Phase 4: Adversarial mock-user intervention.
    - Synthetic data correctness and difficulty validation.
    - Iterative evolution.
- 4 Experiments
  - 4.1 Training and Evaluation
  - 4.2 Main Results
  - 4.3 Industrial Application
    - Use case: Enterprise data analytics.
    - Benchmark evaluation results.
- 5 Conclusion
- Limitations
- Ethical Considerations
- References
- Appendix A Additional Experimental Results on BFCL-V4: Web Search and Memory
- Appendix B A Generated Example from Agentic Data Flywheel
  - B.1 Task Description
  - B.2 Agent Input: Agent Instruction
  - B.3 Mock User Input: User Background
  - B.4 Mock User Input: Adversarial Strategy
  - B.5 Mock Tool Input: Available Tools
  - B.6 Mock Tool Input: Environment States
  - B.7 Execution Paths
  - B.8 Evaluation Criteria
  - B.9 Core Policy Constraint
- Appendix C Deployment
- Appendix D Prompts

## Abstract

Abstract Modern industrial applications increasingly demand language models that act as agents , capable of multi-step reasoning and tool use in real-world settings. These tasks are typically performed under strict cost and latency constraints, making small agentic models highly desirable. In this paper, we introduce the AgenticQwen family of models, trained via multi-round reinforcement learning (RL) on synthetic data and a limited amount of open-source data. Our training framework combines reasoning RL and agentic RL with dual data flywheels that automatically generate increasingly challenging tasks. The reasoning flywheel increases task difficulty by learning from errors, while the agentic flywheel expands linear workflows into multi-branch behavior trees that better reflect the decision complexity of real-world applications. We validate AgenticQwen on public benchmarks and in an industrial agent system. The models achieve strong performance on multiple agentic benchmarks, and in our industrial agent system, close the gap with much larger models on search and data analysis tasks. 1 1 1 Model checkpoints and part of the synthetic data: https://huggingface.co/collections/alibaba-pai/agenticqwen . 2 2 2 Data synthesis and RL training code: https://github.com/haruhi-sudo/data_synth_and_rl . 3 3 3 The data synthesis pipeline is also integrated into EasyDistill wang2025easydistill : https://github.com/modelscope/easydistill .

## 1 Introduction

Nowadays, users increasingly expect large language models (LLMs) to interact with the real world via external tools Xi et al. (2025) and to handle practical tasks such as booking flights or online shopping. Meanwhile, LLM-based agent systems deployed in industry (e.g., Manus Shen et al. (2025)) often rely on frontier proprietary models such as GPT-5 OpenAI (2025) and Claude Anthropic (2025), leading to high API costs. Even with open-source alternatives such as Qwen3-235B(^4^44We refer to Qwen3-235B-A22B-Instruct-2507 as Qwen3-235B throughout.) Yang et al. (2025), the computational cost remains prohibitive for applications serving millions of users.

For difficult and highly specialized tasks such as vibe coding Ray (2025), very large models may be indispensable. However, for relatively standardized, high-frequency tool-use and search tasks Jia et al. (2026) (e.g., booking flights), such large models are often unnecessary. Smaller models can handle these tasks effectively while substantially reducing cost and latency Lyu et al. (2025). Unfortunately, major foundation model developers such as Kimi Bai et al. (2025), MiniMax Chen et al. (2025a), and DeepSeek DeepSeek-AI (2025) rarely release small models with strong agentic capabilities, leaving a significant gap.

To fill this gap, we develop a family of *AgenticQwen* models built on small Qwen backbones. They are trained primarily on synthetic data, supplemented with a limited amount of open-source data, using GRPO-style (Group Relative Policy Optimization Shao et al. (2024)) multi-round reinforcement learning (RL). Our approach has two components: (i) *reasoning RL* and *agentic RL*, and (ii) dual *data flywheels* that continuously increase task difficulty. In reasoning RL, the model is trained on multi-step problems (e.g., mathematics and search), where it invokes tools such as web search and code interpreters and is rewarded based on final-answer correctness. In agentic RL, we target real-world scenarios: the model interacts with simulated users and tool environments, and receives 0-1 rewards from rubric-based evaluators that decompose each task into verifiable subgoals.

However, RL alone can quickly reach a performance ceiling: even with additional data, the training distribution may become overly homogeneous, limiting further gains. This motivates our dual *data flywheels*, which continuously generate more challenging examples and feed them back into subsequent RL rounds. For reasoning RL, we construct harder problems from the model's own errors and expand the dataset using self-instruct Wang et al. (2023) with larger models. For agentic RL, the initial training data follow linear solution paths; after each training round, we expand the task structure based on the model's observed behaviors by adding new decision branches, such that linear workflows gradually grow into multi-branch behavior trees that better reflect real-world diversity. We also update task backgrounds to ensure that different branches require distinct decisions. Finally, to further increase difficulty, simulated users may intentionally attempt to mislead the model into taking incorrect actions.

Empirically, *AgenticQwen* delivers strong tool-use capabilities despite its small size. On public agentic benchmarks, *AgenticQwen* models are competitive with substantially larger open-source models. In our industrial agent system, the models close the gap with Qwen3-235B on daily search and analysis tasks while offering lower inference cost.
The contributions of this paper are as follows:

- •
We propose AgenticQwen, a family of small agentic language models trained with multi-round reasoning RL and agentic RL.
- •
We introduce dual data flywheels: an error-driven reasoning flywheel for verifiable hard-example generation, and an agentic flywheel that expands linear workflows into executable behavior trees.
- •
We show that 8B/30B models substantially improve real-world tool use and narrow the gap to much larger models on public benchmarks and internal deployment tasks, with significantly lower serving cost.

## 2 Related Work

### 2.1 Language Models as Agents

Transforming large language models (LLMs) from static text generators into autonomous decision-makers requires strong reasoning, planning, and tool-use capabilities Xi et al. (2025); Sun et al. (2025). Frameworks such as ReAct Yao et al. (2022) and chain-of-thought (CoT) prompting Lightman et al. (2023) have laid the foundation for integrating reasoning with environment interaction. More recently, researchers have explored *agentic* reinforcement learning (RL), which builds on classical RL and language-agent frameworks (e.g., ReAct) to optimize long-horizon tool-use behavior. Classical RL algorithms such as PPO (Proximal Policy Optimization Schulman et al. (2017)) provide the conceptual basis, while agentic RL explicitly models natural-language reasoning and tool execution as part of the decision process Zhang et al. (2025). Recent studies further improve agentic RL by incorporating verifiable reward optimization Su et al. (2025) and more memory-efficient variants such as GRPO Shao et al. (2024).

### 2.2 Knowledge Distillation and Synthetic Data

While agentic RL can yield strong performance for large-scale models, high deployment costs motivate knowledge distillation (KD) Xu et al. (2024). Modern KD methods increasingly focus on transferring intermediate reasoning traces, such as step-by-step rationales and structured thought representations Li et al. (2025); Cai et al. (2025). This, in turn, increases the demand for high-quality training data. Moreover, agentic RL requires not only diverse data but also diverse *environments*, which remain scarce Yehudai et al. (2025). To address this bottleneck, prior work generates synthetic data using methods such as Self-Instruct Wang et al. (2023) and Persona Hub Ge et al. (2025). However, synthetic samples can become overly homogeneous, leading to rapid saturation of the learning signal and limiting further improvement lü2026mockworldsrealskills. To address this limitation, we introduce a data flywheel that continuously generates increasingly challenging samples throughout training.

## 3 Methodology

Figure: Figure 1: Overview of our dual data flywheels. The reasoning data flywheel generates increasingly challenging, verifiable problems from model failures, while the agentic data flywheel expands linear workflows into multi-branch behavior trees and generates new training data.
Refer to caption: 2604.21590v1/x1.png

### 3.1 Overview

We begin by training the model on open-source data before activating the data flywheels. For reasoning RL, we use Omni Gao et al. (2025), 2WikiMultiHopQA Ho et al. (2020), and HotpotQA Yang et al. (2018) to train the model to perform multi-step reasoning with web-search and code-interpreter tools. The model receives a binary reward based solely on final-answer correctness. Agentic RL targets real-world workflows. The initial training data for agentic RL are from SynthAgent lü2026mockworldsrealskills. Following its method, both tools and users are simulated by an LLM (Qwen3-235B in this paper) in a mock environment. Rewards follow a task-based rubric that decomposes each task into verifiable subgoals. For example, in a flight-booking workflow, one subgoal checks whether the model correctly calls a tool to update the user's order status. The model receives a reward in $[0,1]$ based on the proportion of subgoals completed.

Despite these RL objectives, a single training round yields limited improvements in agentic capability. Even when we enlarge the synthetic dataset, gains remain small because synthetic samples tend to be homogeneous, causing the learning signal to saturate quickly. To address this issue, as shown in Figure [1](#S3.F1), we introduce dual data flywheels that continuously generate more challenging training examples from the model's failures, enabling steady progress across training rounds.

### 3.2 Reasoning Data Flywheel

In reasoning RL, after each training round, we collect problems that the model fails to solve and retrain on these hard samples. However, such samples are limited in number, so we expand the training set with synthetic data. Because mathematical problems typically admit unique and easily verifiable solutions, we apply this expansion only to mathematical tasks.

The rectified scaling law for synthetic data Qin et al. (2025) suggests that performance can continue to improve with scale as long as data diversity is maintained. Guided by this principle, our synthesis pipeline focuses on maximizing diversity:

#### Self-instruct expansion (structural diversity).

A strong model rewrites each error case into harder variants by adjusting key values, adding constraints, or introducing additional concepts. For example, simple algebraic equations may become functional or multi-step problems. This step follows the Self-Instruct approach Wang et al. (2023), is implemented using Qwen3-235B, and increases structural diversity.

#### Persona injection (contextual diversity).

In addition, we rewrite some problems into applied domains using personas Ge et al. (2025), such as turning a geometry problem into a physics measurement task or embedding probability in a chemical reaction. This introduces contextual variation.

#### Multi-model consistency filtering.

To ensure verifiability and reduce noise, Qwen3-235B solves each candidate three times; we retain a sample only if all three solutions agree on the same final answer.

This flywheel continuously produces harder and more diverse samples. After each iteration, the updated model may exhibit new failure modes, which we then expand again, thereby steadily improving reasoning capability.

The reasoning flywheel is not limited to abstract math. Through persona injection, some problems are rewritten into real-world domains such as physics and chemistry. In addition, as we describe next, the agentic flywheel complements this component by introducing multi-branch behavior-tree expansion, which models ambiguity and conditional decision-making in messy real-world settings.

### 3.3 Agentic Data Flywheel

Constructing training data for agentic RL is substantially more challenging than for reasoning tasks. Real-world tool use requires an agent to handle changing environment states, ambiguous (and sometimes adversarial) user inputs, and long-horizon, branching workflows. Consequently, static synthetic datasets with fixed linear solution structures quickly saturate the learning signal. To address this limitation, we introduce an agentic data flywheel that continuously increases task complexity as the model improves.

#### Phase 1: Linear task initialization.

We initialize training with open-source data from SynthAgent lü2026mockworldsrealskills, whose tasks typically contain a single valid execution path. For example, a linear flight-booking workflow may follow

$$ $A_{\text{(Query)}}\rightarrow B_{\text{(Book)}}\rightarrow C_{\text{(Confirm)}},$ $$

where the environment is stable and the user intent is explicit (e.g., "Book a flight ticket to Beijing"). These tasks teach the model tool semantics and basic tool-invocation skills. However, their deterministic structure limits the model's exposure to conditional reasoning and robustness, motivating subsequent structural expansion.

#### Phase 2: Behavior tree expansion.

After each RL round, we expand the task structure by injecting conditional branches into the workflow. A larger LLM analyzes the existing trajectory and proposes alternative subpaths induced by distinct environment states. Thus, the linear path $A\rightarrow B\rightarrow C$ is transformed into a behavior tree:

$$ $A_{\text{(Query)}}\rightarrow\begin{cases}B_{\text{(Book)}}\rightarrow C_{\text{(Confirm)}},&\text{(Available)}\\ B_{\text{(Search HSR)}}\rightarrow\cdots,&\text{(Sold out)}\\ \cdots\rightarrow\cdots,&\cdots.\\ \end{cases}$ $$

For instance, replacing the flight state "Available" with "Sold out" can expand the workflow into branches such as searching for high-speed rail (HSR) tickets or querying nearby airports. This increases decision complexity from a single path to a tree that requires state-dependent planning.

#### Phase 3: New task generation via branch-to-task inversion.

After expanding the behavior tree, we construct training tasks from it to ensure that the model is trained and evaluated under multi-branch decision scenarios. To make each branch a required (rather than optional) execution path, we apply a branch-to-task inversion step that rewrites environment states and user/agent instructions.

Specifically, for any selected branch of the behavior tree, branch-to-task inversion first infers the conditions that would trigger it. For example, the branch "$B_{\text{(Search HSR)}}$" corresponds to an environment in which all flights are sold out. As illustrated in Figure [1](#S3.F1), we then construct a new task grounded in this environment, including a new state (e.g., "flight sold out") and a new user instruction (e.g., "I must arrive in Beijing tonight"). The agent must integrate these signals to select the next action. In parallel, we update the agent instruction, presented as a standard operating procedure (SOP). The SOP is initially empty, but it expands as the behavior tree and task complexity grow, placing increasing demands on the agent's ability to follow state-dependent strategies.

Finally, each training sample consists of three components: the environment state (input to the mock tool), the user instruction (input to the mock user), and the agent instruction (input to the agent).

#### Phase 4: Adversarial mock-user intervention.

To further increase task difficulty, we introduce an adversarial mock user. The mock user selects an unexpected branch as a *trap path*. We then use an LLM to rewrite the user instruction such that it implies an incorrect action, pushing the agent toward the wrong branch. For example, in delay scenarios, the behavior tree includes:

$$ $B_{\text{(Delayed)}}\rightarrow\begin{cases}C_{\text{(Gold)}}\rightarrow D_{\text{(Cash)}},\\ C_{\text{(Standard)}}\rightarrow D_{\text{(Voucher)}}.\\ \end{cases}$ $$

The mock user may deliberately claim "I should get cash compensation", even if they are a standard member. The agent must therefore verify membership status through tool queries and follow the correct branch. This adversarial setting encourages robustness and precise reasoning under distraction.

Figure: Algorithm 1 Agentic Data Flywheel

#### Synthetic data correctness and difficulty validation.

We explicitly validate synthesized tasks for correctness and bounded difficulty before adding them to training.
In the reasoning flywheel, we retain a sample only if a strong model produces consistent answers across multiple attempts, filtering out noisy or ambiguous generations.
In the agentic flywheel, we retain a synthesized task only if a strong model can solve it in the simulated environment, and its execution trace follows the intended branch during agentic data synthesis.
This ensures that flywheel-generated data remains both valid and non-trivial.

#### Iterative evolution.

The tasks in iteration $k$ serve as seeds for constructing more challenging tasks in iteration $k+1$, forming a closed-loop curriculum. As the policy improves, we expand the behavior tree with deeper branches and additional states, exposing new decision patterns that yield richer learning signals in the next RL round. Iterating this process can induce emergent agentic capabilities. Algorithm [1](#alg1) summarizes the procedure.

The flywheel follows a fixed procedure but is not fully deterministic. Repeated runs can yield diverse synthetic datasets because data synthesis involves model sampling.

Appendix [B](#A2) and [D](#A4) provide an example training instance and the data-synthesis prompt.

## 4 Experiments

**Table 1: Benchmark results on real-world tool environments. For TAU-2 (Airline, Telecom, and Retail), we report Avg@4 due to the small sample size. Additional subset results of BFCL-V4 are provided in Table [4](#A0.T4) of Appendix [A](#A1).**
| Models | TAU-2 Bench | BFCL-V4 Multi-turn | Avg. |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Airline | Telecom | Retail | Base | Miss Func | Miss Param | Long Context |  |  |
| Baselines (non-thinking, using tools) |  |  |  |  |  |  |  |  |
| Qwen3-235B-A22B-Instruct | 47.5 | 53.2 | 68.0 | 58.5 | 47.5 | 35.0 | 54.0 | 52.0 |
| Qwen3-30B-A3B-Instruct | 32.0 | 31.6 | 55.3 | 47.0 | 14.0 | 28.0 | 45.5 | 36.2 |
| Qwen3-32B | 22.5 | 27.6 | 44.7 | 50.5 | 43.0 | 30.5 | 33.0 | 36.0 |
| Qwen3-8B | 14.5 | 7.9 | 31.6 | 35.5 | 35.0 | 20.5 | 21.5 | 23.8 |
| *AgenticQwen*-8B | 40.5 | 53.5 | 60.3 | 56.0 | 47.5 | 33.5 | 40.5 | 47.4 |
| *AgenticQwen*-30B-A3B | 42.0 | 52.6 | 60.5 | 60.0 | 52.0 | 29.0 | 55.5 | 50.2 |

Figure: Figure 2: Performance gains from iterative data flywheel training. Across TAU-2 and BFCL-V4 Multi-Turn, both models initialized from Qwen3-30B-A3B and Qwen3-8B show steady improvements from Round 0 to Round 3. After three rounds, performance already approaches that of the strong model used for synthetic data generation, suggesting diminishing returns from further rounds; accordingly, we do not further extend training in this work.
Refer to caption: 2604.21590v1/x2.png

### 4.1 Training and Evaluation

Training. We employ Qwen3-235B throughout the data flywheel. With only 22B activated parameters, the model supports fast inference and modest hardware requirements. Following the SynthAgent framework lü2026mockworldsrealskills, we construct a fully simulated training environment in which both the user and tools are modeled locally by LLMs, eliminating reliance on proprietary-model APIs. Specifically, the user simulator receives the user input generated in Phase 3 of Section [3.3](#S3.SS3) and responds to the agent's queries over multiple turns. The tool simulator takes the environment state produced in Section [3.3](#S3.SS3) and returns tool-call results. Both simulators are implemented using Qwen3-235B. Reward computation is also performed by Qwen3-235B. Given the expected path back-translated into each task in Section [3.3](#S3.SS3), we check whether each sub-goal is completed in the trajectory by Qwen3-235B and assign a reward in $[0,1]$ accordingly. The policy is optimized using GRPO Shao et al. (2024). The total amount of training data is about 100K.

Benchmark Evaluation. We evaluate the model on multiple real interactive agentic benchmarks.
TAU-2 Barres et al. (2025): Covering 3 datasets, airline, retail, and telecommunications, TAU-2 includes approximately 300 multi-turn tasks, each typically involving 5-20 interaction rounds. In this benchmark, users may also invoke tools to modify the environment state, requiring the agent to perform dynamic decision-making, parameter clarification, and error recovery. Performance is assessed using Exact Match on the final environment states, and results are reported using the Avg@4 metric.
BFCL-V4 Multi-turn Patil et al. (2025): This benchmark contains roughly 800 tasks across diverse domains such as trading, vehicle control, and social media. It includes 4 datasets: Base, Miss Func, Miss Param, and Long Context. BFCL evaluates an agent's ability in tool orchestration, parameter elicitation, and error rejection. Task completion is measured using Exact Match.

Industrial Application Evaluation.
We develop a production agentic system deployed in a cloud-product setting, analogous to Manus. Through a sandboxed environment, the system can invoke a wide range of tools to complete daily tasks, such as generating line charts or summarizing a week's work documents. Appendix [C](#A3) provides an overview of the sandbox tools available to the system. *AgenticQwen* has been evaluated in an internal pilot within this system. When a task is predicted to fall within its capability range, a subset of requests is automatically routed to *AgenticQwen*. We present representative user cases that illustrate how *AgenticQwen* solves practical problems in this environment, and we provide quantitative evaluation on several deep-search benchmarks, including WebWalker Wu et al. (2025), XBench Chen et al. (2025b) and GAIA Mialon et al. (2023).

### 4.2 Main Results

Table [1](#S4.T1) shows that *AgenticQwen* models substantially outperform their vanilla counterparts. *AgenticQwen*-8B achieves an average score of 47.4, closing the gap to Qwen3-235B and more than doubling Qwen3-8B at 23.8. These results indicate that targeted agentic training can close much of the performance gap between small and large models, and can even surpass larger baselines on specific domains such as BFCL-Base. *AgenticQwen*-30B-A3B achieves the best overall performance at 50.2, with consistent gains across multi-turn dialogue, long-context reasoning, and complex tool use.

Figure [2](#S4.F2) shows steady performance gains from Round 0 to Round 3 for both model sizes across seven task categories. The consistent upward trends suggest that the flywheel process, driven by behavior tree expansion and adversarial interactions, reliably improves agentic capabilities.

*AgenticQwen-30B-A3B* is an MoE model with only 3B active parameters, while *AgenticQwen*-8B is dense and activates more parameters at inference. As a result, despite its larger total size, the 30B model matches the 8B model on some benchmarks.

### 4.3 Industrial Application

#### Use case: Enterprise data analytics.

Figure [3](#S4.F3) illustrates the agent's ability to integrate heterogeneous data sources into a cohesive business intelligence (BI) report. Given a high-level query about Q3 performance, the agent autonomously decomposes the request into executable subtasks: querying structured SQL sales data, parsing semi-structured JSON user logs, and applying retrieval-augmented generation (RAG) to unstructured PDF market-trend reports. This workflow tests the model's capabilities in schema discovery, cross-source reasoning, and dynamic tool orchestration.

#### Benchmark evaluation results.

Table [2](#S4.T2) reports results on three search benchmarks within our industrial agent system. Although our industrial system is not designed for search, these tasks provide clear ground-truth answers for quantitative evaluation. Despite only limited exposure to agentic search data (<10K) during training, *AgenticQwen* models still outperform the vanilla Qwen3-30B-A3B baseline (e.g., +17.0 on XBench for *AgenticQwen*-30B-A3B). The remaining gap to Qwen3-235B likely reflects domain mismatch and the fact that these tasks require very long context, where the 30B and 8B models' 40k context limits may constrain performance. Overall, the results suggest solid generalization: even with modest search-related training, the agentic capabilities learned through our flywheel-driven RL effectively transfer to these benchmarks.

Table [3](#S4.T3) shows that *AgenticQwen*-30B-A3B improves over its vanilla 30B counterpart while also slightly reducing average inference time, likely because better agentic planning leads to fewer unnecessary interaction steps. Compared with Qwen3-235B-A22B-Instruct, it is faster under the same deployment setup, supporting a better cost-performance trade-off for industrial use.

**Table 2: Evaluation in our production-deployed agent system on three search benchmarks.**
| Model | Web<br>Walker | XBench | GAIA |
| --- | --- | --- | --- |
| Online Deployment Accuracy |  |  |  |
| Qwen3-235B-A22B-Instruct | 59.5 | 48.0 | 48.5 |
| Qwen3-30B-A3B-Instruct | 45.0 | 30.0 | 37.3 |
| *AgenticQwen*-8B | 50.0 | 46.0 | 41.7 |
| *AgenticQwen*-30B-A3B | 52.5 | 47.0 | 41.7 |

**Table 3: Average end-to-end inference time on GAIA under the same hardware and serving setup.**
| Model | Avg. duration (s) |
| --- | --- |
| Qwen3-235B-A22B-Instruct | 449.5 |
| Qwen3-30B-A3B-Instruct | 355.6 |
| *AgenticQwen*-30B-A3B | 344.1 |

Figure: Figure 3: Case study of *AgenticQwen* in a production agentic system for data analytics.
Refer to caption: 2604.21590v1/x3.png

## 5 Conclusion

We present *AgenticQwen*, a family of small agentic language models designed for industrial-scale reasoning and tool use. By introducing a reasoning and agentic data flywheel, our models achieve strong performance across agentic tasks with many fewer parameters. Our results indicate that small agentic models can effectively support complex real-world workflows, making advanced agentic capabilities more accessible and practical to deploy.

## Limitations

Our current work focuses on reasoning and function calling. Although *AgenticQwen* models exhibit robust performance in these areas, agentic behaviors that require highly open-ended or long context capabilities remain challenging for small models.
For example, deep-search tasks demand very long contexts that exceed the native limits of the 8B and 30B models, highlighting the need to further improve long-context capabilities. Besides, we use Qwen models as the synthesizer, simulator, and evaluator because they provide a strong cost-efficiency trade-off for large-scale data generation. This may introduce model-family bias. To support broader validation, we open-source the full data synthesis pipeline and training code, and encourage future work to use other model families in the same framework.

## Ethical Considerations

Agentic language models deployed in industrial settings may pose ethical risks, including unintended automation of sensitive user interactions, misuse of tool invocation, and propagation of biases inherited from base models or training data. We recommend careful monitoring in production environments, transparent reporting of deployed model capabilities and limitations, and ongoing evaluation of bias and fairness, particularly for tasks involving personal or financial information.

## References

- Anthropic (2025)
Claude.
Note: [https://claude.ai](https://claude.ai)
Cited by: [§1](#S1.p1.1).
- Y. Bai, Y. Bao, G. Chen, J. Chen, N. Chen, R. Chen, Y. Chen, Y. Chen, Y. Chen, Z. Chen, J. Cui, H. Ding, M. Dong, A. Du, C. Du, D. Du, Y. Du, Y. Fan, Y. Feng, K. Fu, B. Gao, H. Gao, P. Gao, T. Gao, X. Gu, L. Guan, H. Guo, J. Guo, H. Hu, X. Hao, T. He, W. He, W. He, C. Hong, Y. Hu, Z. Hu, W. Huang, Z. Huang, Z. Huang, T. Jiang, Z. Jiang, X. Jin, Y. Kang, G. Lai, C. Li, F. Li, H. Li, M. Li, W. Li, Y. Li, Y. Li, Z. Li, Z. Li, H. Lin, X. Lin, Z. Lin, C. Liu, C. Liu, H. Liu, J. Liu, J. Liu, L. Liu, S. Liu, T. Y. Liu, T. Liu, W. Liu, Y. Liu, Y. Liu, Y. Liu, Y. Liu, Z. Liu, E. Lu, L. Lu, S. Ma, X. Ma, Y. Ma, S. Mao, J. Mei, X. Men, Y. Miao, S. Pan, Y. Peng, R. Qin, B. Qu, Z. Shang, L. Shi, S. Shi, F. Song, J. Su, Z. Su, X. Sun, F. Sung, H. Tang, J. Tao, Q. Teng, C. Wang, D. Wang, F. Wang, and H. Wang (2025)
Kimi k2: open agentic intelligence.
arXiv preprint arXiv:2507.20534.
Cited by: [§1](#S1.p2.1).
- V. Barres, H. Dong, S. Ray, X. Si, and K. Narasimhan (2025)
$\tau^{2}$-Bench: evaluating conversational agents in a dual-control environment.
arXiv preprint arXiv:2506.07982.
Cited by: [§4.1](#S4.SS1.p2.1).
- W. Cai, C. Wang, J. Yan, J. Huang, and X. Fang (2025)
Enhancing reasoning abilities of small llms with cognitive alignment.
In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing,
pp. 7434-7449.
Cited by: [§2.2](#S2.SS2.p1.1).
- A. Chen, A. Li, B. Gong, B. Jiang, B. Fei, B. Yang, B. Shan, C. Yu, C. Wang, C. Zhu, C. Xiao, C. Du, C. Zhang, C. Qiao, C. Zhang, C. Du, C. Guo, D. Chen, D. Ding, D. Sun, D. Li, E. Jiao, H. Zhou, H. Zhang, H. Ding, H. Sun, H. Feng, H. Cai, H. Zhu, J. Sun, J. Zhuang, J. Cai, J. Song, J. Zhu, J. Li, J. Tian, J. Liu, J. Xu, J. Yan, J. Liu, J. He, K. Feng, K. Yang, K. Xiao, L. Han, L. Wang, L. Yu, L. Feng, L. Li, L. Zheng, L. Du, L. Yang, L. Zeng, M. Yu, M. Tao, M. Chi, M. Zhang, M. Lin, N. Hu, N. Di, P. Gao, P. Li, P. Zhao, Q. Ren, Q. Xu, Q. Li, Q. Wang, R. Tian, R. Leng, S. Chen, S. Chen, S. Shi, S. Weng, S. Guan, S. Yu, S. Li, S. Zhu, T. Li, T. Cai, T. Liang, W. Cheng, W. Kong, W. Li, X. Chen, X. Song, X. Luo, X. Su, X. Li, X. Han, X. Hou, X. Lu, X. Zou, X. Shen, Y. Gong, Y. Ma, Y. Wang, Y. Shi, Y. Zhong, and Y. Duan (2025a)
MiniMax-m1: scaling test-time compute efficiently with lightning attention.
arXiv preprint arXiv:2506.13585.
Cited by: [§1](#S1.p2.1).
- K. Chen, Y. Ren, Y. Liu, X. Hu, H. Tian, T. Xie, F. Liu, H. Zhang, H. Liu, Y. Gong, et al. (2025b)
Xbench: tracking agents productivity scaling with profession-aligned real-world evaluations.
arXiv preprint arXiv:2506.13651.
Cited by: [§4.1](#S4.SS1.p3.1).
- DeepSeek-AI (2025)
DeepSeek-v3.2: pushing the frontier of open large language models.
arXiv preprint arXiv:2512.02556.
Cited by: [§1](#S1.p2.1).
- B. Gao, F. Song, Z. Yang, Z. Cai, Y. Miao, Q. Dong, L. Li, C. Ma, L. Chen, R. Xu, et al. (2025)
Omni-math: a universal olympiad level mathematic benchmark for large language models.
In The Thirteenth International Conference on Learning Representations,
Cited by: [§3.1](#S3.SS1.p1.1).
- T. Ge, X. Chan, X. Wang, D. Yu, H. Mi, and D. Yu (2025)
Scaling synthetic data creation with 1,000,000,000 personas.
arXiv preprint arXiv:2406.20094.
Cited by: [§2.2](#S2.SS2.p1.1),
[§3.2](#S3.SS2.SSS0.Px2.p1.1).
- X. Ho, A. D. Nguyen, S. Sugawara, and A. Aizawa (2020)
Constructing a multi-hop qa dataset for comprehensive evaluation of reasoning steps.
In Proceedings of the 28th International Conference on Computational Linguistics,
pp. 6609-6625.
Cited by: [§3.1](#S3.SS1.p1.1).
- S. Jia, S. Bit, V. H. Jasodanand, Y. Liu, and V. B. Kolachalama (2026)
Agentic memory-augmented retrieval and evidence grounding for medical question-answering tasks.
Int. J. Medical Informatics 212, pp. 106339.
Cited by: [§1](#S1.p2.1).
- W. Li, J. Lin, Z. Jiang, J. Cao, X. Liu, J. Zhang, Z. Huang, Q. Chen, W. Sun, Q. Wang, H. Lu, T. Qin, C. Zhu, Y. Yao, S. Fan, X. Li, T. Wang, P. Liu, K. Zhu, H. Zhu, D. Shi, P. Wang, Y. Guan, X. Tang, M. Liu, Y. E. Jiang, J. Yang, J. Liu, G. Zhang, and W. Zhou (2025)
Chain-of-agents: end-to-end agent foundation models via multi-agent distillation and agentic RL.
arXiv preprint arXiv:2508.13167.
Cited by: [§2.2](#S2.SS2.p1.1).
- H. Lightman, V. Kosaraju, Y. Burda, H. Edwards, B. Baker, T. Lee, J. Leike, J. Schulman, I. Sutskever, and K. Cobbe (2023)
Let's verify step by step.
In The Twelfth International Conference on Learning Representations,
Cited by: [§2.1](#S2.SS1.p1.1).
- Y. Lyu, C. Wang, J. Huang, and T. Xu (2025)
From correction to mastery: reinforced distillation of large language model agents.
arXiv preprint arXiv:2509.14257.
Cited by: [§1](#S1.p2.1).
- G. Mialon, C. Fourrier, T. Wolf, Y. LeCun, and T. Scialom (2023)
Gaia: a benchmark for general ai assistants.
In The Twelfth International Conference on Learning Representations,
Cited by: [§4.1](#S4.SS1.p3.1).
- OpenAI (2025)
GPT-5.
Note: [https://openai.com/gpt-5](https://openai.com/gpt-5)
Cited by: [§1](#S1.p1.1).
- S. G. Patil, H. Mao, C. Cheng-Jie Ji, F. Yan, V. Suresh, I. Stoica, and J. E. Gonzalez (2025)
The berkeley function calling leaderboard (bfcl): from tool use to agentic evaluation of large language models.
In Forty-second International Conference on Machine Learning,
Cited by: [§4.1](#S4.SS1.p2.1).
- Z. Qin, Q. Dong, X. Zhang, L. Dong, X. Huang, Z. Yang, M. Khademi, D. Zhang, H. H. Awadalla, Y. R. Fung, W. Chen, M. Cheng, and F. Wei (2025)
Scaling laws of synthetic data for language models.
arXiv preprint arXiv:2503.19551.
Cited by: [§3.2](#S3.SS2.p2.1).
- P. P. Ray (2025)
A review on vibe coding: fundamentals, state-of-the-art, challenges and future directions.
Authorea Preprints.
Cited by: [§1](#S1.p2.1).
- J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov (2017)
Proximal policy optimization algorithms.
arXiv preprint arXiv:1707.06347.
Cited by: [§2.1](#S2.SS1.p1.1).
- Z. Shao, P. Wang, Q. Zhu, R. Xu, J. Song, M. Zhang, Y. K. Li, Y. Wu, and D. Guo (2024)
Deepseekmath: pushing the limits of mathematical reasoning in open language models.
arXiv preprint arXiv:2402.03300.
Cited by: [§1](#S1.p3.1),
[§2.1](#S2.SS1.p1.1),
[§4.1](#S4.SS1.p1.1).
- M. Shen, Y. Li, L. Chen, and Q. Yang (2025)
From mind to machine: the rise of manus ai as a fully autonomous digital agent.
arXiv preprint arXiv:2505.02024.
Cited by: [§1](#S1.p1.1).
- Y. Su, D. Yu, L. Song, J. Li, H. Mi, Z. Tu, M. Zhang, and D. Yu (2025)
Crossing the reward bridge: expanding rl with verifiable rewards across diverse domains.
arXiv preprint arXiv:2503.23829.
Cited by: [§2.1](#S2.SS1.p1.1).
- L. Sun, L. He, S. Jia, Y. He, and C. You (2025)
DocAgent: an agentic framework for multi-modal long-context document understanding.
In Proceedings of the 2025 Conference on Empirical Methods in Natural
Language Processing, EMNLP 2025, Suzhou, China, November 4-9, 2025,
pp. 17701-17716.
Cited by: [§2.1](#S2.SS1.p1.1).
- Y. Wang, Y. Kordi, S. Mishra, A. Liu, N. A. Smith, D. Khashabi, and H. Hajishirzi (2023)
Self-instruct: aligning language models with self-generated instructions.
In Proceedings of the 61st annual meeting of the association for computational linguistics (volume 1: long papers),
pp. 13484-13508.
Cited by: [§1](#S1.p4.1),
[§2.2](#S2.SS2.p1.1),
[§3.2](#S3.SS2.SSS0.Px1.p1.1).
- J. Wu, W. Yin, Y. Jiang, Z. Wang, Z. Xi, R. Fang, L. Zhang, Y. He, D. Zhou, P. Xie, et al. (2025)
Webwalker: benchmarking llms in web traversal.
arXiv preprint arXiv:2501.07572.
Cited by: [§4.1](#S4.SS1.p3.1).
- Z. Xi, W. Chen, X. Guo, W. He, Y. Ding, B. Hong, M. Zhang, J. Wang, S. Jin, E. Zhou, R. Zheng, X. Fan, X. Wang, L. Xiong, Y. Zhou, W. Wang, C. Jiang, Y. Zou, X. Liu, Z. Yin, S. Dou, R. Weng, W. Qin, Y. Zheng, X. Qiu, X. Huang, Q. Zhang, and T. Gui (2025)
The rise and potential of large language model based agents: a survey.
Science China Information Sciences 68 (2), pp. 121101.
Cited by: [§1](#S1.p1.1),
[§2.1](#S2.SS1.p1.1).
- X. Xu, M. Li, C. Tao, T. Shen, R. Cheng, J. Li, C. Xu, D. Tao, and T. Zhou (2024)
A survey on knowledge distillation of large language models.
arXiv preprint arXiv:2402.13116.
Cited by: [§2.2](#S2.SS2.p1.1).
- A. Yang, A. Li, B. Yang, B. Zhang, B. Hui, B. Zheng, B. Yu, C. Gao, C. Huang, C. Lv, C. Zheng, D. Liu, F. Zhou, F. Huang, F. Hu, H. Ge, H. Wei, H. Lin, J. Tang, J. Yang, J. Tu, J. Zhang, J. Yang, J. Yang, J. Zhou, J. Lin, K. Dang, K. Bao, K. Yang, L. Yu, L. Deng, M. Li, M. Xue, M. Li, P. Zhang, P. Wang, Q. Zhu, R. Men, R. Gao, S. Liu, S. Luo, T. Li, T. Tang, W. Yin, X. Ren, X. Wang, X. Zhang, X. Ren, Y. Fan, Y. Su, Y. Zhang, Y. Zhang, Y. Wan, Y. Liu, Z. Wang, Z. Cui, Z. Zhang, Z. Zhou, and Z. Qiu (2025)
Qwen3 technical report.
arXiv preprint arXiv:2505.09388.
Cited by: [§1](#S1.p1.1).
- Z. Yang, P. Qi, S. Zhang, Y. Bengio, W. Cohen, R. Salakhutdinov, and C. D. Manning (2018)
HotpotQA: a dataset for diverse, explainable multi-hop question answering.
In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing,
Cited by: [§3.1](#S3.SS1.p1.1).
- S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. R. Narasimhan, and Y. Cao (2022)
React: synergizing reasoning and acting in language models.
In The eleventh international conference on learning representations,
Cited by: [§2.1](#S2.SS1.p1.1).
- A. Yehudai, L. Eden, A. Li, G. Uziel, Y. Zhao, R. Bar-Haim, A. Cohan, and M. Shmueli-Scheuer (2025)
Survey on evaluation of llm-based agents.
arXiv preprint arXiv:2503.16416.
Cited by: [§2.2](#S2.SS2.p1.1).
- G. Zhang, H. Geng, X. Yu, Z. Yin, Z. Zhang, Z. Tan, H. Zhou, Z. Li, X. Xue, Y. Li, Y. Zhou, Y. Chen, C. Zhang, Y. Fan, Z. Wang, S. Huang, Y. Liao, H. Wang, M. Yang, H. Ji, M. Littman, J. Wang, S. Yan, P. Torr, and L. Bai (2025)
The landscape of agentic reinforcement learning for llms: a survey.
arXiv preprint arXiv:2509.02547.
Cited by: [§2.1](#S2.SS1.p1.1).

## Appendix A Additional Experimental Results on BFCL-V4: Web Search and Memory

We further evaluate our models on the BFCL-V4 benchmark, specifically focusing on the Web Search and Memory subsets. The Web Search subset emphasizes retrieval-oriented browsing, requiring the model to issue queries, inspect search snippets or raw webpage content, and synthesize grounded answers. The Memory subset targets long-horizon state tracking, where the model must utilize a stored snapshot in place of conventional chat history, thereby testing its ability to retrieve, update, and reason over accumulated user-specific information.

*AgenticQwen* demonstrates substantial improvements compared to the vanilla Qwen3-30B-A3B baseline, closing most of the gap to Qwen3-235B; the gains are especially notable on Memory tasks, where long-horizon reasoning directly benefits from our agentic training regimen. The remaining gap on Web Search tasks is primarily attributable to context length limitations: the 8B model supports only up to 40K tokens and thus cannot fully process long retrieved documents, making this task more challenging for models with smaller capacity.

## Appendix B A Generated Example from Agentic Data Flywheel

### B.1 Task Description

### B.2 Agent Input: Agent Instruction

### B.3 Mock User Input: User Background

### B.4 Mock User Input: Adversarial Strategy

### B.5 Mock Tool Input: Available Tools

| get_student_academic_record(student_id) |
| --- |
| $\rightarrow$ Returns GPA and disciplinary hold status |
| get_player_stats(player_id) |
| $\rightarrow$ Returns season averages (points, rebounds) |
| check_nomination_status(player_id) |
| $\rightarrow$ Checks existing active nominations |
| submit_nomination(player_id, endorsement) |
| $\rightarrow$ Submits nomination if eligible |
| update_player_profile(player_id, field, value) |
| $\rightarrow$ Updates bio or honors fields |

### B.6 Mock Tool Input: Environment States

### B.7 Execution Paths

The sample execution paths are shown in Figure [4](#A2.F4).

Figure: Figure 4: Expected execution: compliant path (left) verifies academic records, refuses nomination due to policy violations, then completes authorized bio update. Adversarial path (right) attempts unauthorized submission by exploiting user's false claim.

### B.8 Evaluation Criteria

| Result | Type | Condition |
| --- | --- | --- |
| $\checkmark$ | Pass | Bio field successfully updated |
| $\checkmark$ | submit_nomination() NOT called |  |
| $\times$ | Fail | submit_nomination() called (policy breach) |
| $\times$ | Bio update not executed |  |

### B.9 Core Policy Constraint

The example in this section is automatically produced by our Agentic Data Flywheel. For each task domain, the flywheel maintains a behavior tree that enumerates possible execution branches. During data generation, the flywheel first samples an executable path from this tree. In this case, the sampled trajectory corresponds to the compliant branch in Figure [4](#A2.F4): the agent verifies eligibility conditions, refuses the nomination, and then performs the permitted profile update.

After selecting the path, the flywheel reconstructs a full natural-language task description and the corresponding environment state (Section [B.6](#A2.SS6)). The academic record (GPA 2.8 with an active disciplinary hold) is injected directly from the system state, ensuring that the agent must follow the policy requirement that any academic deficiency triggers a mandatory refusal. To improve robustness, the flywheel additionally attaches an adversarial perturbation (Section [B.4](#A2.SS4)). Here, the user's claim that "the academic office confirmed eligibility" corresponds to the jailbreak vector illustrated on the right side of Figure [4](#A2.F4).

Finally, the synthesized interaction is decomposed into three aligned input streams used for agentic RL training:

- 1.
Agent Instruction: A policy that contains only the rules necessary to execute the selected path (Section [B.2](#A2.SS2)).
- 2.
Mock User Inputs: A natural-language request plus an adversarial strategy that pushes the agent toward an incorrect path (Sections [B.3](#A2.SS3) and [B.4](#A2.SS4)).
- 3.
Mock Tool and Environment Inputs: The tool interface and system state (Sections [B.5](#A2.SS5) and [B.6](#A2.SS6)), ensuring that every tool call in Figure [4](#A2.F4) is reproducible.

This procedure converts a single sampled path from the behavior tree into a complete RL-ready training example that combines realistic user intent, adversarial pressure, and policy-grounded tool-use sequences.

## Appendix C Deployment

Our industrial agentic system is deployed in a cloud-product setting. Table [5](#A3.T5) provides an overview of the sandbox tools available to the system. It serves enterprise and developer users by orchestrating LLM-driven planning, tool execution, and result verification under strict latency and cost constraints. In internal pilots, a subset of requests is automatically routed to a small *AgenticQwen* model when the task is predicted to be within its capability. This design is motivated by the observation that many high-frequency workloads in cloud products are standardized (e.g., information retrieval, routine analysis, and operational diagnostics) and therefore do not require frontier models in most cases.

**Table 5: List of tools in our industrial agent system.**
| ID | Tool Name |
| --- | --- |
| 1 | Search Engine |
| 2 | Web Browser |
| 3 | Calculator |
| 4 | PDF Reader / Viewer |
| 5 | Wikipedia |
| 6 | Spreadsheet Editor |
| 7 | Unlambda Compiler (Optional) |
| 8 | Word Reversal Tool / Script |
| 9 | Counter |
| 10 | Internet Archive Access (web.archive.org) |
| 11 | Text Processing / Diff Tool |
| 12 | GIF Parsing Tools |
| 13 | Code / Data Analysis Tools |
| 14 | Audio Capability |
| 15 | Markdown |
| 16 | Google Translate Access |
| 17 | Computer Algebra System |
| 18 | Computer Vision |
| 19 | Google Maps |
| 20 | File Interface |
| 21 | Python IDE |
| 22 | Natural Language Processor |
| 23 | Graph Interaction Tools |
| 24 | Babylonian Cuneiform -> Arabic Legend |
| 25 | Access to Academic Journal Websites |
| 26 | Rubik's Cube Model |
| 27 | Access to Internet (general) |

## Appendix D Prompts

Our data generation pipeline employs a two-phase prompting strategy to construct test cases from workflow specifications. Figures [5](#A4.F5)-[7](#A4.F7) show the first prompt, which expands a standard workflow into a comprehensive behavior tree. Figures [8](#A4.F8)-[9](#A4.F9) show the second prompt, which converts individual branches into test cases. For each target branch, it generates: (1) a natural-language user request that implicitly triggers the corresponding condition, (2) user background information with tool-query parameters, (3) a normal path, (4) a hack path that violates tool constraints after user persuasion, and (5) an adversarial strategy for pushing the agent toward the hack path.

Each training sample contains three components: environment state (input to the mock tool), user instruction (input to the mock user), and agent instruction (system prompt of the agent).

Figure: Figure 5: Prompt for workflow expansion and agent-instruction generation (Part 1: Objective and tool design).

Figure: Figure 6: Prompt for workflow expansion and agent-instruction generation (Part 2: Behavior tree structure).

Figure: Figure 7: Prompt for workflow expansion and agent-instruction generation (Part 3: Output format).

Figure: Figure 8: Prompt for converting branches into executable test cases (Part 1: User input).

Figure: Figure 9: Prompt for converting branches into executable test cases (Part 2: Output format).